1 #include "TauSpinner/tau_reweight_lib.h"
2 #include "TauSpinner/nonSM.h"
3 #include "TauSpinner/Tauola_wrapper.h"
4 #include "TauSpinner/EWtables.h"
7 #include "Tauola/TauolaParticlePair.h"
13 double CMSENE = 7000.0;
87 double f(
double x,
int ID,
double SS,
double cmsene)
104 return LHAPDF::xfx(x, sqrt(SS), ID)/x;
116 double sigborn(
int ID,
double SS,
double costhe)
125 double SIGggHiggs=0.;
130 SIGggHiggs=
disth_(&SS, &costhe, &IPOne, &IPOne)+
disth_(&SS, &costhe, &IPOne, &IMOne)+
131 disth_(&SS, &costhe, &IMOne, &IPOne)+
disth_(&SS, &costhe, &IMOne, &IMOne);
134 double PI=3.14159265358979324;
135 SIGggHiggs *= XMH * XMH * XMH *XGH /PI/ ((SS-XMH*XMH)*(SS-XMH*XMH) + XGH*XGH*XMH*XMH);
138 if(IfHsimple==1) SIGggHiggs = Xnorm * XMH * XGH /PI/ ((SS-XMH*XMH)*(SS-XMH*XMH) +XGH*XGH*XMH*XMH);
146 if (ID==0)
return 0.0 ;
157 if (ID>0) initwk_( &ID, &tauID, &SS);
161 initwk_( &ID, &tauID, &SS);
168 return ( t_born_(&iZero, &SS, &costhe, &dOne , &dOne) + t_born_(&iZero, &SS, &costhe, &dOne , &dMOne)
169 + t_born_(&iZero, &SS, &costhe, &dMOne, &dOne) + t_born_(&iZero, &SS, &costhe, &dMOne, &dMOne))/SS/128.86674175/128.86674175/3.141559265358979324;
181 void initialize_GSW(
int _ifGSW,
int _ifkorch,
242 void GSWadapt(
int ID,
double S,
double cost,
double GSWr[7],
double GSWi[7]){
249 double AMZi=
Amz(ID);
250 costhe=0.0;SSS=AMZi*AMZi;
274 GSWr[5]= real(
EWFACT(ID,6,SSS,costhe));
280 GSWi[5]= imag(
EWFACT(ID,6,SSS,costhe));
284 GSWr[0] = real(
EWFACT(ID,0,SSS,costhe));
288 GSWr[5] = real(
EWFACT(ID,6,SSS,costhe));
290 GSWi[0] = imag(
EWFACT(ID,0,SSS,costhe));
294 GSWi[5] = imag(
EWFACT(ID,6,SSS,costhe));
298 GSWr[0]= real(
EWFACT(ID,0,SSS,costhe));
299 GSWr[1]= real(
EWFACT(ID,1,SSS,costhe));
300 GSWr[2]= real(
EWFACT(ID,2,SSS,costhe));
301 GSWr[3]= real(
EWFACT(ID,3,SSS,costhe));
302 GSWr[5]= real(
EWFACT(ID,6,SSS,costhe));
304 GSWi[0]= imag(
EWFACT(ID,0,SSS,costhe));
305 GSWi[1]= imag(
EWFACT(ID,1,SSS,costhe));
306 GSWi[2]= imag(
EWFACT(ID,2,SSS,costhe));
307 GSWi[3]= imag(
EWFACT(ID,3,SSS,costhe));
308 GSWi[5]= imag(
EWFACT(ID,6,SSS,costhe));
344 GSWr[0]= real(
EWFACT(0,0,SSS,costhe));
347 GSWr[0]=real(
EWFACT(ID,0,SSS,costhe));
348 GSWr[1]=real(
EWFACT(ID,1,SSS,costhe))/real(
EWFACT(0,1,SSS,costhe));
349 GSWr[2]=real(
EWFACT(ID,2,SSS,costhe))/real(
EWFACT(0,2,SSS,costhe));
353 GSWr[0] = GSWr[0]*GSWN1r- GSWi[0]*GSWN1i;
354 GSWi[0] = GSWr[0]*GSWN1i+ GSWi[0]*GSWN1r;
355 GSWr[1] = GSWr[1]*GSWN2r- GSWi[1]*GSWN2i;
356 GSWi[1] = GSWr[1]*GSWN2i+ GSWi[1]*GSWN2r;
357 GSWr[2] = GSWr[2]*GSWN3r- GSWi[2]*GSWN3i;
358 GSWi[2] = GSWr[2]*GSWN3i+ GSWi[2]*GSWN3r;
359 GSWr[3] = GSWr[3]*GSWN4r- GSWi[3]*GSWN4i;
360 GSWi[3] = GSWr[3]*GSWN4i+ GSWi[3]*GSWN4r;
361 GSWr[4] = GSWr[4]*GSWN5r- GSWi[4]*GSWN5i;
362 GSWi[4] = GSWr[4]*GSWN5i+ GSWi[4]*GSWN5r;
363 GSWr[5] = GSWr[5]*GSWN5r- GSWi[5]*GSWN6i;
364 GSWi[5] = GSWr[5]*GSWN6i+ GSWi[5]*GSWN6r;
368 complex<double> Frezu(
int NO){
371 { F=complex<double>(GSWN1r,GSWN1i);}
373 { F=complex<double>(GSWN2r,GSWN2i);}
375 { F=complex<double>(GSWN3r,GSWN3i);}
377 { F=complex<double>(GSWN4r,GSWN4i);}
379 { F=complex<double>(GSWN5r,GSWN5i);}
381 { F=complex<double>(GSWN6r,GSWN6i);}
383 {cout<<
"wrong NO="<<NO<<endl; exit(-1);}
401 cout<<
" ------------------------------------------------------"<<endl;
402 cout<<
" TauSpinner v2.1.0"<<endl;
403 cout<<
" -----------------"<<endl;
404 cout<<
" 18.Dec.2020 "<<endl;
405 cout<<
" by Z. Czyczula (until 2015), T. Przedzinski, E. Richter-Was, Z. Was,"<<endl;
406 cout<<
" matrix elements implementations "<<endl;
407 cout<<
" also J. Kalinowski, W. Kotlarski and M. Bachmani"<<endl;
408 cout<<
" ------------------------------------------------------"<<endl;
409 cout<<
" Ipp - true for pp collision; otherwise polarization"<<endl;
410 cout<<
" of individual taus from Z/gamma* is set to 0.0"<<endl;
411 cout<<
" Ipp = "<<Ipp<<endl;
412 cout<<
" CMSENE - used in PDF calculations; only if Ipp = true"<<endl;
413 cout<<
" and only for Z/gamma*"<<endl;
414 cout<<
" CMSENE = "<<CMSENE<<endl;
415 cout<<
" Ipol - relevant for Z/gamma* decays "<<endl;
416 cout<<
" 0 - events generated without spin effects "<<endl;
417 cout<<
" 1 - events generated with all spin effects "<<endl;
418 cout<<
" 2 - events generated with spin correlations and <pol>=0 "<<endl;
419 cout<<
" 3 - events generated with spin correlations and"<<endl;
420 cout<<
" polarization but missing angular dependence of <pol>"<<endl;
421 cout<<
" Ipol = "<<Ipol<<endl;
422 cout<<
" Ipol - relevant for Z/gamma* decays "<<endl;
423 cout<<
" NOTE: For Ipol=0,1 algorithm is identical. "<<endl;
424 cout<<
" However in user program role of wt need change. "<<endl;
425 cout<<
" nonSM2 = "<<nonSM2<<endl;
426 cout<<
" 1/0 extra term in cross section, density matrix on/off "<<endl;
427 cout<<
" nonSMN = "<<nonSMN<<endl;
428 cout<<
" 1/0 extra term in cross section, for shapes only? on/off "<<endl;
429 cout<<
" note KEY - for options of matrix elements calculations "<<endl;
430 cout<<
" in cases of final states with two jets "<<endl;
431 cout<<
" ------------------------------------------------------ "<<endl;
440 FrameType = _FrameType;
451 relWTnonSM = _relWTnonSM;
463 Xnorm = normalization;
520 *normalization = Xnorm;
532 void setSpinOfSample(
int _Ipol)
586 Particle X ( sp_X.px(), sp_X.py(), sp_X.pz(), sp_X.e(), sp_X.pdgid() );
587 Particle tau ( sp_tau.px(), sp_tau.py(), sp_tau.pz(), sp_tau.e(), sp_tau.pdgid() );
588 Particle nu_tau(sp_nu_tau.px(), sp_nu_tau.py(), sp_nu_tau.pz(), sp_nu_tau.e(), sp_nu_tau.pdgid() );
590 vector<Particle> tau_daughters;
593 int tau_pdgid = sp_tau.pdgid();
596 for(
unsigned int i=0; i<sp_tau_daughters.size(); i++)
598 Particle pp(sp_tau_daughters[i].px(),
599 sp_tau_daughters[i].py(),
600 sp_tau_daughters[i].pz(),
601 sp_tau_daughters[i].e(),
602 sp_tau_daughters[i].pdgid() );
604 tau_daughters.push_back(pp);
607 double phi2 = 0.0, theta2 = 0.0;
617 double *HH =
calculateHH(tau_pdgid, tau_daughters, phi2, theta2);
620 if ( abs(sp_X.pdgid()) == 24 ) { sign= 1.0; }
621 else if( abs(sp_X.pdgid()) == 37 ) { sign=-1.0; }
624 cout<<
"wrong sp_W/H.pdgid()="<<sp_X.pdgid()<<endl;
627 if (sp_X.pdgid() > 0 )
628 {WTamplitM = WTamplit;}
630 {WTamplitP = WTamplit;}
633 double WT = 1.0+sign*HH[2];
638 cout<<tau_pdgid<<
" -> ";
639 for(
unsigned int i=0;i<tau_daughters.size();i++) cout<<tau_daughters[i].pdgid()<<
" ";
640 cout<<
" (HH: "<<HH[0]<<
" "<<HH[1]<<
" "<<HH[2]<<
" "<<HH[3]<<
") WT: "<<WT<<endl;
645 printf(
"TauSpinner::calculateWeightFromParticlesWorHpn WT is: %13.10f. Setting WT = 0.0\n",WT);
650 printf(
"Tauspinner::calculateWeightFromParticlesWorHpn WT is: %13.10f. Setting WT = 2.0\n",WT);
682 vector<SimpleParticle> sp_tau_daughters;
686 if (sp_tau1.pdgid() == -15 )
690 sp_tau_daughters = sp_tau1_daughters;
696 sp_tau_daughters = sp_tau2_daughters;
705 Particle X ( sp_X.px(), sp_X.py(), sp_X.pz(), sp_X.e(), sp_X.pdgid() );
706 Particle tau ( sp_tau.px(), sp_tau.py(), sp_tau.pz(), sp_tau.e(), sp_tau.pdgid() );
707 Particle nu_tau( sp_nu_tau.px(), sp_nu_tau.py(), sp_nu_tau.pz(), sp_nu_tau.e(), sp_nu_tau.pdgid() );
709 vector<Particle> tau_daughters;
712 int tau_pdgid = sp_tau.pdgid();
715 for(
unsigned int i=0; i<sp_tau_daughters.size(); i++)
717 Particle pp(sp_tau_daughters[i].px(),
718 sp_tau_daughters[i].py(),
719 sp_tau_daughters[i].pz(),
720 sp_tau_daughters[i].e(),
721 sp_tau_daughters[i].pdgid() );
723 tau_daughters.push_back(pp);
726 double phi2 = 0.0, theta2 = 0.0;
738 HHp =
calculateHH(tau_pdgid, tau_daughters, phi2, theta2);
742 cout<<tau_pdgid<<
" -> ";
743 for(
unsigned int i=0;i<tau_daughters.size();i++) cout<<tau_daughters[i].pdgid()<<
" ";
744 cout<<
" (HHp: "<<HHp[0]<<
" "<<HHp[1]<<
" "<<HHp[2]<<
" "<<HHp[3]<<
") ";
748 WTamplitP = WTamplit;
755 if(sp_tau1.pdgid() == 15 )
759 sp_tau_daughters = sp_tau1_daughters;
765 sp_tau_daughters = sp_tau2_daughters;
772 Particle X ( sp_X.px(), sp_X.py(), sp_X.pz(), sp_X.e(), sp_X.pdgid() );
773 Particle tau ( sp_tau.px(), sp_tau.py(), sp_tau.pz(), sp_tau.e(), sp_tau.pdgid() );
774 Particle nu_tau( sp_nu_tau.px(), sp_nu_tau.py(), sp_nu_tau.pz(), sp_nu_tau.e(), sp_nu_tau.pdgid() );
776 vector<Particle> tau_daughters;
779 int tau_pdgid = sp_tau.pdgid();
782 for(
unsigned int i=0; i<sp_tau_daughters.size(); i++)
784 Particle pp(sp_tau_daughters[i].px(),
785 sp_tau_daughters[i].py(),
786 sp_tau_daughters[i].pz(),
787 sp_tau_daughters[i].e(),
788 sp_tau_daughters[i].pdgid() );
790 tau_daughters.push_back(pp);
793 double phi2 = 0.0, theta2 = 0.0;
804 HHm =
calculateHH(tau_pdgid, tau_daughters, phi2, theta2);
808 cout<<tau_pdgid<<
" -> ";
809 for(
unsigned int i=0;i<tau_daughters.size();i++) cout<<tau_daughters[i].pdgid()<<
" ";
810 cout<<
" (HHm: "<<HHm[0]<<
" "<<HHm[1]<<
" "<<HHm[2]<<
" "<<HHm[3]<<
") ";
814 WTamplitM = WTamplit;
823 if(sp_X.pdgid() == 25) { sign=-1.0; }
824 if(sp_X.pdgid() == 36) { sign=-1.0; }
825 if(sp_X.pdgid() ==553) { sign=-1.0; }
832 double S = sp_X.e()*sp_X.e() - sp_X.px()*sp_X.px() - sp_X.py()*sp_X.py() - sp_X.pz()*sp_X.pz();
850 WT = 1.0+corrX2*HHp[2]*HHm[2]+polX2*HHp[2]+polX2*HHm[2] + RzXX*HHp[0]*HHm[0] - RzYY*HHp[1]*HHm[1] + RzXY*HHp[0]*HHm[1] - RzYX*HHp[1]*HHm[0];
853 double RRR = Tauola::randomDouble();
855 if (RRR<(1.0+polX2)*(1.0+corrX2*HHp[2]*HHm[2]+HHp[2]+HHm[2])/(2.0+2.0*corrX2*HHp[2]*HHm[2]+2.0*polX2*HHp[2]+2.0*polX2*HHm[2])) Polari=-1.0;
859 WT = 1.0 + sign*HHp[2]*HHm[2] + RXX*HHp[0]*HHm[0] + RYY*HHp[1]*HHm[1] + RXY*HHp[0]*HHm[1] + RYX*HHp[1]*HHm[0];
862 double RRR = Tauola::randomDouble();
864 if (RRR<(1.0+sign*HHp[2]*HHm[2]+HHp[2]-HHm[2])/(2.0+2.0*sign*HHp[2]*HHm[2])) Polari=-1.0;
870 double S = sp_X.e()*sp_X.e() - sp_X.px()*sp_X.px() - sp_X.py()*sp_X.py() - sp_X.pz()*sp_X.pz();
880 WT = 1.0+sign*HHp[2]*HHm[2]+pol*HHp[2]+pol*HHm[2] + RzXX*R11*HHp[0]*HHm[0] - RzYY*R22*HHp[1]*HHm[1] + RzXY*R12*HHp[0]*HHm[1] - RzYX*R21*HHp[1]*HHm[0];
893 if(Ipol==2) WT = WT/(1.0+sign*HHp[2]*HHm[2]);
900 double polp1 =
plzap2(11,sp_tau.pdgid(),S,0.0);
901 double pol1 =(2*(1-polp1)-1) ;
902 WT = WT/(1.0+sign*HHp[2]*HHm[2]+pol1*HHp[2]+pol1*HHm[2]);
909 for (
int k0=0;k0<4;k0++){
910 for (
int k1=0;k1<4;k1++){
913 if(k0==0&&k1==0) F=F* RzXX;
914 if(k0==1&&k1==1) F=F* RzYY;
915 if(k0==0&&k1==1) F=F* RzXY;
916 if(k0==1&&k1==0) F=F* RzYX;
917 WTtest=WTtest+RcorExt[k0][k1]*HHp[k0]*HHm[k1]*F;
931 if(nonSM2==1) WT=WTtest;
932 if(nonSM2==0&& Ipol==0) WT=WTtest;
936 double RRR = Tauola::randomDouble();
938 if (RRR<(1.0+pol)*(1.0+sign*HHp[2]*HHm[2]+HHp[2]+HHm[2])/(2.0+2.0*sign*HHp[2]*HHm[2]+2.0*pol*HHp[2]+2.0*pol*HHm[2])) Polari=-1.0;
942 DEBUG( cout<<
" WT: "<<WT<<endl; )
945 printf(
"Tauspinner::calculateWeightFromParticlesH WT is: %13.10f. Setting WT = 0.0\n",WT);
950 printf(
"Tauspinner::calculateWeightFromParticlesH WT is: %13.10f. Setting WT = 4.0\n",WT);
954 if( WT>4.0 || WT<0.0)
956 cout<<
"Tauspinner::calculateWeightFromParticlesH ERROR: Z/gamma* or H, and WT not in range [0,4]."<<endl;
960 if (sign==-1.0 && nonSM2!=1) {
963 cout <<
"Tauspinner::calculateWeightFromParticlesH Setting WT to be 2.0" << endl;
967 if( sign==-1.0 && (WT>2.0 || WT<0.0) && nonSM2!=1)
969 cout<<
"Tauspinner::calculateWeightFromParticlesH ERROR: H and WT not in range [0,2]."<<endl;
987 Particle P_QQ( tau.px()+nu_tau.px(), tau.py()+nu_tau.py(), tau.pz()+nu_tau.pz(), tau.e()+nu_tau.e(), 0 );
994 tau.boostToRestFrame(P_QQ);
995 nu_tau.boostToRestFrame(P_QQ);
997 for(
unsigned int i=0; i<tau_daughters.size();i++)
998 tau_daughters[i].boostToRestFrame(P_QQ);
1006 double phi = tau.getAnglePhi();
1010 double theta = tau.getAngleTheta();
1012 tau.rotateXZ(M_PI-theta);
1014 nu_tau.rotateXY(-phi );
1015 nu_tau.rotateXZ(M_PI-theta);
1017 for(
unsigned int i=0; i<tau_daughters.size();i++)
1019 tau_daughters[i].rotateXY(-phi );
1020 tau_daughters[i].rotateXZ(M_PI-theta);
1028 for(
unsigned int i=0; i<tau_daughters.size();i++)
1029 tau_daughters[i].boostAlongZ(-tau.pz(),tau.e());
1039 unsigned int i_stored = 0;
1044 for(
unsigned int i=0; i<tau_daughters.size();i++)
1046 if(abs(tau_daughters[i].pdgid())==16){
1047 *phi2 = tau_daughters[i].getAnglePhi();
1049 tau_daughters[i].rotateXY( -(*phi2) );
1051 *theta2 = tau_daughters[i].getAngleTheta();
1053 tau_daughters[i].rotateXZ( -(*theta2) );
1060 for(
unsigned int i=0; i<tau_daughters.size();i++)
1063 tau_daughters[i].rotateXY( -(*phi2) );
1064 tau_daughters[i].rotateXZ( -(*theta2) );
1082 double*
calculateHH(
int tau_pdgid, vector<Particle> &tau_daughters,
double phi,
double theta)
1085 double *HH =
new double[4];
1087 HH[0]=HH[1]=HH[2]=HH[3]=0.0;
1092 for(
unsigned int i=0; i<tau_daughters.size(); i++)
1093 pdgid.push_back( tau_daughters[i].pdgid() );
1107 if( pdgid.size()==2 &&
1109 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211) ) ||
1110 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211) ) ||
1111 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-321) ) ||
1112 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321) )
1116 if(abs(pdgid[1])==321) channel = 6;
1117 DEBUG( cout<<
"Channel "<<channel<<
" : "; )
1125 const double AMTAU = 1.777;
1127 double AMPI = sqrt(tau_daughters[1].e() *tau_daughters[1].e()
1128 -tau_daughters[1].px()*tau_daughters[1].px()
1129 -tau_daughters[1].py()*tau_daughters[1].py()
1130 -tau_daughters[1].pz()*tau_daughters[1].pz());
1133 double PXQ=AMTAU*tau_daughters[1].e();
1134 double PXN=AMTAU*tau_daughters[0].e();
1135 double QXN=tau_daughters[1].e()*tau_daughters[0].e()-tau_daughters[1].px()*tau_daughters[0].px()-tau_daughters[1].py()*tau_daughters[0].py()-tau_daughters[1].pz()*tau_daughters[0].pz();
1136 double BRAK=(2*PXQ*QXN-AMPI*AMPI*PXN);
1138 WTamplit = (1.16637E-5)*(1.16637E-5)*BRAK/2.;
1139 HH[0] = AMTAU*(2*tau_daughters[1].px()*QXN-tau_daughters[0].px()*AMPI*AMPI)/BRAK;
1140 HH[1] = AMTAU*(2*tau_daughters[1].py()*QXN-tau_daughters[0].py()*AMPI*AMPI)/BRAK;
1141 HH[2] = AMTAU*(2*tau_daughters[1].pz()*QXN-tau_daughters[0].pz()*AMPI*AMPI)/BRAK;
1149 else if( pdgid.size()==3 &&
1151 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 111) ) ||
1152 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 111) ) ||
1153 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-321, 311) ) ||
1154 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 311) ) ||
1155 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-321, 310) ) ||
1156 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 310) ) ||
1157 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-321, 130) ) ||
1158 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 130) )
1164 DEBUG( cout<<
"Channel "<<channel<<
" : "; )
1171 const double AMTAU = 1.777;
1174 if(tau_daughters[2].pdgid() != 111) { MNUM=3; channel = 22;}
1175 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1176 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1177 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1178 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1180 float HV[4] = { 0.0 };
1182 dam2pi_( &MNUM, PT, PN, PIM1, PIM2, &LIT, HV );
1197 else if( pdgid.size()==3 &&
1199 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 130) ) ||
1200 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 130) ) ||
1201 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 310) ) ||
1202 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 310) ) ||
1203 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 311) ) ||
1204 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 311) ) ||
1205 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-321, 111) ) ||
1206 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 111) )
1211 DEBUG( cout<<
"Channel "<<channel<<
" : "; )
1218 const double AMTAU = 1.777;
1221 QQ[0]=tau_daughters[1].e() -tau_daughters[2].e() ;
1222 QQ[1]=tau_daughters[1].px()-tau_daughters[2].px();
1223 QQ[2]=tau_daughters[1].py()-tau_daughters[2].py();
1224 QQ[3]=tau_daughters[1].pz()-tau_daughters[2].pz();
1227 PKS[0]=tau_daughters[1].e() +tau_daughters[2].e() ;
1228 PKS[1]=tau_daughters[1].px()+tau_daughters[2].px();
1229 PKS[2]=tau_daughters[1].py()+tau_daughters[2].py();
1230 PKS[3]=tau_daughters[1].pz()+tau_daughters[2].pz();
1233 double PKSD=PKS[0]*PKS[0]-PKS[1]*PKS[1]-PKS[2]*PKS[2]-PKS[3]*PKS[3];
1234 double QQPKS=QQ[0]*PKS[0]-QQ[1]*PKS[1]-QQ[2]*PKS[2]-QQ[3]*PKS[3];
1236 QQ[0]=QQ[0]-PKS[0]*QQPKS/PKSD;
1237 QQ[1]=QQ[1]-PKS[1]*QQPKS/PKSD;
1238 QQ[2]=QQ[2]-PKS[2]*QQPKS/PKSD;
1239 QQ[3]=QQ[3]-PKS[3]*QQPKS/PKSD;
1241 double PRODPQ=AMTAU*QQ[0];
1242 double PRODNQ=tau_daughters[0].e() *QQ[0]
1243 -tau_daughters[0].px()*QQ[1]
1244 -tau_daughters[0].py()*QQ[2]
1245 -tau_daughters[0].pz()*QQ[3];
1246 double PRODPN=AMTAU*tau_daughters[0].e();
1247 double QQ2 =QQ[0]*QQ[0]-QQ[1]*QQ[1]-QQ[2]*QQ[2]-QQ[3]*QQ[3];
1250 double BRAK=(2*PRODPQ*PRODNQ-PRODPN*QQ2);
1252 WTamplit = (1.16637E-5)*(1.16637E-5)*BRAK/2.;
1253 HH[0]=AMTAU*(2*PRODNQ*QQ[1]-QQ2*tau_daughters[0].px())/BRAK;
1254 HH[1]=AMTAU*(2*PRODNQ*QQ[2]-QQ2*tau_daughters[0].py())/BRAK;
1255 HH[2]=AMTAU*(2*PRODNQ*QQ[3]-QQ2*tau_daughters[0].pz())/BRAK;
1261 else if( pdgid.size()==3 &&
1263 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 11,-12) ) ||
1264 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16,-11, 12) )
1267 DEBUG( cout<<
"Channel 1 : "; )
1273 double XK0DEC = 0.01;
1274 double XK[4] = { 0.0 };
1275 double XA[4] = { tau_daughters[2].px(), tau_daughters[2].py(), tau_daughters[2].pz(), tau_daughters[2].e() };
1276 double QP[4] = { tau_daughters[1].px(), tau_daughters[1].py(), tau_daughters[1].pz(), tau_daughters[1].e() };
1277 double XN[4] = { tau_daughters[0].px(), tau_daughters[0].py(), tau_daughters[0].pz(), tau_daughters[0].e() };
1278 double AMPLIT = 0.0;
1279 double HV[4] = { 0.0 };
1283 QP[3] = sqrt( QP[0]*QP[0] + QP[1]*QP[1] + QP[2]*QP[2] + 0.511e-3*0.511e-3);
1284 XA[3] = sqrt( XA[0]*XA[0] + XA[1]*XA[1] + XA[2]*XA[2] );
1286 dampry_( &ITDKRC, &XK0DEC, XK, XA, QP, XN, &LIT, HV );
1297 else if( pdgid.size()==4 &&
1299 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 11,-12, 22) ) ||
1300 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16,-11, 12, 22) )
1303 DEBUG( cout<<
"Channel 1b : "; )
1309 double XK0DEC = 0.01;
1310 double XK[4] = { tau_daughters[3].px(), tau_daughters[3].py(), tau_daughters[3].pz(), tau_daughters[3].e() };
1311 double XA[4] = { tau_daughters[2].px(), tau_daughters[2].py(), tau_daughters[2].pz(), tau_daughters[2].e() };
1312 double QP[4] = { tau_daughters[1].px(), tau_daughters[1].py(), tau_daughters[1].pz(), tau_daughters[1].e() };
1313 double XN[4] = { tau_daughters[0].px(), tau_daughters[0].py(), tau_daughters[0].pz(), tau_daughters[0].e() };
1314 double AMPLIT = 0.0;
1315 double HV[4] = { 0.0 };
1319 QP[3] = sqrt( QP[0]*QP[0] + QP[1]*QP[1] + QP[2]*QP[2] + 0.511e-3*0.511e-3);
1320 XA[3] = sqrt( XA[0]*XA[0] + XA[1]*XA[1] + XA[2]*XA[2] );
1321 XK[3] = sqrt( XK[0]*XK[0] + XK[1]*XK[1] + XK[2]*XK[2] );
1323 if(XK0DEC > XK[3]/(XK[3]+XA[3]+QP[3]+XN[3])) XK0DEC=0.5*XK[3]/(XK[3]+XA[3]+QP[3]+XN[3]);
1325 dampry_( &ITDKRC, &XK0DEC, XK, XA, QP, XN, &LIT, HV );
1336 else if( pdgid.size()==3 &&
1338 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 13,-14) ) ||
1339 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16,-13, 14) )
1343 DEBUG( cout<<
"Channel 2 : "; )
1349 double XK0DEC = 0.01;
1350 double XK[4] = { 0.0 };
1351 double XA[4] = { tau_daughters[2].px(), tau_daughters[2].py(), tau_daughters[2].pz(), tau_daughters[2].e() };
1352 double QP[4] = { tau_daughters[1].px(), tau_daughters[1].py(), tau_daughters[1].pz(), tau_daughters[1].e() };
1353 double XN[4] = { tau_daughters[0].px(), tau_daughters[0].py(), tau_daughters[0].pz(), tau_daughters[0].e() };
1354 double AMPLIT = 0.0;
1355 double HV[4] = { 0.0 };
1359 QP[3] = sqrt( QP[0]*QP[0] + QP[1]*QP[1] + QP[2]*QP[2] + 0.105659*0.105659);
1360 XA[3] = sqrt( XA[0]*XA[0] + XA[1]*XA[1] + XA[2]*XA[2] );
1362 dampry_( &ITDKRC, &XK0DEC, XK, XA, QP, XN, &LIT, HV );
1373 else if( pdgid.size()==4 &&
1375 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 13,-14, 22) ) ||
1376 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16,-13, 14, 22) )
1380 DEBUG( cout<<
"Channel 2b : "; )
1386 double XK0DEC = 0.01;
1387 double XK[4] = { tau_daughters[3].px(), tau_daughters[3].py(), tau_daughters[3].pz(), tau_daughters[3].e() };
1388 double XA[4] = { tau_daughters[2].px(), tau_daughters[2].py(), tau_daughters[2].pz(), tau_daughters[2].e() };
1389 double QP[4] = { tau_daughters[1].px(), tau_daughters[1].py(), tau_daughters[1].pz(), tau_daughters[1].e() };
1390 double XN[4] = { tau_daughters[0].px(), tau_daughters[0].py(), tau_daughters[0].pz(), tau_daughters[0].e() };
1391 double AMPLIT = 0.0;
1392 double HV[4] = { 0.0 };
1396 QP[3] = sqrt( QP[0]*QP[0] + QP[1]*QP[1] + QP[2]*QP[2] + 0.105659*0.105659);
1397 XA[3] = sqrt( XA[0]*XA[0] + XA[1]*XA[1] + XA[2]*XA[2] );
1398 XK[3] = sqrt( XK[0]*XK[0] + XK[1]*XK[1] + XK[2]*XK[2] );
1400 if(XK0DEC > XK[3]/(XK[3]+XA[3]+QP[3]+XN[3])) XK0DEC=0.5*XK[3]/(XK[3]+XA[3]+QP[3]+XN[3]);
1403 dampry_( &ITDKRC, &XK0DEC, XK, XA, QP, XN, &LIT, HV );
1414 else if( pdgid.size()==4 &&
1416 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 111, 111,-211) ) ||
1417 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 111, 111, 211) )
1420 DEBUG( cout<<
"Channel 5 : "; )
1425 const double AMTAU = 1.777;
1427 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1428 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1429 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1430 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1431 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1433 float HV[4] = { 0.0 };
1438 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1449 else if( pdgid.size()==4 &&
1451 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211,-211, 211) ) ||
1452 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 211,-211) )
1455 DEBUG( cout<<
"Channel 5 : "; )
1460 const double AMTAU = 1.777;
1462 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1463 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1464 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1465 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1466 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1468 float HV[4] = { 0.0 };
1473 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1508 else if( pdgid.size()==4 &&
1510 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, -321, -211, 321) ) ||
1511 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 211,-321) )
1514 DEBUG( cout<<
"Channel 5 : "; )
1519 const double AMTAU = 1.777;
1523 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1524 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1525 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1526 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1527 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1529 float HV[4] = { 0.0 };
1534 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1545 else if( pdgid.size()==4 &&
1547 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 311, -211, 311 ) ) ||
1548 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 311, 211, 311 ) ) ||
1549 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 311, -211, 310 ) ) ||
1550 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 311, 211, 310 ) ) ||
1551 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 311, -211, 130 ) ) ||
1552 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 311, 211, 130 ) ) ||
1553 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 310, -211, 311 ) ) ||
1554 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 310, 211, 311 ) ) ||
1555 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 310, -211, 310 ) ) ||
1556 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 310, 211, 310 ) ) ||
1557 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 310, -211, 130 ) ) ||
1558 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 310, 211, 130 ) ) ||
1559 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 130, -211, 311 ) ) ||
1560 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 130, 211, 311 ) ) ||
1561 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 130, -211, 310 ) ) ||
1562 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 130, 211, 310 ) ) ||
1563 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 130, -211, 130 ) ) ||
1564 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 130, 211, 130 ) )
1567 DEBUG( cout<<
"Channel 5 : "; )
1572 const double AMTAU = 1.777;
1575 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1576 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1577 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1578 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1579 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1581 float HV[4] = { 0.0 };
1586 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1597 else if( pdgid.size()==4 &&
1599 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, -321, 311, 111) ) ||
1600 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 311, 111) ) ||
1601 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, -321, 310, 111) ) ||
1602 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 310, 111) ) ||
1603 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, -321, 130, 111) ) ||
1604 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 130, 111) )
1607 DEBUG( cout<<
"Channel 5 : "; )
1612 const double AMTAU = 1.777;
1615 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1616 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1617 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1618 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1619 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1621 float HV[4] = { 0.0 };
1626 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1637 else if( pdgid.size()==4 &&
1639 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 111, 111,-321) ) ||
1640 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 111, 111, 321) )
1643 DEBUG( cout<<
"Channel 5 : "; )
1648 const double AMTAU = 1.777;
1651 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1652 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1653 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1654 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1655 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1657 float HV[4] = { 0.0 };
1662 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1672 else if( pdgid.size()==4 &&
1674 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-321,-211, 211) ) ||
1675 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 211,-211) )
1678 DEBUG( cout<<
"Channel 5 : "; )
1683 const double AMTAU = 1.777;
1686 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1687 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1688 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1689 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1690 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1692 float HV[4] = { 0.0 };
1697 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1706 else if( pdgid.size()==4 &&
1708 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 311, 111) ) ||
1709 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 311, 111) ) ||
1710 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 310, 111) ) ||
1711 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 310, 111) ) ||
1712 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 130, 111) ) ||
1713 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 130, 111) )
1716 DEBUG( cout<<
"Channel 5 : "; )
1721 const double AMTAU = 1.777;
1724 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1725 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1726 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1727 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1728 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1730 float HV[4] = { 0.0 };
1735 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1745 else if( pdgid.size()==5 &&
1747 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211,-211, 211, 111) ) ||
1748 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 211,-211, 111) )
1751 DEBUG( cout<<
"Channel 8 : "; )
1754 const double AMTAU = 1.777;
1756 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1757 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1758 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1759 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1760 float PIZ [4] = { (float)tau_daughters[4].px(), (float)tau_daughters[4].py(), (float)tau_daughters[4].pz(), (float)tau_daughters[4].e() };
1761 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1763 float HV[4] = { 0.0 };
1765 dam4pi_( &MNUM, PT, PN, PIM1, PIM2, PIZ, PIPL, &LIT, HV );
1775 else if( pdgid.size()==5 &&
1777 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 111, 111, 111,-211) ) ||
1778 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 111, 111, 111, 211) )
1781 DEBUG( cout<<
"Channel 9 : "; )
1784 const double AMTAU = 1.777;
1786 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1787 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1788 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1789 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1790 float PIZ [4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1791 float PIPL[4] = { (float)tau_daughters[4].px(), (float)tau_daughters[4].py(), (float)tau_daughters[4].pz(), (float)tau_daughters[4].e() };
1793 float HV[4] = { 0.0 };
1795 dam4pi_( &MNUM, PT, PN, PIM1, PIM2, PIZ, PIPL, &LIT, HV );
1805 DEBUG( cout<<tau_daughters.size()<<
"-part ???: "; )
1810 Particle HHbuf(HH[0], HH[1], HH[2], HH[3], 0);
1812 HHbuf.rotateXZ(theta);
1813 HHbuf.rotateXY(phi);
1854 double GSWr[7],GSWi[7];
1855 double GSWr0[7],GSWi0[7];
1861 double xsec,xsec0,xsecsum;
1869 alphaQED= 1.0/128.86674175;
1871 for (
int k=0;k<7;k++){
1872 GSWr[k]=1.0; GSWr0[k]=1.0;
1873 GSWi[k]=0.0; GSWi0[k]=0.0;
1878 if(ifkorch==1 && nonSM2==0) {
1891 if(ifkorch==1 && nonSM2==1) {
1905 Particle tau_plus ( sp_tau.px(), sp_tau.py(), sp_tau.pz(), sp_tau.e(), sp_tau.pdgid() );
1906 Particle tau_minus( sp_nu_tau.px(), sp_nu_tau.py(), sp_nu_tau.pz(), sp_nu_tau.e(), sp_nu_tau.pdgid() );
1908 Particle P_QQ( tau_plus.px()+tau_minus.px(), tau_plus.py()+tau_minus.py(), tau_plus.pz()+tau_minus.pz(), tau_plus.e()+tau_minus.e(), 0 );
1913 tau_plus. boostToRestFrame(P_QQ);
1914 tau_minus.boostToRestFrame(P_QQ);
1915 P_B1. boostToRestFrame(P_QQ);
1916 P_B2. boostToRestFrame(P_QQ);
1918 double costheta1 = (tau_plus.px()*P_B1.px() +tau_plus.py()*P_B1.py() +tau_plus.pz()*P_B1.pz() ) /
1919 sqrt(tau_plus.px()*tau_plus.px()+tau_plus.py()*tau_plus.py()+tau_plus.pz()*tau_plus.pz()) /
1920 sqrt(P_B1.px() *P_B1.px() +P_B1.py() *P_B1.py() +P_B1.pz() *P_B1.pz() );
1922 double costheta2 = (tau_minus.px()*P_B2.px() +tau_minus.py()*P_B2.py() +tau_minus.pz()*P_B2.pz() ) /
1923 sqrt(tau_minus.px()*tau_minus.px()+tau_minus.py()*tau_minus.py()+tau_minus.pz()*tau_minus.pz()) /
1924 sqrt(P_B2.px() *P_B2.px() +P_B2.py() *P_B2.py() +P_B2.pz() *P_B2.pz() );
1926 double sintheta1 = sqrt(1-costheta1*costheta1);
1927 double sintheta2 = sqrt(1-costheta2*costheta2);
1930 double costhe = (costheta1*sintheta2 + costheta2*sintheta1) / (sintheta1 + sintheta2);
1931 double costhem= (costheta1*sintheta2 + costheta2*sintheta1) / (sintheta1 + sintheta2);
1935 double RRR = Tauola::randomDouble();
1937 wtMustraal= P_B1.e()*P_B1.e()*(1+costheta1*costheta1)/(P_B1.e()*P_B1.e()*(1+costheta1*costheta1)+P_B2.e()*P_B2.e()*(1+costheta2*costheta2));
1938 if( RRR< wtMustraal) {costhe=costheta1; costhem=costheta2;}
1939 else {costhe=costheta2; costhem=costheta1;}
1956 double x1x2 = SS/CMSENE/CMSENE;
1957 double x1Mx2 = P_QQ.pz()/CMSENE*2;
1959 double x1 = ( x1Mx2 + sqrt(x1Mx2*x1Mx2 + 4*x1x2) )/2;
1960 double x2 = ( -x1Mx2 + sqrt(x1Mx2*x1Mx2 + 4*x1x2) )/2;
1963 WID[0] = f(x1, 0,SS,CMSENE)*f(x2, 0,SS,CMSENE) * sigborn(0,SS, costhe);
1964 WID[1] = f(x1, 1,SS,CMSENE)*f(x2,-1,SS,CMSENE) * sigborn(1,SS, costhe);
1965 WID[2] = f(x1,-1,SS,CMSENE)*f(x2, 1,SS,CMSENE) * sigborn(1,SS,-costhem);
1966 WID[3] = f(x1, 2,SS,CMSENE)*f(x2,-2,SS,CMSENE) * sigborn(2,SS, costhe);
1967 WID[4] = f(x1,-2,SS,CMSENE)*f(x2, 2,SS,CMSENE) * sigborn(2,SS,-costhem);
1968 WID[5] = f(x1, 3,SS,CMSENE)*f(x2,-3,SS,CMSENE) * sigborn(3,SS, costhe);
1969 WID[6] = f(x1,-3,SS,CMSENE)*f(x2, 3,SS,CMSENE) * sigborn(3,SS,-costhem);
1970 WID[7] = f(x1, 4,SS,CMSENE)*f(x2,-4,SS,CMSENE) * sigborn(4,SS, costhe);
1971 WID[8] = f(x1,-4,SS,CMSENE)*f(x2, 4,SS,CMSENE) * sigborn(4,SS,-costhem);
1972 WID[9] = f(x1, 5,SS,CMSENE)*f(x2,-5,SS,CMSENE) * sigborn(5,SS, costhe);
1973 WID[10]= f(x1,-5,SS,CMSENE)*f(x2, 5,SS,CMSENE) * sigborn(5,SS,-costhem);
1989 for(
int i=0;i<=12;i++) sum+=WID[i];
2000 cout <<
"Tauspinner::calculateWeightFromParticlesH WARNING: sum of WID[0]-WID[10] is 0. Check LHAPDF configuration" << endl;
2004 if(relWTnonSM==0) WTnonSM=sum;
2008 WID2[0] = f(x1, 0,SS,CMSENE)*f(x2, 0,SS,CMSENE) * sigborn(0,SS, costhe) *
plweight(0,SS, costhe);
2009 WID2[1] = f(x1, 1,SS,CMSENE)*f(x2,-1,SS,CMSENE) * sigborn(1,SS, costhe) *
plweight(1,SS, costhe);
2010 WID2[2] = f(x1,-1,SS,CMSENE)*f(x2, 1,SS,CMSENE) * sigborn(1,SS,-costhem) *
plweight(1,SS,-costhem);
2011 WID2[3] = f(x1, 2,SS,CMSENE)*f(x2,-2,SS,CMSENE) * sigborn(2,SS, costhe) *
plweight(2,SS, costhe);
2012 WID2[4] = f(x1,-2,SS,CMSENE)*f(x2, 2,SS,CMSENE) * sigborn(2,SS,-costhem) *
plweight(2,SS,-costhem);
2013 WID2[5] = f(x1, 3,SS,CMSENE)*f(x2,-3,SS,CMSENE) * sigborn(3,SS, costhe) *
plweight(3,SS, costhe);
2014 WID2[6] = f(x1,-3,SS,CMSENE)*f(x2, 3,SS,CMSENE) * sigborn(3,SS,-costhem) *
plweight(3,SS,-costhem);
2015 WID2[7] = f(x1, 4,SS,CMSENE)*f(x2,-4,SS,CMSENE) * sigborn(4,SS, costhe) *
plweight(4,SS, costhe);
2016 WID2[8] = f(x1,-4,SS,CMSENE)*f(x2, 4,SS,CMSENE) * sigborn(4,SS,-costhem) *
plweight(4,SS,-costhem);
2017 WID2[9] = f(x1, 5,SS,CMSENE)*f(x2,-5,SS,CMSENE) * sigborn(5,SS, costhe) *
plweight(5,SS, costhe);
2018 WID2[10]= f(x1,-5,SS,CMSENE)*f(x2, 5,SS,CMSENE) * sigborn(5,SS,-costhem) *
plweight(5,SS,-costhem);
2031 for(
int i=0;i<=12;i++) sum2+=WID2[i];
2035 if(relWTnonSM==0) WTnonSM=sum2;
2043 if(IfHiggs && nonSM2==1) {
2044 double polp =
plzap2(0,15,S,costhe);
2045 pol += (2*(1-polp)-1);
2048 if(IfHiggs)
return NAN;
2051 for(
int i=0;i<=12;i++) WID[i]/=sum;
2064 for(
int i=0;i<=3;i++){
2065 for(
int j=0;j<=3;j++){
2071 for(
int i=1;i<=12;i++)
2075 double cost = costhe;
2078 if( ICC==2 || ICC==4 || ICC==6 || ICC==8 || ICC==10|| ICC==12 ) { cost = -costhem; IROT=1;}
2082 if( ICC==7 || ICC==8 ) ID = 4;
2083 if( ICC==1 || ICC==2 ) ID = 1;
2084 if( ICC==5 || ICC==6 ) ID = 3;
2085 if( ICC==9 || ICC==10 ) ID = 5;
2086 if( ICC==11 || ICC==12 ) ID = 22;
2090 double polp =
plzap2(ID,tau_pdgid,S,cost);
2091 if(ifkorch==0) pol += (2*(1-polp)-1)*WID[i];
2099 pp.
m_R[1][1] = pp.
m_R[2][2] = 0.0;
2100 pp.
m_R[1][2] = pp.
m_R[2][1] = 0.0;
2101 pp.
m_R[0][1] = pp.
m_R[3][2] = 0.0;
2102 pp.
m_R[0][2] = pp.
m_R[3][1] = 0.0;
2103 pp.
m_R[1][0] = pp.
m_R[2][3] = 0.0;
2104 pp.
m_R[2][0] = pp.
m_R[1][3] = 0.0;
2131 if (ID==2||ID==4) {channel=2 ; IFLAV=2;}
2132 if (ID==1||ID==3||ID==5){channel=3 ; IFLAV=1;}
2144 sin2W0=
sin2W(IFLAV);
2145 alphaQED=7.2973525693e-3;
2146 for (
int k=0;k<7;k++){
2147 complex<double> rezu =
EWFACT(IFLAV, k, S, cost);
2150 GSWr[k]=real(rezu);GSWr0[k]=1.0;
2151 GSWi[k]=imag(rezu);GSWi0[k]=0.0;
2156 dipolqq_(&iqed,&Energy,&theta,&channel,&Amz0,&Gamz0,&sin2W0,&alphaQED,&ReA00,&ImA00, &ReB0,&ImB0, &ReX0,&ImX0,&ReY0,&ImY0, GSWr0,GSWi0,Rcor);
2159 dipolqq_(&iqed,&Energy,&theta,&channel,&Amz0,&Gamz0,&sin2W0,&alphaQED,&ReA0,&ImA0, &ReB,&ImB, &ReX,&ImX,&ReY,&ImY, GSWr,GSWi,Rcor);
2165 pp.
m_R[1][3]=-pp.
m_R[1][3];
2166 pp.
m_R[3][1]=-pp.
m_R[3][1];
2167 pp.
m_R[0][1]=-pp.
m_R[0][1];
2168 pp.
m_R[1][0]=-pp.
m_R[1][0];
2169 pp.
m_R[2][3]=-pp.
m_R[2][3];
2170 pp.
m_R[3][2]=-pp.
m_R[3][2];
2171 pp.
m_R[2][0]=-pp.
m_R[2][0];
2172 pp.
m_R[0][2]=-pp.
m_R[0][2];
2174 Rcor[1][3]=-Rcor[1][3];
2175 Rcor[3][1]=-Rcor[3][1];
2176 Rcor[0][1]=-Rcor[0][1];
2177 Rcor[1][0]=-Rcor[1][0];
2178 Rcor[2][3]=-Rcor[2][3];
2179 Rcor[3][2]=-Rcor[3][2];
2180 Rcor[2][0]=-Rcor[2][0];
2181 Rcor[0][2]=-Rcor[0][2];
2187 pol += WID[i]*pp.
m_R[0][3]/pp.
m_R[0][0];
2189 sumak +=WID[i]*pp.
m_R[0][0];
2202 R11 += WID[i]*pp.
m_R[1][1];
2203 R22 += WID[i]*pp.
m_R[2][2];
2204 R12 += WID[i]*pp.
m_R[1][2];
2205 R21 += WID[i]*pp.
m_R[2][1];
2208 for(
int i3=0;i3<=3;i3++){
2209 for(
int j=0;j<=3;j++){
2214 RcorExt[i4][j4]+=WID[i]*Rcor[i3][j];
2218 xsecsum+=xsec/xsec0*WID[i];
2260 if(relWTnonSM!=0) WTnonSM=xsecsum;
2261 if(relWTnonSM==0) {WTnonSM=xsecsum; std::cout <<
"input not supported: relWTnonSM=" <<relWTnonSM<<
" ifkorch= "<<ifkorch << std::endl;
2262 std::cout <<
"X-sects nonSM2="<<nonSM2<<
" sum= " << sum <<
" WTnonSM-korch= "<< xsecsum <<std::endl;
2284 bool channelMatch(vector<Particle> &particles,
int p1,
int p2,
int p3,
int p4,
int p5,
int p6)
2289 for(
unsigned int i=0;i<particles.size();i++) list.push_back(particles[i].pdgid());
2292 int p[6] = { p1, p2, p3, p4, p5, p6 };
2296 for(
int i=0;i<6;i++)
2303 for(
unsigned int j=0;j<list.size(); j++)
2309 list.erase(list.begin()+j);
2314 if(!found)
return false;
2318 if(list.size()!=0)
return false;
2323 vector<Particle> newList;
2325 for(
int i=0;i<6;i++)
2330 for(
unsigned int j=0;j<particles.size(); j++)
2333 if(particles[j].pdgid()==p[i])
2335 newList.push_back(particles[j]);
2336 particles.erase(particles.begin()+j);
2342 particles = newList;
2357 double px=nu_tau.px()+tau.px();
2358 double py=nu_tau.py()+tau.py();
2359 double pz=nu_tau.pz()+tau.pz();
2360 double e =nu_tau.e ()+tau.e ();
2363 cout<<
"--------------------------------------------------------------------------------------------------------"<<endl;
2371 for(
unsigned int i=0; i<tau_daughters.size();i++) tau_daughters[i].
print();
2374 cout<<
"--------------------------------------------------------------------------------------------------------"<<endl;
2388 double px=0.0,py=0.0,pz=0.0,e=0.0;
2390 for(
unsigned int i=0; i<x.size();i++)
void recalculateRij(int incoming_pdg_id, int outgoing_pdg_id, double invariant_mass_squared, double cosTheta)
double plweight(int ide, double svar, double costhe)
double plzap2(int ide, int idf, double svar, double costhe)
void initialize_GSW_norm(int _keyGSW, double _ReGSW1, double _ImGSW1, double _ReGSW2, double _ImGSW2, double _ReGSW3, double _ImGSW3, double _ReGSW4, double _ImGSW4, double _ReGSW5, double _ImGSW5, double _ReGSW6, double _ImGSW6)
double calculateWeightFromParticlesH(SimpleParticle &sp_X, SimpleParticle &sp_tau1, SimpleParticle &sp_tau2, vector< SimpleParticle > &sp_tau1_daughters, vector< SimpleParticle > &sp_tau2_daughters)
bool channelMatch(vector< Particle > &particles, int p1, int p2=0, int p3=0, int p4=0, int p5=0, int p6=0)
double disth_(double *SVAR, double *COSTHE, int *TA, int *TB)
double calculateWeightFromParticlesWorHpn(SimpleParticle &W, SimpleParticle &tau, SimpleParticle &nu_tau, vector< SimpleParticle > &tau_daughters)
void getZgamMultipliersTR(double &Rxx, double &Ryy, double &Rxy, double &Ryx)
void getZgamParametersTR(double &Rxx, double &Ryy, double &Rxy, double &Ryx)
double getLongitudinalPolarization(double, SimpleParticle &, SimpleParticle &)
void getHiggsParameters(double *mass, double *width, double *normalization)
void setZgamMultipliersTR(double Rxx, double Ryy, double Rxy, double Ryx)
void setFrameType(int _FrameType)
complex< double > EWFACT(int FLAV, int NO, double s, double costhe)
Particle * vector_sum(vector< Particle > &x)
void setNonSMkey(int key)
double * calculateHH(int tau_pdgid, vector< Particle > &tau_daughters, double phi, double theta)
void setHiggsParametersTR(double Rxx, double Ryy, double Rxy, double Ryx)
void GSWadapt(int ID, double S, double cost, double GSWr[7], double GSWi[7])
void setRelWTnonSM(int _relWTnonSM)
void print(Particle &W, Particle &nu_tau, Particle &tau, vector< Particle > &tau_daughters)
void initialize_spinner(bool _Ipp, int _Ipol, int _nonSM2, int _nonSMN, double _CMSENE)
void prepareKinematicForHH(Particle &tau, Particle &nu_tau, vector< Particle > &tau_daughters, double *phi2, double *theta2)
void setHiggsParameters(int jak, double mass, double width, double normalization)