6 #include "TauSpinner/ew_born.h"
7 #include "TauSpinner/EWtables.h"
10 namespace TauSpinner {
36 double AMZi= 91.18870000;
37 double GAM=2.49520000;
38 double SWeff= 0.2235200000;
41 double Gmu=0.00001166389;
42 double alfinv=137.0359895;
55 const char *tableLocationMu = mumu;
56 const char *tableLocationDown = downdown;
57 const char *tableLocationUp = upup;
62 cout <<
"initializing table " << tableLocationMu <<
": " << endl;
63 bool resultMu = ewbornMu.FillFromTable(tableLocationMu);
66 cout <<
"ERROR: could not parse table : " << tableLocationMu << endl;
70 cout <<
"initializing table " << tableLocationDown <<
": " << endl;
71 bool resultDown = ewbornDown.FillFromTable(tableLocationDown);
74 cout <<
"ERROR: could not parse table: " << tableLocationDown << endl;
78 cout <<
"initializing table " << tableLocationUp <<
": " << endl;
79 bool resultUp = ewbornUp.FillFromTable(tableLocationUp);
82 cout <<
"ERROR: could not parse table: " << tableLocationUp << endl;
355 complex<double>
EWFACT(
int FLAV,
int NO,
double s,
double costhe){
356 complex<double> rezu=complex<double>(0.3,0.4);
371 double EaMin= ewb->EEa[0];
double EaMax= ewb->EEa[ewb->NA-1];
372 double EbMin= ewb->EEb[0];
double EbMax= ewb->EEb[ewb->NB-1];
373 double EcMin= ewb->EEc[0];
double EcMax= ewb->EEc[ewb->NC-1];
374 double EdMin= ewb->EEd[0];
double EdMax= ewb->EEd[ewb->ND-1];
377 double stepA= log(ewb->EEa[1] /ewb->EEa[0]);
378 double stepB= ewb->EEb[1] - ewb->EEb[0];
379 double stepC= ewb->EEc[1] - ewb->EEc[0];
380 double stepD= ewb->EEd[1] - ewb->EEd[0];
382 if(Ene>EbMin && Ene<EbMax){
383 int Index=((Ene-EbMin)/(EbMax-EbMin)*(ewb->NB-1));
384 int Ic=(((costhe+1.0)/2*(ewb->MB-1)));
385 rezu= ewb->FFb[Index][Ic][NO]
386 + (Ene -ewb->EEb[Index]) /stepB * (ewb->FFb[Index+1][Ic][NO] - ewb->FFb[Index][Ic][NO])
387 + ( (costhe+1.)/2. - (1.0*Ic)/(ewb->MB-1) )*(ewb->MB-1)*(
388 (1- (Ene -ewb->EEb[Index])/stepB )*(ewb->FFb[Index ][Ic+1][NO] - ewb->FFb[Index ][Ic][NO])
389 +( (Ene -ewb->EEb[Index])/stepB )*(ewb->FFb[Index+1][Ic+1][NO] - ewb->FFb[Index+1][Ic][NO]) );
391 else if (Ene>EcMin && Ene<EcMax){
392 int Index=((Ene-EcMin)/(EcMax-EcMin)*(ewb->NC-1));
393 int Ic=(((costhe+1.0)/2*(ewb->MC-1)));
394 rezu= ewb->FFc[Index][Ic][NO]
395 + (Ene -ewb->EEc[Index]) /stepC * (ewb->FFc[Index+1][Ic][NO] - ewb->FFc[Index][Ic][NO])
396 + ( (costhe+1.)/2. - (1.0*Ic)/(ewb->MC-1) )*(ewb->MC-1)*(
397 (1- (Ene -ewb->EEc[Index])/stepC )*(ewb->FFc[Index ][Ic+1][NO] - ewb->FFc[Index ][Ic][NO])
398 +( (Ene -ewb->EEc[Index])/stepC )*(ewb->FFc[Index+1][Ic+1][NO] - ewb->FFc[Index+1][Ic][NO]) );
400 else if (Ene>EdMin && Ene<EdMax){
401 int Index=((Ene-EdMin)/(EdMax-EdMin)*(ewb->ND-1));
402 int Ic=((costhe+1.0)/2.)*(ewb->MD-1);
403 rezu= ewb->FFd[Index][Ic][NO]
404 + (Ene -ewb->EEd[Index]) /stepD * (ewb->FFd[Index+1][Ic][NO] - ewb->FFd[Index][Ic][NO])
405 + ( (costhe+1.)/2. - (1.0*Ic)/(ewb->MD-1) )*(ewb->MD-1)*(
406 (1- (Ene -ewb->EEd[Index])/stepD )*(ewb->FFd[Index ][Ic+1][NO] - ewb->FFd[Index ][Ic][NO])
407 +( (Ene -ewb->EEd[Index])/stepD )*(ewb->FFd[Index+1][Ic+1][NO] - ewb->FFd[Index+1][Ic][NO]) );
411 else if (Ene>EaMin && Ene<EaMax){
412 int Index=((log(Ene)-log(EaMin))/(log(EaMax)-log(EaMin))*(ewb->NA-1));
413 rezu= ewb->FFa[Index][NO]
414 + (log(Ene)-log(ewb->EEa[Index])) /stepA * (ewb->FFa[Index+1][NO] - ewb->FFa[Index][NO]);
418 rezu=complex<double>(1.0,0.0);
482 double EaMin= ewb->EEa[0];
double EaMax= ewb->EEa[ewb->NA-1];
483 double EbMin= ewb->EEb[0];
double EbMax= ewb->EEb[ewb->NB-1];
484 double EcMin= ewb->EEc[0];
double EcMax= ewb->EEc[ewb->NC-1];
485 double EdMin= ewb->EEd[0];
double EdMax= ewb->EEd[ewb->ND-1];
488 double stepA= log(ewb->EEa[1] /ewb->EEa[0]);
489 double stepB= ewb->EEb[1] - ewb->EEb[0];
490 double stepC= ewb->EEc[1] - ewb->EEc[0];
491 double stepD= ewb->EEd[1] - ewb->EEd[0];
493 if(Ene>EbMin && Ene<EbMax){
494 int Index=((Ene-EbMin)/(EbMax-EbMin)*(ewb->NB-1));
495 rezu= ewb->FSb[Index][NO]
496 + (Ene-ewb->EEb[Index]) /stepB * (ewb->FSb[Index+1][NO] - ewb->FSb[Index][NO]);
499 else if (Ene>EcMin && Ene<EcMax){
500 int Index=((Ene-EcMin)/(EcMax-EcMin)*(ewb->NC-1));
501 rezu= ewb->FSc[Index][NO]
502 + (Ene-ewb->EEc[Index]) /stepC * (ewb->FSc[Index+1][NO] - ewb->FSc[Index][NO]);
506 else if (Ene>EdMin && Ene<EdMax){
507 int Index=((Ene-EdMin)/(EdMax-EdMin)*(ewb->ND-1));
508 rezu= ewb->FSd[Index][NO]
509 + (Ene-ewb->EEd[Index]) /stepD * (ewb->FSd[Index+1][NO] - ewb->FSd[Index][NO]);
512 else if (Ene>EaMin && Ene<EaMax){
513 int Index=((log(Ene)-log(EaMin))/(log(EaMax)-log(EaMin))*(ewb->NA-1));
514 rezu= ewb->FSa[Index][NO]
515 + (log(Ene)-log(ewb->EEa[Index])) /stepA * (ewb->FSa[Index+1][NO] - ewb->FSa[Index][NO]);
526 void ExtraEWparamsGet(
double *AMZi,
double *GAM,
double *SWeff,
double *alfinv,
double *DeltSQ,
double* DeltV,
double *Gmu,
int *keyGSW){
528 cout <<
"ERROR Born parameters are not initialized: you can not get them. We stop "<< endl;
544 cout <<
"WARNING: Born parameters are not initialized you can not adjust keyGSW "<< endl;
555 void ExtraEWparamsSet(
double AMZi,
double GAM,
double SWeff,
double alfinv,
double DeltSQ,
double DeltV,
double Gmu,
int keyGSW){
556 if(m_AMZi !=AMZi ){ m_AMZi =AMZi; m_status=0;}
557 if(m_GAM !=GAM ){ m_GAM =GAM; m_status=0;}
558 if(m_SWeff !=SWeff ){ m_SWeff =SWeff; m_status=0;}
559 if(m_alfinv!=alfinv){ m_alfinv=alfinv; m_status=0;}
560 if(m_DeltSQ!=DeltSQ){ m_DeltSQ=DeltSQ; m_status=0;}
561 if(m_DeltV !=DeltV ){ m_DeltV =DeltV; m_status=0;}
562 if(m_Gmu !=Gmu ){ m_Gmu =Gmu; m_status=0;}
563 if(m_keyGSW!=keyGSW){ m_keyGSW=keyGSW; m_status=0;}
578 cout <<
" electroweak tables not initialized. We stop run "<< endl;
582 if (ID==ID0 && key==key0 && S==S0 && cost==cost0 &&
ExtraEWparams()!=0){
600 else if (
ExtraEWparams()==0 || ID0!=ID || S0!=S || cost0!=cost || key0!=key ){
625 if(keyGSW!=1){costhe=0.0;SSS=AMZi*AMZi;}
628 ReGSW1 = real(
EWFACT(ID,0,SS,costhe));
629 ReGSW2 = real(
EWFACT(ID,1,SS,costhe));
630 ReGSW3 = real(
EWFACT(ID,2,SS,costhe));
631 ReGSW4 = real(
EWFACT(ID,3,SS,costhe));
633 ReGSW6 = real(
EWFACT(ID,6,SS,costhe));
635 ImGSW1 = imag(
EWFACT(ID,0,SS,costhe));
636 ImGSW2 = imag(
EWFACT(ID,1,SS,costhe));
637 ImGSW3 = imag(
EWFACT(ID,2,SS,costhe));
638 ImGSW4 = imag(
EWFACT(ID,3,SS,costhe));
640 ImGSW6 = imag(
EWFACT(ID,6,SS,costhe));
647 ReGSW6 = real(
EWFACT(ID,6,SSS,costhe));
653 ImGSW6 = imag(
EWFACT(ID,6,SSS,costhe));
657 ReGSW1 = real(
EWFACT(ID,0,SSS,costhe));
661 ReGSW6 = real(
EWFACT(ID,6,SSS,costhe));
663 ImGSW1 = imag(
EWFACT(ID,0,SSS,costhe));
667 ImGSW6 = imag(
EWFACT(ID,6,SSS,costhe));
671 ReGSW1 = real(
EWFACT(ID,0,SSS,costhe));
672 ReGSW2 = real(
EWFACT(ID,1,SSS,costhe));
673 ReGSW3 = real(
EWFACT(ID,2,SSS,costhe));
674 ReGSW4 = real(
EWFACT(ID,3,SSS,costhe));
675 ReGSW6 = real(
EWFACT(ID,6,SSS,costhe));
677 ImGSW1 = imag(
EWFACT(ID,0,SSS,costhe));
678 ImGSW2 = imag(
EWFACT(ID,1,SSS,costhe));
679 ImGSW3 = imag(
EWFACT(ID,2,SSS,costhe));
680 ImGSW4 = imag(
EWFACT(ID,3,SSS,costhe));
681 ImGSW6 = imag(
EWFACT(ID,6,SSS,costhe));
717 ReGSW1 = real(
EWFACT(0,0,SSS,costhe));
720 ReGSW1 =real(
EWFACT(ID,0,SSS,costhe));
721 ReGSW2 =real(
EWFACT(ID,1,SSS,costhe))/real(
EWFACT(0,1,SSS,costhe));
722 ReGSW3 =real(
EWFACT(ID,2,SSS,costhe))/real(
EWFACT(0,2,SSS,costhe));
729 initwkswdelt_(&mode, &IT, &finID, &SS, &SWeff, &DeltSQ, &DeltV, &Gmu, &alfinv, &AMZi, &GAM, &keyGSW, &ReGSW1, &ImGSW1, &ReGSW2, &ImGSW2, &ReGSW3, &ImGSW3, &ReGSW4, &ImGSW4, &ReGSW6, &ImGSW6 );
735 initwkswdelt_(&mode, &IT, &finID, &SS, &SWeff, &DeltSQ, &DeltV, &Gmu, &alfinv, &AMZi, &GAM, &keyGSW, &ReGSW1, &ImGSW1, &ReGSW2, &ImGSW2, &ReGSW3, &ImGSW3, &ReGSW4, &ImGSW4, &ReGSW6, &ImGSW6 );
743 initwkswdelt_(&mode, &IT, &finID, &SS, &SWeff, &DeltSQ, &DeltV, &Gmu, &alfinv, &AMZi, &GAM, &keyGSW, &ReGSW1, &ImGSW1, &ReGSW2, &ImGSW2, &ReGSW3, &ImGSW3, &ReGSW4, &ImGSW4, &ReGSW6, &ImGSW6 );
759 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){
785 return ( t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dOne , &dOne) + t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dOne , &dMOne)
786 + t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dMOne, &dOne) + t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dMOne, &dMOne));
799 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){
826 return ( -t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dOne , &dOne) - t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dOne , &dMOne)
827 + t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dMOne, &dOne) + t_bornew_(&Bmode, &keyGSW, &SS, &costhe, &dMOne, &dMOne));
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 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 initTables(char *mumu, char *downdown, char *upup)
int initEWff(int ID, double S, double cost, int key)
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)
void ExtraEWparamsGet(double *AMZi, double *GAM, double *SWeff, double *alfinv, double *DeltSQ, double *DeltV, double *Gmu, int *keyGSW)
void keyGSWGet(int *keyGSW)
double QCDFACT(int FLAV, int NO, double s)