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"
14 double CMSENE = 7000.0;
73 double f(
double x,
int ID,
double SS,
double cmsene)
90 return LHAPDF::xfx(x, sqrt(SS), ID)/x;
102 double sigborn(
int ID,
double SS,
double costhe)
111 double SIGggHiggs=0.;
116 SIGggHiggs=
disth_(&SS, &costhe, &IPOne, &IPOne)+
disth_(&SS, &costhe, &IPOne, &IMOne)+
117 disth_(&SS, &costhe, &IMOne, &IPOne)+
disth_(&SS, &costhe, &IMOne, &IMOne);
120 double PI=3.14159265358979324;
121 SIGggHiggs *= XMH * XMH * XMH *XGH /PI/ ((SS-XMH*XMH)*(SS-XMH*XMH) + XGH*XGH*XMH*XMH);
124 if(IfHsimple==1) SIGggHiggs = Xnorm * XMH * XGH /PI/ ((SS-XMH*XMH)*(SS-XMH*XMH) +XGH*XGH*XMH*XMH);
132 if (ID==0)
return 0.0 ;
143 if (ID>0) initwk_( &ID, &tauID, &SS);
147 initwk_( &ID, &tauID, &SS);
154 return ( t_born_(&iZero, &SS, &costhe, &dOne , &dOne) + t_born_(&iZero, &SS, &costhe, &dOne , &dMOne)
155 + t_born_(&iZero, &SS, &costhe, &dMOne, &dOne) + t_born_(&iZero, &SS, &costhe, &dMOne, &dMOne))/SS/128.86674175/128.86674175/3.141559265358979324;
164 void initialize_GSW(
int _ifGSW,
int _ifkorch,
196 cout<<
" ------------------------------------------------------"<<endl;
197 cout<<
" TauSpinner v2.1.0"<<endl;
198 cout<<
" -----------------"<<endl;
199 cout<<
" 18.Dec.2020 "<<endl;
200 cout<<
" by Z. Czyczula (until 2015), T. Przedzinski, E. Richter-Was, Z. Was,"<<endl;
201 cout<<
" matrix elements implementations "<<endl;
202 cout<<
" also J. Kalinowski, W. Kotlarski and M. Bachmani"<<endl;
203 cout<<
" ------------------------------------------------------"<<endl;
204 cout<<
" Ipp - true for pp collision; otherwise polarization"<<endl;
205 cout<<
" of individual taus from Z/gamma* is set to 0.0"<<endl;
206 cout<<
" Ipp = "<<Ipp<<endl;
207 cout<<
" CMSENE - used in PDF calculations; only if Ipp = true"<<endl;
208 cout<<
" and only for Z/gamma*"<<endl;
209 cout<<
" CMSENE = "<<CMSENE<<endl;
210 cout<<
" Ipol - relevant for Z/gamma* decays "<<endl;
211 cout<<
" 0 - events generated without spin effects "<<endl;
212 cout<<
" 1 - events generated with all spin effects "<<endl;
213 cout<<
" 2 - events generated with spin correlations and <pol>=0 "<<endl;
214 cout<<
" 3 - events generated with spin correlations and"<<endl;
215 cout<<
" polarization but missing angular dependence of <pol>"<<endl;
216 cout<<
" Ipol = "<<Ipol<<endl;
217 cout<<
" Ipol - relevant for Z/gamma* decays "<<endl;
218 cout<<
" NOTE: For Ipol=0,1 algorithm is identical. "<<endl;
219 cout<<
" However in user program role of wt need change. "<<endl;
220 cout<<
" nonSM2 = "<<nonSM2<<endl;
221 cout<<
" 1/0 extra term in cross section, density matrix on/off "<<endl;
222 cout<<
" nonSMN = "<<nonSMN<<endl;
223 cout<<
" 1/0 extra term in cross section, for shapes only? on/off "<<endl;
224 cout<<
" note KEY - for options of matrix elements calculations "<<endl;
225 cout<<
" in cases of final states with two jets "<<endl;
226 cout<<
" ------------------------------------------------------ "<<endl;
237 relWTnonSM = _relWTnonSM;
249 Xnorm = normalization;
306 *normalization = Xnorm;
318 void setSpinOfSample(
int _Ipol)
372 Particle X ( sp_X.px(), sp_X.py(), sp_X.pz(), sp_X.e(), sp_X.pdgid() );
373 Particle tau ( sp_tau.px(), sp_tau.py(), sp_tau.pz(), sp_tau.e(), sp_tau.pdgid() );
374 Particle nu_tau(sp_nu_tau.px(), sp_nu_tau.py(), sp_nu_tau.pz(), sp_nu_tau.e(), sp_nu_tau.pdgid() );
376 vector<Particle> tau_daughters;
379 int tau_pdgid = sp_tau.pdgid();
382 for(
unsigned int i=0; i<sp_tau_daughters.size(); i++)
384 Particle pp(sp_tau_daughters[i].px(),
385 sp_tau_daughters[i].py(),
386 sp_tau_daughters[i].pz(),
387 sp_tau_daughters[i].e(),
388 sp_tau_daughters[i].pdgid() );
390 tau_daughters.push_back(pp);
393 double phi2 = 0.0, theta2 = 0.0;
403 double *HH =
calculateHH(tau_pdgid, tau_daughters, phi2, theta2);
406 if ( abs(sp_X.pdgid()) == 24 ) { sign= 1.0; }
407 else if( abs(sp_X.pdgid()) == 37 ) { sign=-1.0; }
410 cout<<
"wrong sp_W/H.pdgid()="<<sp_X.pdgid()<<endl;
413 if (sp_X.pdgid() > 0 )
414 {WTamplitM = WTamplit;}
416 {WTamplitP = WTamplit;}
419 double WT = 1.0+sign*HH[2];
424 cout<<tau_pdgid<<
" -> ";
425 for(
unsigned int i=0;i<tau_daughters.size();i++) cout<<tau_daughters[i].pdgid()<<
" ";
426 cout<<
" (HH: "<<HH[0]<<
" "<<HH[1]<<
" "<<HH[2]<<
" "<<HH[3]<<
") WT: "<<WT<<endl;
431 printf(
"TauSpinner::calculateWeightFromParticlesWorHpn WT is: %13.10f. Setting WT = 0.0\n",WT);
436 printf(
"Tauspinner::calculateWeightFromParticlesWorHpn WT is: %13.10f. Setting WT = 2.0\n",WT);
468 vector<SimpleParticle> sp_tau_daughters;
472 if (sp_tau1.pdgid() == -15 )
476 sp_tau_daughters = sp_tau1_daughters;
482 sp_tau_daughters = sp_tau2_daughters;
491 Particle X ( sp_X.px(), sp_X.py(), sp_X.pz(), sp_X.e(), sp_X.pdgid() );
492 Particle tau ( sp_tau.px(), sp_tau.py(), sp_tau.pz(), sp_tau.e(), sp_tau.pdgid() );
493 Particle nu_tau( sp_nu_tau.px(), sp_nu_tau.py(), sp_nu_tau.pz(), sp_nu_tau.e(), sp_nu_tau.pdgid() );
495 vector<Particle> tau_daughters;
498 int tau_pdgid = sp_tau.pdgid();
501 for(
unsigned int i=0; i<sp_tau_daughters.size(); i++)
503 Particle pp(sp_tau_daughters[i].px(),
504 sp_tau_daughters[i].py(),
505 sp_tau_daughters[i].pz(),
506 sp_tau_daughters[i].e(),
507 sp_tau_daughters[i].pdgid() );
509 tau_daughters.push_back(pp);
512 double phi2 = 0.0, theta2 = 0.0;
524 HHp =
calculateHH(tau_pdgid, tau_daughters, phi2, theta2);
528 cout<<tau_pdgid<<
" -> ";
529 for(
unsigned int i=0;i<tau_daughters.size();i++) cout<<tau_daughters[i].pdgid()<<
" ";
530 cout<<
" (HHp: "<<HHp[0]<<
" "<<HHp[1]<<
" "<<HHp[2]<<
" "<<HHp[3]<<
") ";
534 WTamplitP = WTamplit;
541 if(sp_tau1.pdgid() == 15 )
545 sp_tau_daughters = sp_tau1_daughters;
551 sp_tau_daughters = sp_tau2_daughters;
558 Particle X ( sp_X.px(), sp_X.py(), sp_X.pz(), sp_X.e(), sp_X.pdgid() );
559 Particle tau ( sp_tau.px(), sp_tau.py(), sp_tau.pz(), sp_tau.e(), sp_tau.pdgid() );
560 Particle nu_tau( sp_nu_tau.px(), sp_nu_tau.py(), sp_nu_tau.pz(), sp_nu_tau.e(), sp_nu_tau.pdgid() );
562 vector<Particle> tau_daughters;
565 int tau_pdgid = sp_tau.pdgid();
568 for(
unsigned int i=0; i<sp_tau_daughters.size(); i++)
570 Particle pp(sp_tau_daughters[i].px(),
571 sp_tau_daughters[i].py(),
572 sp_tau_daughters[i].pz(),
573 sp_tau_daughters[i].e(),
574 sp_tau_daughters[i].pdgid() );
576 tau_daughters.push_back(pp);
579 double phi2 = 0.0, theta2 = 0.0;
590 HHm =
calculateHH(tau_pdgid, tau_daughters, phi2, theta2);
594 cout<<tau_pdgid<<
" -> ";
595 for(
unsigned int i=0;i<tau_daughters.size();i++) cout<<tau_daughters[i].pdgid()<<
" ";
596 cout<<
" (HHm: "<<HHm[0]<<
" "<<HHm[1]<<
" "<<HHm[2]<<
" "<<HHm[3]<<
") ";
600 WTamplitM = WTamplit;
609 if(sp_X.pdgid() == 25) { sign=-1.0; }
610 if(sp_X.pdgid() == 36) { sign=-1.0; }
611 if(sp_X.pdgid() ==553) { sign=-1.0; }
618 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();
636 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];
639 double RRR = Tauola::randomDouble();
641 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;
645 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];
648 double RRR = Tauola::randomDouble();
650 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;
656 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();
666 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];
679 if(Ipol==2) WT = WT/(1.0+sign*HHp[2]*HHm[2]);
686 double polp1 =
plzap2(11,sp_tau.pdgid(),S,0.0);
687 double pol1 =(2*(1-polp1)-1) ;
688 WT = WT/(1.0+sign*HHp[2]*HHm[2]+pol1*HHp[2]+pol1*HHm[2]);
695 for (
int k0=0;k0<4;k0++){
696 for (
int k1=0;k1<4;k1++){
699 if(k0==0&&k1==0) F=F* RzXX;
700 if(k0==1&&k1==1) F=F* RzYY;
701 if(k0==0&&k1==1) F=F* RzXY;
702 if(k0==1&&k1==0) F=F* RzYX;
703 WTtest=WTtest+RcorExt[k0][k1]*HHp[k0]*HHm[k1]*F;
712 if(nonSM2==1) WT=WTtest;
713 if(nonSM2==0&& Ipol==0) WT=WTtest;
717 double RRR = Tauola::randomDouble();
719 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;
723 DEBUG( cout<<
" WT: "<<WT<<endl; )
726 printf(
"Tauspinner::calculateWeightFromParticlesH WT is: %13.10f. Setting WT = 0.0\n",WT);
731 printf(
"Tauspinner::calculateWeightFromParticlesH WT is: %13.10f. Setting WT = 4.0\n",WT);
735 if( WT>4.0 || WT<0.0)
737 cout<<
"Tauspinner::calculateWeightFromParticlesH ERROR: Z/gamma* or H, and WT not in range [0,4]."<<endl;
741 if (sign==-1.0 && nonSM2!=1) {
744 cout <<
"Tauspinner::calculateWeightFromParticlesH Setting WT to be 2.0" << endl;
748 if( sign==-1.0 && (WT>2.0 || WT<0.0) && nonSM2!=1)
750 cout<<
"Tauspinner::calculateWeightFromParticlesH ERROR: H and WT not in range [0,2]."<<endl;
768 Particle P_QQ( tau.px()+nu_tau.px(), tau.py()+nu_tau.py(), tau.pz()+nu_tau.pz(), tau.e()+nu_tau.e(), 0 );
775 tau.boostToRestFrame(P_QQ);
776 nu_tau.boostToRestFrame(P_QQ);
778 for(
unsigned int i=0; i<tau_daughters.size();i++)
779 tau_daughters[i].boostToRestFrame(P_QQ);
787 double phi = tau.getAnglePhi();
791 double theta = tau.getAngleTheta();
793 tau.rotateXZ(M_PI-theta);
795 nu_tau.rotateXY(-phi );
796 nu_tau.rotateXZ(M_PI-theta);
798 for(
unsigned int i=0; i<tau_daughters.size();i++)
800 tau_daughters[i].rotateXY(-phi );
801 tau_daughters[i].rotateXZ(M_PI-theta);
809 for(
unsigned int i=0; i<tau_daughters.size();i++)
810 tau_daughters[i].boostAlongZ(-tau.pz(),tau.e());
820 unsigned int i_stored = 0;
825 for(
unsigned int i=0; i<tau_daughters.size();i++)
827 if(abs(tau_daughters[i].pdgid())==16){
828 *phi2 = tau_daughters[i].getAnglePhi();
830 tau_daughters[i].rotateXY( -(*phi2) );
832 *theta2 = tau_daughters[i].getAngleTheta();
834 tau_daughters[i].rotateXZ( -(*theta2) );
841 for(
unsigned int i=0; i<tau_daughters.size();i++)
844 tau_daughters[i].rotateXY( -(*phi2) );
845 tau_daughters[i].rotateXZ( -(*theta2) );
863 double*
calculateHH(
int tau_pdgid, vector<Particle> &tau_daughters,
double phi,
double theta)
866 double *HH =
new double[4];
868 HH[0]=HH[1]=HH[2]=HH[3]=0.0;
873 for(
unsigned int i=0; i<tau_daughters.size(); i++)
874 pdgid.push_back( tau_daughters[i].pdgid() );
888 if( pdgid.size()==2 &&
890 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211) ) ||
891 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211) ) ||
892 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-321) ) ||
893 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321) )
897 if(abs(pdgid[1])==321) channel = 6;
898 DEBUG( cout<<
"Channel "<<channel<<
" : "; )
906 const double AMTAU = 1.777;
908 double AMPI = sqrt(tau_daughters[1].e() *tau_daughters[1].e()
909 -tau_daughters[1].px()*tau_daughters[1].px()
910 -tau_daughters[1].py()*tau_daughters[1].py()
911 -tau_daughters[1].pz()*tau_daughters[1].pz());
914 double PXQ=AMTAU*tau_daughters[1].e();
915 double PXN=AMTAU*tau_daughters[0].e();
916 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();
917 double BRAK=(2*PXQ*QXN-AMPI*AMPI*PXN);
919 WTamplit = (1.16637E-5)*(1.16637E-5)*BRAK/2.;
920 HH[0] = AMTAU*(2*tau_daughters[1].px()*QXN-tau_daughters[0].px()*AMPI*AMPI)/BRAK;
921 HH[1] = AMTAU*(2*tau_daughters[1].py()*QXN-tau_daughters[0].py()*AMPI*AMPI)/BRAK;
922 HH[2] = AMTAU*(2*tau_daughters[1].pz()*QXN-tau_daughters[0].pz()*AMPI*AMPI)/BRAK;
930 else if( pdgid.size()==3 &&
932 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 111) ) ||
933 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 111) ) ||
934 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-321, 311) ) ||
935 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 311) ) ||
936 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-321, 310) ) ||
937 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 310) ) ||
938 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-321, 130) ) ||
939 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 130) )
945 DEBUG( cout<<
"Channel "<<channel<<
" : "; )
952 const double AMTAU = 1.777;
955 if(tau_daughters[2].pdgid() != 111) { MNUM=3; channel = 22;}
956 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
957 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
958 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
959 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
961 float HV[4] = { 0.0 };
963 dam2pi_( &MNUM, PT, PN, PIM1, PIM2, &LIT, HV );
978 else if( pdgid.size()==3 &&
980 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 130) ) ||
981 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 130) ) ||
982 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 310) ) ||
983 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 310) ) ||
984 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 311) ) ||
985 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 311) ) ||
986 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-321, 111) ) ||
987 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 111) )
992 DEBUG( cout<<
"Channel "<<channel<<
" : "; )
999 const double AMTAU = 1.777;
1002 QQ[0]=tau_daughters[1].e() -tau_daughters[2].e() ;
1003 QQ[1]=tau_daughters[1].px()-tau_daughters[2].px();
1004 QQ[2]=tau_daughters[1].py()-tau_daughters[2].py();
1005 QQ[3]=tau_daughters[1].pz()-tau_daughters[2].pz();
1008 PKS[0]=tau_daughters[1].e() +tau_daughters[2].e() ;
1009 PKS[1]=tau_daughters[1].px()+tau_daughters[2].px();
1010 PKS[2]=tau_daughters[1].py()+tau_daughters[2].py();
1011 PKS[3]=tau_daughters[1].pz()+tau_daughters[2].pz();
1014 double PKSD=PKS[0]*PKS[0]-PKS[1]*PKS[1]-PKS[2]*PKS[2]-PKS[3]*PKS[3];
1015 double QQPKS=QQ[0]*PKS[0]-QQ[1]*PKS[1]-QQ[2]*PKS[2]-QQ[3]*PKS[3];
1017 QQ[0]=QQ[0]-PKS[0]*QQPKS/PKSD;
1018 QQ[1]=QQ[1]-PKS[1]*QQPKS/PKSD;
1019 QQ[2]=QQ[2]-PKS[2]*QQPKS/PKSD;
1020 QQ[3]=QQ[3]-PKS[3]*QQPKS/PKSD;
1022 double PRODPQ=AMTAU*QQ[0];
1023 double PRODNQ=tau_daughters[0].e() *QQ[0]
1024 -tau_daughters[0].px()*QQ[1]
1025 -tau_daughters[0].py()*QQ[2]
1026 -tau_daughters[0].pz()*QQ[3];
1027 double PRODPN=AMTAU*tau_daughters[0].e();
1028 double QQ2 =QQ[0]*QQ[0]-QQ[1]*QQ[1]-QQ[2]*QQ[2]-QQ[3]*QQ[3];
1031 double BRAK=(2*PRODPQ*PRODNQ-PRODPN*QQ2);
1033 WTamplit = (1.16637E-5)*(1.16637E-5)*BRAK/2.;
1034 HH[0]=AMTAU*(2*PRODNQ*QQ[1]-QQ2*tau_daughters[0].px())/BRAK;
1035 HH[1]=AMTAU*(2*PRODNQ*QQ[2]-QQ2*tau_daughters[0].py())/BRAK;
1036 HH[2]=AMTAU*(2*PRODNQ*QQ[3]-QQ2*tau_daughters[0].pz())/BRAK;
1042 else if( pdgid.size()==3 &&
1044 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 11,-12) ) ||
1045 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16,-11, 12) )
1048 DEBUG( cout<<
"Channel 1 : "; )
1054 double XK0DEC = 0.01;
1055 double XK[4] = { 0.0 };
1056 double XA[4] = { tau_daughters[2].px(), tau_daughters[2].py(), tau_daughters[2].pz(), tau_daughters[2].e() };
1057 double QP[4] = { tau_daughters[1].px(), tau_daughters[1].py(), tau_daughters[1].pz(), tau_daughters[1].e() };
1058 double XN[4] = { tau_daughters[0].px(), tau_daughters[0].py(), tau_daughters[0].pz(), tau_daughters[0].e() };
1059 double AMPLIT = 0.0;
1060 double HV[4] = { 0.0 };
1064 QP[3] = sqrt( QP[0]*QP[0] + QP[1]*QP[1] + QP[2]*QP[2] + 0.511e-3*0.511e-3);
1065 XA[3] = sqrt( XA[0]*XA[0] + XA[1]*XA[1] + XA[2]*XA[2] );
1067 dampry_( &ITDKRC, &XK0DEC, XK, XA, QP, XN, &LIT, HV );
1078 else if( pdgid.size()==4 &&
1080 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 11,-12, 22) ) ||
1081 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16,-11, 12, 22) )
1084 DEBUG( cout<<
"Channel 1b : "; )
1090 double XK0DEC = 0.01;
1091 double XK[4] = { tau_daughters[3].px(), tau_daughters[3].py(), tau_daughters[3].pz(), tau_daughters[3].e() };
1092 double XA[4] = { tau_daughters[2].px(), tau_daughters[2].py(), tau_daughters[2].pz(), tau_daughters[2].e() };
1093 double QP[4] = { tau_daughters[1].px(), tau_daughters[1].py(), tau_daughters[1].pz(), tau_daughters[1].e() };
1094 double XN[4] = { tau_daughters[0].px(), tau_daughters[0].py(), tau_daughters[0].pz(), tau_daughters[0].e() };
1095 double AMPLIT = 0.0;
1096 double HV[4] = { 0.0 };
1100 QP[3] = sqrt( QP[0]*QP[0] + QP[1]*QP[1] + QP[2]*QP[2] + 0.511e-3*0.511e-3);
1101 XA[3] = sqrt( XA[0]*XA[0] + XA[1]*XA[1] + XA[2]*XA[2] );
1102 XK[3] = sqrt( XK[0]*XK[0] + XK[1]*XK[1] + XK[2]*XK[2] );
1104 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]);
1106 dampry_( &ITDKRC, &XK0DEC, XK, XA, QP, XN, &LIT, HV );
1117 else if( pdgid.size()==3 &&
1119 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 13,-14) ) ||
1120 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16,-13, 14) )
1124 DEBUG( cout<<
"Channel 2 : "; )
1130 double XK0DEC = 0.01;
1131 double XK[4] = { 0.0 };
1132 double XA[4] = { tau_daughters[2].px(), tau_daughters[2].py(), tau_daughters[2].pz(), tau_daughters[2].e() };
1133 double QP[4] = { tau_daughters[1].px(), tau_daughters[1].py(), tau_daughters[1].pz(), tau_daughters[1].e() };
1134 double XN[4] = { tau_daughters[0].px(), tau_daughters[0].py(), tau_daughters[0].pz(), tau_daughters[0].e() };
1135 double AMPLIT = 0.0;
1136 double HV[4] = { 0.0 };
1140 QP[3] = sqrt( QP[0]*QP[0] + QP[1]*QP[1] + QP[2]*QP[2] + 0.105659*0.105659);
1141 XA[3] = sqrt( XA[0]*XA[0] + XA[1]*XA[1] + XA[2]*XA[2] );
1143 dampry_( &ITDKRC, &XK0DEC, XK, XA, QP, XN, &LIT, HV );
1154 else if( pdgid.size()==4 &&
1156 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 13,-14, 22) ) ||
1157 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16,-13, 14, 22) )
1161 DEBUG( cout<<
"Channel 2b : "; )
1167 double XK0DEC = 0.01;
1168 double XK[4] = { tau_daughters[3].px(), tau_daughters[3].py(), tau_daughters[3].pz(), tau_daughters[3].e() };
1169 double XA[4] = { tau_daughters[2].px(), tau_daughters[2].py(), tau_daughters[2].pz(), tau_daughters[2].e() };
1170 double QP[4] = { tau_daughters[1].px(), tau_daughters[1].py(), tau_daughters[1].pz(), tau_daughters[1].e() };
1171 double XN[4] = { tau_daughters[0].px(), tau_daughters[0].py(), tau_daughters[0].pz(), tau_daughters[0].e() };
1172 double AMPLIT = 0.0;
1173 double HV[4] = { 0.0 };
1177 QP[3] = sqrt( QP[0]*QP[0] + QP[1]*QP[1] + QP[2]*QP[2] + 0.105659*0.105659);
1178 XA[3] = sqrt( XA[0]*XA[0] + XA[1]*XA[1] + XA[2]*XA[2] );
1179 XK[3] = sqrt( XK[0]*XK[0] + XK[1]*XK[1] + XK[2]*XK[2] );
1181 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]);
1184 dampry_( &ITDKRC, &XK0DEC, XK, XA, QP, XN, &LIT, HV );
1195 else if( pdgid.size()==4 &&
1197 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 111, 111,-211) ) ||
1198 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 111, 111, 211) )
1201 DEBUG( cout<<
"Channel 5 : "; )
1206 const double AMTAU = 1.777;
1208 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1209 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1210 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1211 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1212 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1214 float HV[4] = { 0.0 };
1219 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1230 else if( pdgid.size()==4 &&
1232 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211,-211, 211) ) ||
1233 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 211,-211) )
1236 DEBUG( cout<<
"Channel 5 : "; )
1241 const double AMTAU = 1.777;
1243 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1244 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1245 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1246 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1247 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1249 float HV[4] = { 0.0 };
1254 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1289 else if( pdgid.size()==4 &&
1291 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, -321, -211, 321) ) ||
1292 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 211,-321) )
1295 DEBUG( cout<<
"Channel 5 : "; )
1300 const double AMTAU = 1.777;
1304 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1305 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1306 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1307 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1308 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1310 float HV[4] = { 0.0 };
1315 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1326 else if( pdgid.size()==4 &&
1328 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 311, -211, 311 ) ) ||
1329 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 311, 211, 311 ) ) ||
1330 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 311, -211, 310 ) ) ||
1331 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 311, 211, 310 ) ) ||
1332 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 311, -211, 130 ) ) ||
1333 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 311, 211, 130 ) ) ||
1334 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 310, -211, 311 ) ) ||
1335 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 310, 211, 311 ) ) ||
1336 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 310, -211, 310 ) ) ||
1337 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 310, 211, 310 ) ) ||
1338 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 310, -211, 130 ) ) ||
1339 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 310, 211, 130 ) ) ||
1340 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 130, -211, 311 ) ) ||
1341 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 130, 211, 311 ) ) ||
1342 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 130, -211, 310 ) ) ||
1343 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 130, 211, 310 ) ) ||
1344 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 130, -211, 130 ) ) ||
1345 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 130, 211, 130 ) )
1348 DEBUG( cout<<
"Channel 5 : "; )
1353 const double AMTAU = 1.777;
1356 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1357 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1358 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1359 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1360 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1362 float HV[4] = { 0.0 };
1367 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1378 else if( pdgid.size()==4 &&
1380 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, -321, 311, 111) ) ||
1381 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 311, 111) ) ||
1382 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, -321, 310, 111) ) ||
1383 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 310, 111) ) ||
1384 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, -321, 130, 111) ) ||
1385 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 130, 111) )
1388 DEBUG( cout<<
"Channel 5 : "; )
1393 const double AMTAU = 1.777;
1396 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1397 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1398 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1399 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1400 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1402 float HV[4] = { 0.0 };
1407 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1418 else if( pdgid.size()==4 &&
1420 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 111, 111,-321) ) ||
1421 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 111, 111, 321) )
1424 DEBUG( cout<<
"Channel 5 : "; )
1429 const double AMTAU = 1.777;
1432 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1433 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1434 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1435 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1436 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1438 float HV[4] = { 0.0 };
1443 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1453 else if( pdgid.size()==4 &&
1455 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-321,-211, 211) ) ||
1456 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 321, 211,-211) )
1459 DEBUG( cout<<
"Channel 5 : "; )
1464 const double AMTAU = 1.777;
1467 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1468 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1469 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1470 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1471 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1473 float HV[4] = { 0.0 };
1478 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1487 else if( pdgid.size()==4 &&
1489 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 311, 111) ) ||
1490 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 311, 111) ) ||
1491 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 310, 111) ) ||
1492 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 310, 111) ) ||
1493 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211, 130, 111) ) ||
1494 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 130, 111) )
1497 DEBUG( cout<<
"Channel 5 : "; )
1502 const double AMTAU = 1.777;
1505 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1506 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1507 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1508 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1509 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1511 float HV[4] = { 0.0 };
1516 damppk_( &MNUM, PT, PN, PIM1, PIM2, PIPL, &LIT, HV );
1526 else if( pdgid.size()==5 &&
1528 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16,-211,-211, 211, 111) ) ||
1529 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 211, 211,-211, 111) )
1532 DEBUG( cout<<
"Channel 8 : "; )
1535 const double AMTAU = 1.777;
1537 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1538 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1539 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1540 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1541 float PIZ [4] = { (float)tau_daughters[4].px(), (float)tau_daughters[4].py(), (float)tau_daughters[4].pz(), (float)tau_daughters[4].e() };
1542 float PIPL[4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1544 float HV[4] = { 0.0 };
1546 dam4pi_( &MNUM, PT, PN, PIM1, PIM2, PIZ, PIPL, &LIT, HV );
1556 else if( pdgid.size()==5 &&
1558 ( tau_pdgid== 15 &&
channelMatch(tau_daughters, 16, 111, 111, 111,-211) ) ||
1559 ( tau_pdgid==-15 &&
channelMatch(tau_daughters,-16, 111, 111, 111, 211) )
1562 DEBUG( cout<<
"Channel 9 : "; )
1565 const double AMTAU = 1.777;
1567 float PT[4] = { 0.0, 0.0, 0.0, (float)AMTAU };
1568 float PN[4] = { (float)tau_daughters[0].px(), (float)tau_daughters[0].py(), (float)tau_daughters[0].pz(), (float)tau_daughters[0].e() };
1569 float PIM1[4] = { (float)tau_daughters[1].px(), (float)tau_daughters[1].py(), (float)tau_daughters[1].pz(), (float)tau_daughters[1].e() };
1570 float PIM2[4] = { (float)tau_daughters[2].px(), (float)tau_daughters[2].py(), (float)tau_daughters[2].pz(), (float)tau_daughters[2].e() };
1571 float PIZ [4] = { (float)tau_daughters[3].px(), (float)tau_daughters[3].py(), (float)tau_daughters[3].pz(), (float)tau_daughters[3].e() };
1572 float PIPL[4] = { (float)tau_daughters[4].px(), (float)tau_daughters[4].py(), (float)tau_daughters[4].pz(), (float)tau_daughters[4].e() };
1574 float HV[4] = { 0.0 };
1576 dam4pi_( &MNUM, PT, PN, PIM1, PIM2, PIZ, PIPL, &LIT, HV );
1586 DEBUG( cout<<tau_daughters.size()<<
"-part ???: "; )
1591 Particle HHbuf(HH[0], HH[1], HH[2], HH[3], 0);
1593 HHbuf.rotateXZ(theta);
1594 HHbuf.rotateXY(phi);
1635 double GSWr[7],GSWi[7];
1636 double GSWr0[7],GSWi0[7];
1642 double xsec,xsec0,xsecsum;
1650 alphaQED= 1.0/128.86674175;
1652 for (
int k=0;k<7;k++){
1653 GSWr[k]=1.0; GSWr0[k]=1.0;
1654 GSWi[k]=0.0; GSWi0[k]=0.0;
1659 if(ifkorch==1 && nonSM2==0) {
1672 if(ifkorch==1 && nonSM2==1) {
1686 Particle tau_plus ( sp_tau.px(), sp_tau.py(), sp_tau.pz(), sp_tau.e(), sp_tau.pdgid() );
1687 Particle tau_minus( sp_nu_tau.px(), sp_nu_tau.py(), sp_nu_tau.pz(), sp_nu_tau.e(), sp_nu_tau.pdgid() );
1689 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 );
1694 tau_plus. boostToRestFrame(P_QQ);
1695 tau_minus.boostToRestFrame(P_QQ);
1696 P_B1. boostToRestFrame(P_QQ);
1697 P_B2. boostToRestFrame(P_QQ);
1699 double costheta1 = (tau_plus.px()*P_B1.px() +tau_plus.py()*P_B1.py() +tau_plus.pz()*P_B1.pz() ) /
1700 sqrt(tau_plus.px()*tau_plus.px()+tau_plus.py()*tau_plus.py()+tau_plus.pz()*tau_plus.pz()) /
1701 sqrt(P_B1.px() *P_B1.px() +P_B1.py() *P_B1.py() +P_B1.pz() *P_B1.pz() );
1703 double costheta2 = (tau_minus.px()*P_B2.px() +tau_minus.py()*P_B2.py() +tau_minus.pz()*P_B2.pz() ) /
1704 sqrt(tau_minus.px()*tau_minus.px()+tau_minus.py()*tau_minus.py()+tau_minus.pz()*tau_minus.pz()) /
1705 sqrt(P_B2.px() *P_B2.px() +P_B2.py() *P_B2.py() +P_B2.pz() *P_B2.pz() );
1707 double sintheta1 = sqrt(1-costheta1*costheta1);
1708 double sintheta2 = sqrt(1-costheta2*costheta2);
1711 double costhe = (costheta1*sintheta2 + costheta2*sintheta1) / (sintheta1 + sintheta2);
1725 double x1x2 = SS/CMSENE/CMSENE;
1726 double x1Mx2 = P_QQ.pz()/CMSENE*2;
1728 double x1 = ( x1Mx2 + sqrt(x1Mx2*x1Mx2 + 4*x1x2) )/2;
1729 double x2 = ( -x1Mx2 + sqrt(x1Mx2*x1Mx2 + 4*x1x2) )/2;
1732 WID[0] = f(x1, 0,SS,CMSENE)*f(x2, 0,SS,CMSENE) * sigborn(0,SS, costhe);
1733 WID[1] = f(x1, 1,SS,CMSENE)*f(x2,-1,SS,CMSENE) * sigborn(1,SS, costhe);
1734 WID[2] = f(x1,-1,SS,CMSENE)*f(x2, 1,SS,CMSENE) * sigborn(1,SS,-costhe);
1735 WID[3] = f(x1, 2,SS,CMSENE)*f(x2,-2,SS,CMSENE) * sigborn(2,SS, costhe);
1736 WID[4] = f(x1,-2,SS,CMSENE)*f(x2, 2,SS,CMSENE) * sigborn(2,SS,-costhe);
1737 WID[5] = f(x1, 3,SS,CMSENE)*f(x2,-3,SS,CMSENE) * sigborn(3,SS, costhe);
1738 WID[6] = f(x1,-3,SS,CMSENE)*f(x2, 3,SS,CMSENE) * sigborn(3,SS,-costhe);
1739 WID[7] = f(x1, 4,SS,CMSENE)*f(x2,-4,SS,CMSENE) * sigborn(4,SS, costhe);
1740 WID[8] = f(x1,-4,SS,CMSENE)*f(x2, 4,SS,CMSENE) * sigborn(4,SS,-costhe);
1741 WID[9] = f(x1, 5,SS,CMSENE)*f(x2,-5,SS,CMSENE) * sigborn(5,SS, costhe);
1742 WID[10]= f(x1,-5,SS,CMSENE)*f(x2, 5,SS,CMSENE) * sigborn(5,SS,-costhe);
1758 for(
int i=0;i<=12;i++) sum+=WID[i];
1769 cout <<
"Tauspinner::calculateWeightFromParticlesH WARNING: sum of WID[0]-WID[10] is 0. Check LHAPDF configuration" << endl;
1773 if(relWTnonSM==0) WTnonSM=sum;
1777 WID2[0] = f(x1, 0,SS,CMSENE)*f(x2, 0,SS,CMSENE) * sigborn(0,SS, costhe) *
plweight(0,SS, costhe);
1778 WID2[1] = f(x1, 1,SS,CMSENE)*f(x2,-1,SS,CMSENE) * sigborn(1,SS, costhe) *
plweight(1,SS, costhe);
1779 WID2[2] = f(x1,-1,SS,CMSENE)*f(x2, 1,SS,CMSENE) * sigborn(1,SS,-costhe) *
plweight(1,SS,-costhe);
1780 WID2[3] = f(x1, 2,SS,CMSENE)*f(x2,-2,SS,CMSENE) * sigborn(2,SS, costhe) *
plweight(2,SS, costhe);
1781 WID2[4] = f(x1,-2,SS,CMSENE)*f(x2, 2,SS,CMSENE) * sigborn(2,SS,-costhe) *
plweight(2,SS,-costhe);
1782 WID2[5] = f(x1, 3,SS,CMSENE)*f(x2,-3,SS,CMSENE) * sigborn(3,SS, costhe) *
plweight(3,SS, costhe);
1783 WID2[6] = f(x1,-3,SS,CMSENE)*f(x2, 3,SS,CMSENE) * sigborn(3,SS,-costhe) *
plweight(3,SS,-costhe);
1784 WID2[7] = f(x1, 4,SS,CMSENE)*f(x2,-4,SS,CMSENE) * sigborn(4,SS, costhe) *
plweight(4,SS, costhe);
1785 WID2[8] = f(x1,-4,SS,CMSENE)*f(x2, 4,SS,CMSENE) * sigborn(4,SS,-costhe) *
plweight(4,SS,-costhe);
1786 WID2[9] = f(x1, 5,SS,CMSENE)*f(x2,-5,SS,CMSENE) * sigborn(5,SS, costhe) *
plweight(5,SS, costhe);
1787 WID2[10]= f(x1,-5,SS,CMSENE)*f(x2, 5,SS,CMSENE) * sigborn(5,SS,-costhe) *
plweight(5,SS,-costhe);
1800 for(
int i=0;i<=12;i++) sum2+=WID2[i];
1804 if(relWTnonSM==0) WTnonSM=sum2;
1812 if(IfHiggs && nonSM2==1) {
1813 double polp =
plzap2(0,15,S,costhe);
1814 pol += (2*(1-polp)-1);
1817 if(IfHiggs)
return NAN;
1820 for(
int i=0;i<=12;i++) WID[i]/=sum;
1833 for(
int i=0;i<=3;i++){
1834 for(
int j=0;j<=3;j++){
1840 for(
int i=1;i<=12;i++)
1844 double cost = costhe;
1847 if( ICC==2 || ICC==4 || ICC==6 || ICC==8 || ICC==10|| ICC==12 ) { cost = -cost; IROT=1;}
1851 if( ICC==7 || ICC==8 ) ID = 4;
1852 if( ICC==1 || ICC==2 ) ID = 1;
1853 if( ICC==5 || ICC==6 ) ID = 3;
1854 if( ICC==9 || ICC==10 ) ID = 5;
1855 if( ICC==11 || ICC==12 ) ID = 22;
1859 double polp =
plzap2(ID,tau_pdgid,S,cost);
1860 if(ifkorch==0) pol += (2*(1-polp)-1)*WID[i];
1868 pp.
m_R[1][1] = pp.
m_R[2][2] = 0.0;
1869 pp.
m_R[1][2] = pp.
m_R[2][1] = 0.0;
1870 pp.
m_R[0][1] = pp.
m_R[3][2] = 0.0;
1871 pp.
m_R[0][2] = pp.
m_R[3][1] = 0.0;
1872 pp.
m_R[1][0] = pp.
m_R[2][3] = 0.0;
1873 pp.
m_R[2][0] = pp.
m_R[1][3] = 0.0;
1898 if (ID==2||ID==4) {channel=2 ; IFLAV=2;}
1899 if (ID==1||ID==3||ID==5){channel=3 ; IFLAV=1;}
1913 sin2W0=
sin2W(IFLAV);
1914 alphaQED=7.2973525693e-3;
1915 for (
int k=0;k<7;k++){
1916 complex<double> rezu =
EWFACT(IFLAV, k, S, cost);
1919 GSWr[k]=real(rezu);GSWr0[k]=1.0;
1920 GSWi[k]=imag(rezu);GSWi0[k]=0.0;
1925 dipolqq_(&iqed,&Energy,&theta,&channel,&Amz0,&Gamz0,&sin2W0,&alphaQED,&ReA00,&ImA00, &ReB0,&ImB0, &ReX0,&ImX0,&ReY0,&ImY0, GSWr0,GSWi0,Rcor);
1928 dipolqq_(&iqed,&Energy,&theta,&channel,&Amz0,&Gamz0,&sin2W0,&alphaQED,&ReA0,&ImA0, &ReB,&ImB, &ReX,&ImX,&ReY,&ImY, GSWr,GSWi,Rcor);
1934 pp.
m_R[1][3]=-pp.
m_R[1][3];
1935 pp.
m_R[3][1]=-pp.
m_R[3][1];
1936 pp.
m_R[0][1]=-pp.
m_R[0][1];
1937 pp.
m_R[1][0]=-pp.
m_R[1][0];
1938 pp.
m_R[2][3]=-pp.
m_R[2][3];
1939 pp.
m_R[3][2]=-pp.
m_R[3][2];
1940 pp.
m_R[2][0]=-pp.
m_R[2][0];
1941 pp.
m_R[0][2]=-pp.
m_R[0][2];
1943 Rcor[1][3]=-Rcor[1][3];
1944 Rcor[3][1]=-Rcor[3][1];
1945 Rcor[0][1]=-Rcor[0][1];
1946 Rcor[1][0]=-Rcor[1][0];
1947 Rcor[2][3]=-Rcor[2][3];
1948 Rcor[3][2]=-Rcor[3][2];
1949 Rcor[2][0]=-Rcor[2][0];
1950 Rcor[0][2]=-Rcor[0][2];
1956 pol += WID[i]*pp.
m_R[0][3]/pp.
m_R[0][0];
1958 sumak +=WID[i]*pp.
m_R[0][0];
1971 R11 += WID[i]*pp.
m_R[1][1];
1972 R22 += WID[i]*pp.
m_R[2][2];
1973 R12 += WID[i]*pp.
m_R[1][2];
1974 R21 += WID[i]*pp.
m_R[2][1];
1977 for(
int i3=0;i3<=3;i3++){
1978 for(
int j=0;j<=3;j++){
1983 RcorExt[i4][j4]+=WID[i]*Rcor[i3][j];
1987 xsecsum+=xsec/xsec0*WID[i];
2029 if(relWTnonSM!=0) WTnonSM=xsecsum;
2030 if(relWTnonSM==0) {WTnonSM=xsecsum; std::cout <<
"input not supported: relWTnonSM=" <<relWTnonSM<<
" ifkorch= "<<ifkorch << std::endl;
2031 std::cout <<
"X-sects nonSM2="<<nonSM2<<
" sum= " << sum <<
" WTnonSM-korch= "<< xsecsum <<std::endl;
2053 bool channelMatch(vector<Particle> &particles,
int p1,
int p2,
int p3,
int p4,
int p5,
int p6)
2058 for(
unsigned int i=0;i<particles.size();i++) list.push_back(particles[i].pdgid());
2061 int p[6] = { p1, p2, p3, p4, p5, p6 };
2065 for(
int i=0;i<6;i++)
2072 for(
unsigned int j=0;j<list.size(); j++)
2078 list.erase(list.begin()+j);
2083 if(!found)
return false;
2087 if(list.size()!=0)
return false;
2092 vector<Particle> newList;
2094 for(
int i=0;i<6;i++)
2099 for(
unsigned int j=0;j<particles.size(); j++)
2102 if(particles[j].pdgid()==p[i])
2104 newList.push_back(particles[j]);
2105 particles.erase(particles.begin()+j);
2111 particles = newList;
2126 double px=nu_tau.px()+tau.px();
2127 double py=nu_tau.py()+tau.py();
2128 double pz=nu_tau.pz()+tau.pz();
2129 double e =nu_tau.e ()+tau.e ();
2132 cout<<
"--------------------------------------------------------------------------------------------------------"<<endl;
2140 for(
unsigned int i=0; i<tau_daughters.size();i++) tau_daughters[i].
print();
2143 cout<<
"--------------------------------------------------------------------------------------------------------"<<endl;
2157 double px=0.0,py=0.0,pz=0.0,e=0.0;
2159 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)
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)
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 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)