/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Generator/Mcgpj/Mcgpj-00-01-04/src/code/src/TGGCrossPart.C

Go to the documentation of this file.
00001 #include <iostream>
00002 #include "TGGCrossPart.h"
00003 #include "TRadGlobal.h"
00004 #include "TKinemCut.h"
00005 
00006 using namespace std;
00007 
00008 #define DB(x) #x<<"="<<x<<", "
00009 
00010 TGGCrossPart::TGGCrossPart():TVCrossPart(){
00011   fNPart = 5;
00012 
00013   fD     = new TDFun();
00014   fEvent = new TEvent();
00015 
00016   // soft photons 
00017   fPhD1  = new TPhotonD();
00018   fPhD2  = new TPhotonD();
00019 
00020   // initial hard photons
00021   fPhI1  = new TPhotonI();
00022   fPhI2  = new TPhotonI();
00023   
00024   fHardPhoton = true;
00025   fNoFSR      = false;
00026   fThetaLocked = false;
00027 }
00028 
00029 void TGGCrossPart::SetThetaMin(const double &th){
00030   if(fThetaLocked)return;
00031   //  cout<<"ThetaMin = "<<th<<endl;
00032   fCosMin  = cos(th);
00033   fMax     = (1 + fCosMin*fCosMin)/(1 - fCosMin*fCosMin);
00034   double cmax = fCosMin, cmin = -fCosMin;
00035   fNorm    = (cmin-cmax - log((1-cmax)/(1-cmin))+log((1+cmax)/(1+cmin))) * // Theta norm
00036     2*gConst->Pi(); // Phi norm  
00037   //  cout<<DB(fCosMin)<<DB(fMax)<<DB(fNorm)<<endl;
00038 }
00039 
00040 double TGGCrossPart::MakeCosTheta(){
00041   // generate distribution (1 + cos^2(theta))/(1 - cos^2(theta))dcos(theta)
00042   double c,c2;
00043   do{
00044     c = (2*gRandom->Rndm()-1)*fCosMin;
00045     c2 = c*c;
00046   }while( (1+c2) < (1-c2)*fMax*gRandom->Rndm());
00047   fNormTheta = fNorm*(1-c2)/(1+c2);
00048   return c;
00049 }
00050 
00051 double TGGCrossPart::GetCNorm(){
00052   return fNormTheta;
00053 }
00054 
00055 void TGGCrossPart::Init(){
00056   SetThetaMin(gGlobal->Get_ThetaMin());
00057   //  SetThetaMin(gGlobal->Get_Theta0());
00058   //  fThetaLocked = true;
00059 
00060   fD->Init();
00061   fEvent->Init();
00062 
00063   fPhD1->Init();
00064   fPhD2->Init();
00065 
00066   fPhI1->Init();
00067   fPhI2->Init();
00068 }
00069 
00070 TGGCrossPart::~TGGCrossPart(){
00071   delete fD;
00072   delete fEvent;
00073 
00074   delete fPhD1;
00075   delete fPhD2;
00076 
00077   delete fPhI1;
00078   delete fPhI2;
00079 }
00080 
00081 double TGGCrossPart::BornShift(const double &z1, const double &z2, 
00082                                const double &c){
00083   double cs = 2*(pow(z1*(1-c), 2) + pow(z2*(1+c), 2))/
00084     ((1-c*c)*pow(z1+z2+(z2-z1)*c, 2)*z1*z2);
00085   return 0.5*cs;
00086 }
00087 
00088 // define compensator term for initial particles
00089 #define COMP_I(x) AP*(-(1/x-1+0.5*x)*gGlobal->Get_LnD()+0.5*x)
00090 //#define COMP_I(x) 0
00091 
00092 double TGGCrossPart::GetValue(const unsigned int ipart){
00093   bool IsSoftIE, IsSoftIP;
00094   IsSoftIE = IsSoftIP = true;
00095 
00096   bool CompSV, CompIE, CompIP;
00097   CompSV = CompIE = CompIP = false;
00098   double AP = gConst->AlphaPi();
00099 
00100   double c  = MakeCosTheta();
00101 
00102   switch(ipart){
00103   case 0:
00104     IsSoftIE = IsSoftIP = true;
00105     CompSV   = true;
00106     break;
00107   case 1:
00108     IsSoftIP = false;
00109     CompIP   = true;
00110     break;
00111   case 2:
00112     IsSoftIE = false;
00113     CompIE   = true;
00114     break;
00115   case 3:
00116     IsSoftIE = IsSoftIP = false;
00117     break;
00118   case 4:
00119     // three photons out of narrow cones around initial particles
00120     if(fHardPhoton && fEvent->MakeEvent(c,fPhI1,3)){
00121       double r3g = R_3_Gamma();
00122       double t1 = gConst->Alpha()/(2*gConst->Pi2())*r3g;
00123       double norm = fPhI1->GetENorm()*fPhI1->GetThNorm()*
00124         fPhI1->GetPhiNorm()*GetCNorm();
00125       double res = t1*norm;
00126 //       if(res>10000){
00127 //      TLorentzVector q[3];
00128 //      for(int i=0;i<3;i++)
00129 //        q[i] = fEvent->Get4Vector(i);
00130 //      double CosPsi = fEvent->GetCosPsi();
00131 //      double gamma = q[2].E()*q[0].P()/(2 - q[2].E()*(1-CosPsi));
00132 //      double gamma2 = q[2].E()*q[0].E()/q[1].E();
00133 //      cout<<DB(res)<<DB(r3g)<<DB(t1)<<DB(norm)<<DB(CosPsi)<<DB(gamma)<<DB(q[1].E())<<DB(gamma2)<<endl;
00134 //      fEvent->Print();
00135 //       }
00136       
00137       res *= 3; // The third photon always has the lowest energy
00138 
00139       return 0.5*res;
00140     }
00141     return 0;
00142     break;
00143   case 5:
00144  // Soft and virtial part for one photon cross-section (testing purpose only)
00145     if(fEvent->MakeEventgg(c, (double)0, (double)0)){
00146       double lde = gGlobal->Get_LnDelta();
00147       double Ae = (gGlobal->Get_L()-1)*(lde + 3./4.); 
00148       return BornShift(1,1,c)*(1 + AP*(2*Ae + K_SV(c)))*GetCNorm();
00149     }
00150     return 0;
00151     break;
00152   default:
00153     return 0;
00154     break;
00155   }
00156 
00157   if(!fHardPhoton) CompSV = CompIE = CompIP  = false;
00158 
00159   double  x1g, x2g;
00160   x1g = x2g = 0;
00161 
00162   double  z1, z2;
00163   z1 = z2 = 1;
00164 
00165   if(IsSoftIE)
00166     x1g = fPhD1->GetEnergy(); 
00167   else
00168     x1g = fPhI1->GetEnergy();
00169   z1 = 1 - x1g;
00170   
00171   if(IsSoftIP)
00172     x2g = fPhD2->GetEnergy(); 
00173   else
00174     x2g = fPhI2->GetEnergy();
00175   z2 = 1 - x2g;
00176   
00177   if(fEvent->MakeEventgg(c, x1g, x2g)){
00178     
00179     double D1, D2, t2 = 0;
00180 
00181     if(IsSoftIE)
00182       D1 = fD->EvalSoft(x1g)*fPhD1->GetENorm();
00183     else{
00184       double norm = fPhI1->GetENorm();
00185       D1 = fD->Eval(z1)*norm;
00186       if(CompIE) t2 = COMP_I(x1g)*norm;
00187     }
00188     
00189     if(IsSoftIP)
00190       D2 = fD->EvalSoft(x2g)*fPhD2->GetENorm();
00191     else{
00192       double norm = fPhI2->GetENorm();
00193       D2 = fD->Eval(z2)*norm;
00194       if(CompIP) t2 = COMP_I(x2g)*norm;
00195     }
00196     
00197     if(CompSV){
00198       t2 = 0;//AP*2*gGlobal->Get_LnDelta();
00199     }
00200 
00201     double t1 = (1 + AP*K_SV(c))*D1*D2;
00202 
00203     return BornShift(z1,z2,c)*(t1 + t2)*GetCNorm();
00204     
00205   }
00206   return 0;
00207 }
00208 
00209 double TGGCrossPart::R_3_Gamma(){
00210   TLorentzVector q[3];
00211   for(int i=0;i<3;i++) {
00212     q[i] = fEvent->Get4Vector(i);
00213     //    cout<<i<<" "<<q[i].E()<<" "<<q[i].P()<<" "<<q[i].Theta()<<" "<<q[i].Phi()<<endl;
00214   }
00215   TLorentzVector pm(0,0, gGlobal->Get_BetaI(),1.);
00216   TLorentzVector pp(0,0,-gGlobal->Get_BetaI(),1.);
00217   double chi[3], chi_p[3];
00218   for(int i=0;i<3;i++){
00219     chi[i]   = q[i]*pm;
00220     chi_p[i] = q[i]*pp;
00221     //    cout<<i<<" "<<chi[i]<<" "<<chi_p[i]<<endl;
00222   }
00223 
00224   double res = 0;
00225   double s = 4;
00226   double me2 = gGlobal->Get_MI2();
00227   double cycper[3];
00228   for(int i=0;i<3;i++){ // cyclic permutations
00229     int i0 = (0 + i)%3, i1 = (1 + i)%3, i2 = (2 + i)%3;
00230     
00231     double chi22 = pow(chi[i2],2);
00232     double chi_p22 = pow(chi_p[i2],2);
00233     cycper[i]  = s*(chi22 + chi_p22)/(chi[i0]*chi[i1]*chi_p[i0]*chi_p[i1]);
00234     cycper[i] -= 2*me2*
00235       ((pow(chi[i0],2)+pow(chi[i1],2))/(chi[i0]*chi[i1]*chi_p22)+
00236        (pow(chi_p[i0],2)+pow(chi_p[i1],2))/(chi_p[i0]*chi_p[i1]*chi22));
00237     res += cycper[i];
00238     //  cout<<DB(i)<<DB(j)<<DB(k)<<endl;
00239     
00240   }
00241   //  cout<<res<<endl;
00242   double CosPsi = fEvent->GetCosPsi();
00243   double gamma = q[2].E()*q[0].P()/(2 - q[2].E()*(1-CosPsi));
00244   //  double gamma = q[2].E()*q[0].E()/q[1].E();
00245 //   if(res/3*gamma*0.25>1e7){
00246 //     cout<<DB(CosPsi)<<DB(gamma)<<endl;
00247 //     cout<<DB(cycper[0])<<DB(cycper[1])<<DB(cycper[2])<<endl;
00248 //     cout<<DB(chi[0])<<DB(chi[1])<<DB(chi[2])<<endl;
00249 //     cout<<DB(chi_p[0])<<DB(chi_p[1])<<DB(chi_p[2])<<endl;
00250 //     for(int i=0;i<3;i++)cout<<q[i][0]<<" "<<q[i][1]<<" "<<q[i][2]<<" "<<q[i][3]<<endl;
00251 //     cout<<q[0].Theta()<<" "<<q[1].Theta()<<" "<<q[2].Theta()<<endl;
00252 //   }
00253   
00254   return res/3*gamma*0.25;
00255 }
00256 
00257 double TGGCrossPart::K_SV(const double &c){
00258   double R = (1+c)/(1-c);
00259   double iR = 1/R;
00260   double lmc = log(0.5*(1-c));
00261   double lpc = log(0.5*(1+c));
00262   return gConst->Pi2()/3 + (1-c*c)/(2*(1+c*c))*
00263     ( (1 + 1.5*R)*lmc + (1 + iR + 0.5*R)*lmc*lmc +
00264       (1 + 1.5*iR)*lpc + (1 + R + 0.5*iR)*lpc*lpc );
00265 }

Generated on Tue Nov 29 23:12:41 2016 for BOSS_7.0.2 by  doxygen 1.4.7