6 #include "TauSpinner/ew_born.h"
7 #include "TauSpinner/EWtables.h"
37 double AMZi= 91.18870000;
38 double GAM=2.49520000;
39 double SWeff= 0.2235200000;
42 double Gmu=0.00001166389;
43 double alfinv=137.0359895;
56 const char *tableLocationMu = mumu;
57 const char *tableLocationDown = downdown;
58 const char *tableLocationUp = upup;
63 cout <<
"initializing table " << tableLocationMu <<
": " << endl;
64 bool resultMu = ewbornMu.FillFromTable(tableLocationMu);
67 cout <<
"ERROR: could not parse table : " << tableLocationMu << endl;
71 cout <<
"initializing table " << tableLocationDown <<
": " << endl;
72 bool resultDown = ewbornDown.FillFromTable(tableLocationDown);
75 cout <<
"ERROR: could not parse table: " << tableLocationDown << endl;
79 cout <<
"initializing table " << tableLocationUp <<
": " << endl;
80 bool resultUp = ewbornUp.FillFromTable(tableLocationUp);
83 cout <<
"ERROR: could not parse table: " << tableLocationUp << endl;
356 complex<double>
EWFACT(
int FLAV,
int NO,
double s,
double costhe){
357 complex<double> rezu=complex<double>(0.3,0.4);
372 double EaMin= ewb->EEa[0];
double EaMax= ewb->EEa[ewb->NA-1];
373 double EbMin= ewb->EEb[0];
double EbMax= ewb->EEb[ewb->NB-1];
374 double EcMin= ewb->EEc[0];
double EcMax= ewb->EEc[ewb->NC-1];
375 double EdMin= ewb->EEd[0];
double EdMax= ewb->EEd[ewb->ND-1];
378 double stepA= log(ewb->EEa[1] /ewb->EEa[0]);
379 double stepB= ewb->EEb[1] - ewb->EEb[0];
380 double stepC= ewb->EEc[1] - ewb->EEc[0];
381 double stepD= ewb->EEd[1] - ewb->EEd[0];
383 if(Ene>EbMin && Ene<EbMax){
384 int Index=((Ene-EbMin)/(EbMax-EbMin)*(ewb->NB-1));
385 int Ic=(((costhe+1.0)/2*(ewb->MB-1)));
386 rezu= ewb->FFb[Index][Ic][NO]
387 + (Ene -ewb->EEb[Index]) /stepB * (ewb->FFb[Index+1][Ic][NO] - ewb->FFb[Index][Ic][NO])
388 + ( (costhe+1.)/2. - (1.0*Ic)/(ewb->MB-1) )*(ewb->MB-1)*(
389 (1- (Ene -ewb->EEb[Index])/stepB )*(ewb->FFb[Index ][Ic+1][NO] - ewb->FFb[Index ][Ic][NO])
390 +( (Ene -ewb->EEb[Index])/stepB )*(ewb->FFb[Index+1][Ic+1][NO] - ewb->FFb[Index+1][Ic][NO]) );
392 else if (Ene>EcMin && Ene<EcMax){
393 int Index=((Ene-EcMin)/(EcMax-EcMin)*(ewb->NC-1));
394 int Ic=(((costhe+1.0)/2*(ewb->MC-1)));
395 rezu= ewb->FFc[Index][Ic][NO]
396 + (Ene -ewb->EEc[Index]) /stepC * (ewb->FFc[Index+1][Ic][NO] - ewb->FFc[Index][Ic][NO])
397 + ( (costhe+1.)/2. - (1.0*Ic)/(ewb->MC-1) )*(ewb->MC-1)*(
398 (1- (Ene -ewb->EEc[Index])/stepC )*(ewb->FFc[Index ][Ic+1][NO] - ewb->FFc[Index ][Ic][NO])
399 +( (Ene -ewb->EEc[Index])/stepC )*(ewb->FFc[Index+1][Ic+1][NO] - ewb->FFc[Index+1][Ic][NO]) );
401 else if (Ene>EdMin && Ene<EdMax){
402 int Index=((Ene-EdMin)/(EdMax-EdMin)*(ewb->ND-1));
403 int Ic=((costhe+1.0)/2.)*(ewb->MD-1);
404 rezu= ewb->FFd[Index][Ic][NO]
405 + (Ene -ewb->EEd[Index]) /stepD * (ewb->FFd[Index+1][Ic][NO] - ewb->FFd[Index][Ic][NO])
406 + ( (costhe+1.)/2. - (1.0*Ic)/(ewb->MD-1) )*(ewb->MD-1)*(
407 (1- (Ene -ewb->EEd[Index])/stepD )*(ewb->FFd[Index ][Ic+1][NO] - ewb->FFd[Index ][Ic][NO])
408 +( (Ene -ewb->EEd[Index])/stepD )*(ewb->FFd[Index+1][Ic+1][NO] - ewb->FFd[Index+1][Ic][NO]) );
412 else if (Ene>EaMin && Ene<EaMax){
413 int Index=((log(Ene)-log(EaMin))/(log(EaMax)-log(EaMin))*(ewb->NA-1));
414 rezu= ewb->FFa[Index][NO]
415 + (log(Ene)-log(ewb->EEa[Index])) /stepA * (ewb->FFa[Index+1][NO] - ewb->FFa[Index][NO]);
419 rezu=complex<double>(1.0,0.0);
483 double EaMin= ewb->EEa[0];
double EaMax= ewb->EEa[ewb->NA-1];
484 double EbMin= ewb->EEb[0];
double EbMax= ewb->EEb[ewb->NB-1];
485 double EcMin= ewb->EEc[0];
double EcMax= ewb->EEc[ewb->NC-1];
486 double EdMin= ewb->EEd[0];
double EdMax= ewb->EEd[ewb->ND-1];
489 double stepA= log(ewb->EEa[1] /ewb->EEa[0]);
490 double stepB= ewb->EEb[1] - ewb->EEb[0];
491 double stepC= ewb->EEc[1] - ewb->EEc[0];
492 double stepD= ewb->EEd[1] - ewb->EEd[0];
494 if(Ene>EbMin && Ene<EbMax){
495 int Index=((Ene-EbMin)/(EbMax-EbMin)*(ewb->NB-1));
496 rezu= ewb->FSb[Index][NO]
497 + (Ene-ewb->EEb[Index]) /stepB * (ewb->FSb[Index+1][NO] - ewb->FSb[Index][NO]);
500 else if (Ene>EcMin && Ene<EcMax){
501 int Index=((Ene-EcMin)/(EcMax-EcMin)*(ewb->NC-1));
502 rezu= ewb->FSc[Index][NO]
503 + (Ene-ewb->EEc[Index]) /stepC * (ewb->FSc[Index+1][NO] - ewb->FSc[Index][NO]);
507 else if (Ene>EdMin && Ene<EdMax){
508 int Index=((Ene-EdMin)/(EdMax-EdMin)*(ewb->ND-1));
509 rezu= ewb->FSd[Index][NO]
510 + (Ene-ewb->EEd[Index]) /stepD * (ewb->FSd[Index+1][NO] - ewb->FSd[Index][NO]);
513 else if (Ene>EaMin && Ene<EaMax){
514 int Index=((log(Ene)-log(EaMin))/(log(EaMax)-log(EaMin))*(ewb->NA-1));
515 rezu= ewb->FSa[Index][NO]
516 + (log(Ene)-log(ewb->EEa[Index])) /stepA * (ewb->FSa[Index+1][NO] - ewb->FSa[Index][NO]);
527 void ExtraEWparamsGet(
double *AMZi,
double *GAM,
double *SWeff,
double *alfinv,
double *DeltSQ,
double* DeltV,
double *Gmu,
int *keyGSW){
529 cout <<
"ERROR Born parameters are not initialized: you can not get them. We stop "<< endl;
545 cout <<
"WARNING: Born parameters are not initialized you can not adjust keyGSW "<< endl;
556 void ExtraEWparamsSet(
double AMZi,
double GAM,
double SWeff,
double alfinv,
double DeltSQ,
double DeltV,
double Gmu,
int keyGSW){
557 if(m_AMZi !=AMZi ){ m_AMZi =AMZi; m_status=0;}
558 if(m_GAM !=GAM ){ m_GAM =GAM; m_status=0;}
559 if(m_SWeff !=SWeff ){ m_SWeff =SWeff; m_status=0;}
560 if(m_alfinv!=alfinv){ m_alfinv=alfinv; m_status=0;}
561 if(m_DeltSQ!=DeltSQ){ m_DeltSQ=DeltSQ; m_status=0;}
562 if(m_DeltV !=DeltV ){ m_DeltV =DeltV; m_status=0;}
563 if(m_Gmu !=Gmu ){ m_Gmu =Gmu; m_status=0;}
564 if(m_keyGSW!=keyGSW){ m_keyGSW=keyGSW; m_status=0;}
579 cout <<
" electroweak tables not initialized. We stop run "<< endl;
583 if (ID==ID0 && key==key0 && S==S0 && cost==cost0 &&
ExtraEWparams()!=0){
601 else if (
ExtraEWparams()==0 || ID0!=ID || S0!=S || cost0!=cost || key0!=key ){
626 if(keyGSW!=1){costhe=0.0;SSS=AMZi*AMZi;}
629 ReGSW1 = real(
EWFACT(ID,0,SS,costhe));
630 ReGSW2 = real(
EWFACT(ID,1,SS,costhe));
631 ReGSW3 = real(
EWFACT(ID,2,SS,costhe));
632 ReGSW4 = real(
EWFACT(ID,3,SS,costhe));
634 ReGSW6 = real(
EWFACT(ID,6,SS,costhe));
636 ImGSW1 = imag(
EWFACT(ID,0,SS,costhe));
637 ImGSW2 = imag(
EWFACT(ID,1,SS,costhe));
638 ImGSW3 = imag(
EWFACT(ID,2,SS,costhe));
639 ImGSW4 = imag(
EWFACT(ID,3,SS,costhe));
641 ImGSW6 = imag(
EWFACT(ID,6,SS,costhe));
648 ReGSW6 = real(
EWFACT(ID,6,SSS,costhe));
654 ImGSW6 = imag(
EWFACT(ID,6,SSS,costhe));
658 ReGSW1 = real(
EWFACT(ID,0,SSS,costhe));
662 ReGSW6 = real(
EWFACT(ID,6,SSS,costhe));
664 ImGSW1 = imag(
EWFACT(ID,0,SSS,costhe));
668 ImGSW6 = imag(
EWFACT(ID,6,SSS,costhe));
672 ReGSW1 = real(
EWFACT(ID,0,SSS,costhe));
673 ReGSW2 = real(
EWFACT(ID,1,SSS,costhe));
674 ReGSW3 = real(
EWFACT(ID,2,SSS,costhe));
675 ReGSW4 = real(
EWFACT(ID,3,SSS,costhe));
676 ReGSW6 = real(
EWFACT(ID,6,SSS,costhe));
678 ImGSW1 = imag(
EWFACT(ID,0,SSS,costhe));
679 ImGSW2 = imag(
EWFACT(ID,1,SSS,costhe));
680 ImGSW3 = imag(
EWFACT(ID,2,SSS,costhe));
681 ImGSW4 = imag(
EWFACT(ID,3,SSS,costhe));
682 ImGSW6 = imag(
EWFACT(ID,6,SSS,costhe));
718 ReGSW1 = real(
EWFACT(0,0,SSS,costhe));
721 ReGSW1 =real(
EWFACT(ID,0,SSS,costhe));
722 ReGSW2 =real(
EWFACT(ID,1,SSS,costhe))/real(
EWFACT(0,1,SSS,costhe));
723 ReGSW3 =real(
EWFACT(ID,2,SSS,costhe))/real(
EWFACT(0,2,SSS,costhe));
730 initwkswdelt_(&mode, &IT, &finID, &SS, &SWeff, &DeltSQ, &DeltV, &Gmu, &alfinv, &AMZi, &GAM, &keyGSW, &ReGSW1, &ImGSW1, &ReGSW2, &ImGSW2, &ReGSW3, &ImGSW3, &ReGSW4, &ImGSW4, &ReGSW6, &ImGSW6 );
736 initwkswdelt_(&mode, &IT, &finID, &SS, &SWeff, &DeltSQ, &DeltV, &Gmu, &alfinv, &AMZi, &GAM, &keyGSW, &ReGSW1, &ImGSW1, &ReGSW2, &ImGSW2, &ReGSW3, &ImGSW3, &ReGSW4, &ImGSW4, &ReGSW6, &ImGSW6 );
744 initwkswdelt_(&mode, &IT, &finID, &SS, &SWeff, &DeltSQ, &DeltV, &Gmu, &alfinv, &AMZi, &GAM, &keyGSW, &ReGSW1, &ImGSW1, &ReGSW2, &ImGSW2, &ReGSW3, &ImGSW3, &ReGSW4, &ImGSW4, &ReGSW6, &ImGSW6 );
760 double sigbornswdelt(
int mode,
int ID,
double SS,
double costhe,
double SWeff,
double DeltSQ,
double DeltV,
double Gmu,
double alfinv,
double AMZ0,
double GAM0,
int keyGSW){
786 return ( t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dOne , &dOne) + t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dOne , &dMOne)
787 + t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dMOne, &dOne) + t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dMOne, &dMOne));
800 double AsNbornswdelt(
int mode,
int ID,
double SS,
double costhe,
double SWeff,
double DeltSQ,
double DeltV,
double Gmu,
double alfinv,
double AMZ0,
double GAM0,
int keyGSW){
827 return ( -t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dOne , &dOne) - t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dOne , &dMOne)
828 + t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dMOne, &dOne) + t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dMOne, &dMOne));
void ExtraEWparamsGet(double *AMZi, double *GAM, double *SWeff, double *alfinv, double *DeltSQ, double *DeltV, double *Gmu, int *keyGSW)
int initTables(char *mumu, char *downdown, char *upup)
void keyGSWGet(int *keyGSW)
void ExtraEWparamsSet(double AMZi, double GAM, double SWeff, double alfinv, double DeltSQ, double DeltV, double Gmu, int keyGSW)
complex< double > EWFACT(int FLAV, int NO, double s, double costhe)
double AsNbornswdelt(int mode, int ID, double SS, double costhe, double SWeff, double DeltSQ, double DeltV, double Gmu, double alfinv, double AMZ0, double GAM0, int keyGSW)
double sigbornswdelt(int mode, int ID, double SS, double costhe, double SWeff, double DeltSQ, double DeltV, double Gmu, double alfinv, double AMZ0, double GAM0, int keyGSW)
int initEWff(int ID, double S, double cost, int key)
double QCDFACT(int FLAV, int NO, double s)