nonSM.cxx

00001 #include <iostream>
00002 #include "TauSpinner/nonSM.h"
00003 using std::cout;
00004 using std::endl;
00005 
00006 namespace TauSpinner {
00007 
00008 /*****   GLOBAL VARIABLES   *****/
00009 
00010 double (*nonSM_bornZ)(int, double, double, int, int, int) = default_nonSM_born;
00011 double (*nonSM_bornH)(int, double, double, int, int, int) = default_nonSM_bornH;
00012 
00013 extern int nonSM2;
00014 extern int nonSMN;
00015 extern double WTnonSM;
00016 extern bool   IfHiggs;
00017 /********************************/
00018 
00019 double nonSM_born(int ID, double S, double cost, int H1, int H2, int key)
00020 {
00021   if(IfHiggs) return nonSM_bornH(ID,S,cost,H1,H2,key);
00022   else        return nonSM_bornZ(ID,S,cost,H1,H2,key);
00023 }
00024 
00025 
00026 double default_nonSM_born(int ID, double S, double cost, int H1, int H2, int key)
00027 {
00028   cout<<"TauSpinner::default_nonSM_born: this function is dummy\n"<<endl;
00029   cout<<"             user must provide his own nonSM_born"<<endl;
00030   cout<<"             see: nonSM_adopt() and set_nonSM_born( NULL )"<<endl;
00031   cout<<"             in TauSpinner/examples/tau-reweight-test.cxx for details"<<endl;
00032   exit(-1);
00033   return 1.0;
00034 }
00035 
00036 
00037 double default_nonSM_bornH(int ID, double S, double cost, int H1, int H2, int key)
00038 {
00039   cout<<"TauSpinner::default_nonSM_born: this function is dummy\n"<<endl;
00040   cout<<"             user must provide his own nonSM_born"<<endl;
00041   cout<<"             see: nonSM_adopt() and set_nonSM_born( NULL )"<<endl;
00042   cout<<"             in TauSpinner/examples/tau-reweight-test.cxx for details"<<endl;
00043   exit(-1);
00044   return 1.0;
00045 }
00046 
00047 void set_nonSM_born( double (*fun)(int, double, double, int, int, int) )
00048 {
00049   if(fun==NULL) nonSM_bornZ = default_nonSM_born;
00050   else          nonSM_bornZ = fun;
00051 }
00052 
00053 void set_nonSM_bornH( double (*fun)(int, double, double, int, int, int) )
00054 {
00055   if(fun==NULL) nonSM_bornH = default_nonSM_bornH;
00056   else          nonSM_bornH = fun;
00057 }
00058 
00059 double plzap2(int ide, int idf, double svar, double costhe)
00060 {
00061   if(ide!=0)
00062   {
00063     if(idf > 0) initwk_(&ide,&idf,&svar);
00064     else
00065     {
00066       int mide=-ide;
00067       int midf=-idf;
00068 
00069       initwk_(&mide,&midf,&svar);
00070     }
00071   }
00072 
00073   int    zero =  0;
00074   double one  =  1.0;
00075   double mone = -1.0;
00076   double ret  =  0.0;
00077 
00078   if(nonSM2==0)
00079   {
00080     ret =  t_born_(&zero,&svar,&costhe, &one, &one)
00081          /(t_born_(&zero,&svar,&costhe, &one, &one)
00082           +t_born_(&zero,&svar,&costhe,&mone,&mone));
00083   }
00084   else if(nonSM2==1)
00085   {
00086     ret =  nonSM_born(ide,svar,costhe, 1, 1, nonSM2)
00087          /(nonSM_born(ide,svar,costhe, 1, 1, nonSM2)
00088           +nonSM_born(ide,svar,costhe,-1,-1, nonSM2));
00089   }
00090   // test of user prepared born cross section can be prepared here. 
00091   // convention between t_born and nonSM_born in choice of flavours
00092   // sign of costhe helicity signs etc have to be performed using SM version
00093   // of nonSM_born. Matching (up to may be overall s-dependent factor) between
00094   // t_born and nonSM_born must be achieved, see Section 4 for details
00095   // on technical tests. 
00096   DEBUG(
00097     double sm=  t_born_(&zero,&svar,&costhe, &one, &one)
00098               /(t_born_(&zero,&svar,&costhe, &one, &one)
00099                +t_born_(&zero,&svar,&costhe,&mone,&mone));
00100     double nsm= nonSM_born(ide,svar,costhe, 1, 1, nonSM2)
00101               /(nonSM_born(ide,svar,costhe, 1, 1, nonSM2)
00102                +nonSM_born(ide,svar,costhe,-1,-1, nonSM2));
00103     double smn= nonSM_born(ide,svar,costhe, 1, 1, 0     )
00104               /(nonSM_born(ide,svar,costhe, 1, 1, 0     )
00105                +nonSM_born(ide,svar,costhe,-1,-1, 0     ));
00106 
00107     cout<<"test of nonSM Born nonsm2="<<nonSM2 << endl;
00108     cout<<"ide,svar,costhe="<<ide <<" " << svar <<" "  << costhe << endl;
00109     cout<<"sm="<<sm <<" sm (new)="<<smn <<" nsm="<<nsm << endl;
00110     cout<<"sm and sm (new) should be essentially equal" << endl << endl;
00111     if (IfHiggs) cout << "(for Higgs we need to improve algorithm)" << endl;
00112 
00113   )
00114   return ret;
00115 }
00116 
00117 double plweight(int ide, double svar, double costhe)
00118 {
00119   if(nonSM2==0) return 1.0;
00120   if (ide==0 && !IfHiggs) return 1.0;
00121 
00122   double ret      =( nonSM_born(ide,svar,costhe, 1, 1, nonSM2)/svar
00123                     +nonSM_born(ide,svar,costhe,-1,-1, nonSM2)/svar)
00124                   /( nonSM_born(ide,svar,costhe, 1, 1, 0)/svar
00125                     +nonSM_born(ide,svar,costhe,-1,-1, 0)/svar);   // svar is introduced for future use
00126   // another option angular dependence only. Effect on x-section removed
00127   if(nonSMN==1) ret = ret * plnorm(ide,svar);
00128 
00129   return ret;
00130 }
00131 
00132 double plnorm(int ide, double svar)
00133 {
00134   if(nonSMN==0) return 1.0;
00135 
00136   double c1 = 1.0/sqrt(3.0);
00137   double c2 = sqrt(2.0/3.0);
00138 
00139   double alpha  = 2*nonSM_born(ide,svar,0.0, 1, 1,0)+
00140                   2*nonSM_born(ide,svar,0.0,-1,-1,0);
00141   double beta   =   nonSM_born(ide,svar, c1, 1, 1,0) + nonSM_born(ide,svar,-c1, 1, 1,0)+
00142                     nonSM_born(ide,svar, c1,-1,-1,0) + nonSM_born(ide,svar,-c1,-1,-1,0);
00143   double gamma  =   nonSM_born(ide,svar, c2, 1, 1,0) + nonSM_born(ide,svar,-c2, 1, 1,0)+
00144                     nonSM_born(ide,svar, c2,-1,-1,0) + nonSM_born(ide,svar,-c2,-1,-1,0);
00145   double ret = ( alpha + 0.9*(gamma+alpha-2*beta) + 0.5*(4*beta-3*alpha-gamma) );
00146 
00147   alpha  = 2*nonSM_born(ide,svar,0.0, 1, 1,nonSM2)+
00148            2*nonSM_born(ide,svar,0.0,-1,-1,nonSM2);
00149   beta   =   nonSM_born(ide,svar, c1, 1, 1,nonSM2) + nonSM_born(ide,svar,-c1, 1, 1,nonSM2)+
00150              nonSM_born(ide,svar, c1,-1,-1,nonSM2) + nonSM_born(ide,svar,-c1,-1,-1,nonSM2);
00151   gamma  =   nonSM_born(ide,svar, c2, 1, 1,nonSM2) + nonSM_born(ide,svar,-c2, 1, 1,nonSM2)+
00152              nonSM_born(ide,svar, c2,-1,-1,nonSM2) + nonSM_born(ide,svar,-c2,-1,-1,nonSM2);
00153 
00154   ret = ret / ( alpha + 0.9*(gamma+alpha-2*beta) + 0.5*(4*beta-3*alpha-gamma) );
00155 
00156   return ret;
00157 }
00158 
00159 void nonSMHcorrPol(double S, SimpleParticle &tau1, SimpleParticle &tau2,
00160                    double *corrX2, double *polX2)
00161 {  // tau+ and tau- in lab frame
00162   Particle tau_plus (    tau1.px(),    tau1.py(),    tau1.pz(),    tau1.e(),    tau1.pdgid() );
00163   Particle tau_minus(    tau2.px(),    tau2.py(),    tau2.pz(),    tau2.e(),    tau2.pdgid() );
00164 
00165   // P_QQ = sum of tau+ and tau- in lab frame
00166   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 );
00167   
00168   Particle P_B1(0, 0, 1, 1, 0);
00169   Particle P_B2(0, 0,-1, 1, 0);
00170 
00171   tau_plus. boostToRestFrame(P_QQ);
00172   tau_minus.boostToRestFrame(P_QQ);
00173   P_B1.     boostToRestFrame(P_QQ);
00174   P_B2.     boostToRestFrame(P_QQ);
00175   
00176   double costheta1 = (tau_plus.px()*P_B1.px()    +tau_plus.py()*P_B1.py()    +tau_plus.pz()*P_B1.pz()    ) /
00177                  sqrt(tau_plus.px()*tau_plus.px()+tau_plus.py()*tau_plus.py()+tau_plus.pz()*tau_plus.pz()) /
00178                  sqrt(P_B1.px()    *P_B1.px()    +P_B1.py()    *P_B1.py()    +P_B1.pz()    *P_B1.pz()    );
00179 
00180   double costheta2 = (tau_minus.px()*P_B2.px()    +tau_minus.py()*P_B2.py()    +tau_minus.pz()*P_B2.pz()    ) /
00181                  sqrt(tau_minus.px()*tau_minus.px()+tau_minus.py()*tau_minus.py()+tau_minus.pz()*tau_minus.pz()) /
00182                  sqrt(P_B2.px()    *P_B2.px()    +P_B2.py()    *P_B2.py()    +P_B2.pz()    *P_B2.pz()    );
00183                
00184   double sintheta1 = sqrt(1-costheta1*costheta1);
00185   double sintheta2 = sqrt(1-costheta2*costheta2);
00186   
00187   // Cosine of hard scattering
00188   double costhe = (costheta1*sintheta2 + costheta2*sintheta1) / (sintheta1 + sintheta2);
00189   
00190   // Invariant mass of tau+tau- pair
00191   double SS     = S; // other option is for tests: P_QQ.recalculated_mass()*P_QQ.recalculated_mass();
00192   
00193 
00194   // corrX2 calculation
00195   // polX2 calculation
00196   // WTnonSM calculation
00197   *corrX2 = -1.0;  // default
00198   *polX2  =  0.0;  // default
00199   WTnonSM =  1.0;  // default
00200 }
00201 
00202 } // namespace TauSpinner
Generated on Sun Oct 20 20:24:09 2013 for C++InterfacetoTauola by  doxygen 1.6.3