2 #include "TauSpinner/nonSM.h"
3 #include "TauSpinner/EWtables.h"
16 extern double WTnonSM;
20 double nonSM_born(
int ID,
double S,
double cost,
int H1,
int H2,
int key)
22 if(IfHiggs)
return nonSM_bornH(ID,S,cost,H1,H2,key);
23 else return nonSM_bornZ(ID,S,cost,H1,H2,key);
41 if (ID == 3 || ID == 5)
52 cout <<
"WARNING: default_nonSM_bornZ: unexpected ID continue debugging: " << ID << endl;
79 return t_bornew_(&Bmode, &keyGSW, &S, &cost, &H1d , &H2d);}
81 return t_born_ (&zero, &S, &cost, &H1d , &H2d);}
85 cout<<
"TauSpinner::default_nonSM_bornZ: EW tables were not initialize\n"<<endl;
86 cout<<
" and user has not provided his own nonSM_bornZ too"<<endl;
87 cout<<
" see eg. nonSM_adopt() and set_nonSM_born( NULL ) of tau-reweight-test.cxx"<<endl;
88 cout<<
" in TauSpinner/examples/tau-reweight-test.cxx for details"<<endl;
97 cout<<
"TauSpinner::default_nonSM_bornH: this function is dummy\n"<<endl;
98 cout<<
" user must provide his own nonSM_bornH"<<endl;
99 cout<<
" see eg. nonSM_adopt() and set_nonSM_bornH( NULL ) of tau-reweight-test.cxx"<<endl;
100 cout<<
" in TauSpinner/examples/tau-reweight-test.cxx for details"<<endl;
110 else {nonSM_bornZ = fun;
return 1;}
119 else {nonSM_bornH = fun;
return 1;}
125 double plzap2(
int ide,
int idf,
double svar,
double costhe)
129 if(idf > 0) initwk_(&ide,&idf,&svar);
135 initwk_(&mide,&midf,&svar);
146 ret = t_born_(&zero,&svar,&costhe, &one, &one)
147 /(t_born_(&zero,&svar,&costhe, &one, &one)
148 +t_born_(&zero,&svar,&costhe,&mone,&mone));
152 ret =
nonSM_born(ide,svar,costhe, 1, 1, nonSM2)
163 double sm= t_born_(&zero,&svar,&costhe, &one, &one)
164 /(t_born_(&zero,&svar,&costhe, &one, &one)
165 +t_born_(&zero,&svar,&costhe,&mone,&mone));
166 double nsm=
nonSM_born(ide,svar,costhe, 1, 1, nonSM2)
169 double smn=
nonSM_born(ide,svar,costhe, 1, 1, 0 )
173 cout<<
"test of nonSM Born nonsm2="<<nonSM2 << endl;
174 cout<<
"ide,svar,costhe="<<ide <<
" " << svar <<
" " << costhe << endl;
175 cout<<
"sm="<<sm <<
" sm (new)="<<smn <<
" nsm="<<nsm << endl;
176 cout<<
"sm and sm (new) should be essentially equal" << endl << endl;
177 if (IfHiggs) cout <<
"(for Higgs we need to improve algorithm)" << endl;
185 double plweight(
int ide,
double svar,
double costhe)
187 if(nonSM2==0)
return 1.0;
188 if (ide==0 && !IfHiggs)
return 1.0;
190 double ret =(
nonSM_born(ide,svar,costhe, 1, 1, nonSM2)/svar
191 +
nonSM_born(ide,svar,costhe,-1,-1, nonSM2)/svar);
192 double retm =(
nonSM_born(ide,svar,costhe, 1, 1, 0)/svar
195 if(nonSMN==1) ret = ret *
plnorm(ide,svar);
201 if(nonSMN==0)
return 1.0;
203 double c1 = 1.0/sqrt(3.0);
204 double c2 = sqrt(2.0/3.0);
206 double alpha = 2*
nonSM_born(ide,svar,0.0, 1, 1,0)+
208 double beta =
nonSM_born(ide,svar, c1, 1, 1,0) +
nonSM_born(ide,svar,-c1, 1, 1,0)+
209 nonSM_born(ide,svar, c1,-1,-1,0) +
nonSM_born(ide,svar,-c1,-1,-1,0);
210 double gamma =
nonSM_born(ide,svar, c2, 1, 1,0) +
nonSM_born(ide,svar,-c2, 1, 1,0)+
211 nonSM_born(ide,svar, c2,-1,-1,0) +
nonSM_born(ide,svar,-c2,-1,-1,0);
212 double ret = ( alpha + 0.9*(gamma+alpha-2*beta) + 0.5*(4*beta-3*alpha-gamma) );
214 alpha = 2*
nonSM_born(ide,svar,0.0, 1, 1,nonSM2)+
216 beta =
nonSM_born(ide,svar, c1, 1, 1,nonSM2) +
nonSM_born(ide,svar,-c1, 1, 1,nonSM2)+
217 nonSM_born(ide,svar, c1,-1,-1,nonSM2) +
nonSM_born(ide,svar,-c1,-1,-1,nonSM2);
218 gamma =
nonSM_born(ide,svar, c2, 1, 1,nonSM2) +
nonSM_born(ide,svar,-c2, 1, 1,nonSM2)+
219 nonSM_born(ide,svar, c2,-1,-1,nonSM2) +
nonSM_born(ide,svar,-c2,-1,-1,nonSM2);
221 ret = ret / ( alpha + 0.9*(gamma+alpha-2*beta) + 0.5*(4*beta-3*alpha-gamma) );
227 double *corrX2,
double *polX2)
229 Particle tau_plus ( tau1.px(), tau1.py(), tau1.pz(), tau1.e(), tau1.pdgid() );
230 Particle tau_minus( tau2.px(), tau2.py(), tau2.pz(), tau2.e(), tau2.pdgid() );
233 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 );
238 tau_plus. boostToRestFrame(P_QQ);
239 tau_minus.boostToRestFrame(P_QQ);
240 P_B1. boostToRestFrame(P_QQ);
241 P_B2. boostToRestFrame(P_QQ);
243 double costheta1 = (tau_plus.px()*P_B1.px() +tau_plus.py()*P_B1.py() +tau_plus.pz()*P_B1.pz() ) /
244 sqrt(tau_plus.px()*tau_plus.px()+tau_plus.py()*tau_plus.py()+tau_plus.pz()*tau_plus.pz()) /
245 sqrt(P_B1.px() *P_B1.px() +P_B1.py() *P_B1.py() +P_B1.pz() *P_B1.pz() );
247 double costheta2 = (tau_minus.px()*P_B2.px() +tau_minus.py()*P_B2.py() +tau_minus.pz()*P_B2.pz() ) /
248 sqrt(tau_minus.px()*tau_minus.px()+tau_minus.py()*tau_minus.py()+tau_minus.pz()*tau_minus.pz()) /
249 sqrt(P_B2.px() *P_B2.px() +P_B2.py() *P_B2.py() +P_B2.pz() *P_B2.pz() );
251 double sintheta1 = sqrt(1-costheta1*costheta1);
252 double sintheta2 = sqrt(1-costheta2*costheta2);
255 double costhe = (costheta1*sintheta2 + costheta2*sintheta1) / (sintheta1 + sintheta2);
double plweight(int ide, double svar, double costhe)
double plzap2(int ide, int idf, double svar, double costhe)
void keyGSWGet(int *keyGSW)
double plnorm(int ide, double svar)
double default_nonSM_bornH(int ID, double S, double cost, int H1, int H2, int key)
void nonSMHcorrPol(double S, SimpleParticle &tau1, SimpleParticle &tau2, double *corrX2, double *polX2)
int set_nonSM_bornH(double(*fun)(int, double, double, int, int, int))
int set_nonSM_born(double(*fun)(int, double, double, int, int, int))
int initEWff(int ID, double S, double cost, int key)
double default_nonSM_bornZ(int ID, double S, double cost, int H1, int H2, int key)
double nonSM_born(int ID, double S, double cost, int H1, int H2, int key)