#include <sys/stat.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <stdexcept>
#include "TFile.h"
#include "TRandom3.h"
#include "TRadCor.h"
#include "TEPCrossPart.h"
#include "TMuCrossPart.h"
#include "TPiCrossPart.h"
#include "TKnCrossPart.h"
#include "TRadGlobal.h"
#include "TKinemCut.h"
Go to the source code of this file.
Functions | |
void | init_prime_gen_ (const int &, const double &, const double &, const double &) |
void | makeevent_ (double *, int *, int &) |
void | genfinish_ (void) |
Variables | |
TRadCor * | gRad |
TRadGlobal * | gGlobal |
TKinemCut * | gCut |
TConstants * | gConst |
int | pid [2] |
string | RandomFileName |
void genfinish_ | ( | void | ) |
Definition at line 236 of file prime_gen_wrap.C.
References RandomFileName.
00236 { 00237 struct stat stbuf; 00238 if( stat(RandomFileName.c_str(),&stbuf) == 0 ){ 00239 remove(RandomFileName.c_str()); 00240 } 00241 cout<<"Writing random seed to file \""<<RandomFileName<<"\"."<<endl; 00242 gRandom->WriteRandom(RandomFileName.c_str()); 00243 delete gRandom; 00244 }
void init_prime_gen_ | ( | const int & | , | |
const double & | , | |||
const double & | , | |||
const double & | ||||
) |
Definition at line 33 of file prime_gen_wrap.C.
References al, at(), TKinemCut::AverageTheta(), cos(), TKinemCut::CosPsi(), TKinemCut::DeltaPhi(), TKinemCut::DeltaTheta(), dt, TKinemCut::EMin(), gConst, gCut, TRadGlobal::Get_RelativeError(), TRadGlobal::Get_TotalError(), gGlobal, gRad, TRadCor::Init(), TKinemCut::Init(), TRadGlobal::Init(), InList, IsFSR, IsHardPhoton, IsNoVacPol, ganga-rec::j, TRadCor::MakeCrossSection(), MatrixElements, MaxList, NRad, TKinemCut::PAverage(), TKinemCut::PCross(), pid, TKinemCut::Print(), TRadGlobal::Print(), TConstants::Print(), RandomFileName, TRadGlobal::Set_dE_Abs(), TRadGlobal::Set_E(), TRadGlobal::Set_RelativeError(), TRadGlobal::Set_Theta0_Rel(), TRadGlobal::Set_ThetaInt(), TRadGlobal::Set_ThetaMin(), TRadGlobal::Set_TotalError(), TRadGlobal::Set_Type(), TConstants::SetAlphaScale(), TVCrossPart::SetHardPhoton(), TRadCor::SetNEvents(), TVCrossPart::SetNoFSR(), TRadCor::SetPartList(), TVCrossPart::SetZeroVP(), TKinemCut::ThetaMinM(), and TKinemCut::ThetaMinP().
00034 { 00035 cout<<proc<<" "<<EBeam<<" "<<te<<" "<<c<<endl<<flush; 00036 00037 gConst = new TConstants(); 00038 gGlobal = new TRadGlobal(); 00039 gCut = new TKinemCut(); 00040 00041 int NRad = 10000; 00042 int IsHardPhoton = 1; 00043 int IsNoVacPol = 0; 00044 int IsFSR = 1; 00045 RandomFileName = ".random_stat.root"; 00046 double pc = 0.; 00047 double de = -1.; 00048 double nt0 = -1.; 00049 double dt = 0.5; 00050 double dp = 0.3; 00051 double at = c; 00052 double td = c - dt/2; 00053 double am = 90.; 00054 double cm = 90.; 00055 double em = 50.; 00056 double ti = 0.473; 00057 double al = 1.; 00058 double thm = -1.; 00059 double thp = -1.; 00060 double re = 0.05; 00061 00062 if((proc%10)==3){ 00063 td = 0.025; 00064 dt = 10; 00065 dp = 10; 00066 cm = 0; 00067 am = 0; 00068 } 00069 00070 const int MaxList = 20; 00071 bool InList[MaxList]; 00072 for(int j = 0; j<MaxList; j++) InList[j] = true; 00073 00074 if( ( EBeam < 100 || EBeam > 2500 ) && !IsNoVacPol ){ 00075 cerr<<"Invalid value of beam energy:"<<EBeam<<endl; 00076 exit(1); 00077 } 00078 00079 gGlobal->Set_TotalError(te); 00080 00081 gGlobal->Set_RelativeError(re); 00082 00083 gGlobal->Set_Type((proc%10)); 00084 00085 gGlobal->Set_E(EBeam); 00086 00087 gGlobal->Set_ThetaInt(ti); 00088 00089 if(0>td) 00090 gGlobal->Set_ThetaMin(at-dt/2); 00091 else 00092 gGlobal->Set_ThetaMin(td); 00093 00094 if(0>de){ 00095 if((proc%10)==0) 00096 gGlobal->Set_dE_Abs(0.015*EBeam); 00097 else 00098 gGlobal->Set_dE_Abs(0.0003*EBeam); 00099 } 00100 else 00101 gGlobal->Set_dE_Abs(de); 00102 00103 if(0>nt0){ 00104 if(proc>10) 00105 gGlobal->Set_Theta0_Rel(0.0); 00106 else 00107 gGlobal->Set_Theta0_Rel(1.5); 00108 }else 00109 gGlobal->Set_Theta0_Rel(nt0); 00110 00111 if(0<thm){ 00112 gCut->ThetaMinM(thm); 00113 gGlobal->Set_ThetaMin(thm); 00114 } 00115 00116 if(0<thp) 00117 gCut->ThetaMinP(thp); 00118 00119 gCut->CosPsi(cos(pc)); 00120 00121 gCut->DeltaTheta(dt); 00122 00123 gCut->AverageTheta(at); 00124 00125 gCut->DeltaPhi(dp); 00126 00127 gCut->PAverage(am); 00128 00129 gCut->PCross(cm); 00130 00131 gCut->EMin(em); 00132 00133 gConst->SetAlphaScale(al); 00134 00135 gConst->Print(); 00136 00137 try{ 00138 gGlobal->Init(); 00139 }catch(std::logic_error lge){ 00140 cout<<lge.what()<<endl; 00141 exit(-1); 00142 } 00143 gGlobal->Print(); 00144 00145 gCut->Init(); 00146 gCut->Print(); 00147 00148 cout<<"Cross-section statistical precision will be better than " 00149 <<gGlobal->Get_TotalError()<<" nb and " 00150 <<gGlobal->Get_RelativeError()*100<<"%"<<endl; 00151 00152 if(!IsHardPhoton) 00153 cout<<"Hard photon on big angle is not included!"<<endl; 00154 00155 if(IsNoVacPol) 00156 cout<<"Vacuum polarization is not included!"<<endl; 00157 00158 if(!IsFSR) 00159 cout<<"Final state radiation is not included!"<<endl; 00160 00161 if(proc>10) 00162 cout<<"Alpha order generation only!"<<endl; 00163 00164 cout<<flush; 00165 00166 if(gRandom) delete gRandom; 00167 gRandom = new TRandom3(); 00168 struct stat stbuf; 00169 if( stat(RandomFileName.c_str(),&stbuf) == 0 ){ 00170 cout<<"Reading random seed from file \""<<RandomFileName<<"\"."<<endl; 00171 gRandom->ReadRandom(RandomFileName.c_str()); 00172 } 00173 00174 TVCrossPart *MatrixElements; 00175 if(proc==0){ 00176 MatrixElements = new TEPCrossPart(); 00177 InList[18] = false; 00178 } 00179 else if(proc==1) 00180 MatrixElements = new TMuCrossPart(); 00181 else if(proc==2) 00182 MatrixElements = new TPiCrossPart(); 00183 else if(proc==3) 00184 MatrixElements = new TKnCrossPart(); 00185 else if(proc==10){ 00186 MatrixElements = new TEPCrossPart(); 00187 for(int j = 0; j<MaxList; j++) InList[j] = false; 00188 InList[16] = true; 00189 InList[17] = true; 00190 InList[18] = true; 00191 } 00192 else 00193 return; 00194 00195 if(IsNoVacPol) 00196 MatrixElements->SetZeroVP(); 00197 00198 if(!IsFSR) 00199 MatrixElements->SetNoFSR(); 00200 00201 gRad = new TRadCor(MatrixElements); 00202 gRad->SetNEvents(NRad); 00203 gRad->SetPartList(InList); 00204 gRad->Init(); 00205 00206 MatrixElements->SetHardPhoton(IsHardPhoton); 00207 gRad->MakeCrossSection(); 00208 if((proc%10)==2)((TPiCrossPart*)MatrixElements)->GetFormFactor()->Print(); 00209 00210 if((proc%10)==0){ 00211 pid[0] = 3; pid[1] = 2; 00212 } 00213 if((proc%10)==1){ 00214 pid[0] = 6; pid[1] = 5; 00215 } 00216 if((proc%10)==2){ 00217 pid[0] = 9; pid[1] = 8; 00218 } 00219 if((proc%10)==3){ 00220 pid[0] = 10; pid[1] = 16; 00221 } 00222 if((proc%10)==4){ 00223 pid[0] = 12; pid[1] = 11; 00224 } 00225 }
void makeevent_ | ( | double * | , | |
int * | , | |||
int & | ||||
) |
Definition at line 227 of file prime_gen_wrap.C.
References gRad, genRecEmupikp::i, TRadCor::MakeEvent(), and pid.
00227 { 00228 gRad->MakeEvent(mom, n); 00229 part[0] = pid[0]; 00230 part[1] = pid[1]; 00231 for(int i=2;i<n;i++){ 00232 part[i] = 1; 00233 } 00234 }
Definition at line 23 of file prime_gen_wrap.C.
Definition at line 22 of file prime_gen_wrap.C.
Definition at line 21 of file prime_gen_wrap.C.
Definition at line 20 of file prime_gen_wrap.C.
int pid[2] |
Definition at line 24 of file prime_gen_wrap.C.
Referenced by SimplePIDSvc::calEMCLikelihood(), EvtDecay::callBesEvtGen(), EvtOpenCharm::decay(), SimplePIDSvc::dedxCorrection(), CDChargedVisible< H >::defaultKinematicData(), DstMdcKalTrack::DstMdcKalTrack(), MucRecTrkExt::execute(), MucRecRoadFinder::execute(), KalFitAlg::execute(), EsTimeAlg::execute(), BeamParams::execute(), Mcgpj::execute(), DQASelHadron::execute(), DQASelDimu::execute(), DQASelBhabha::execute(), DQARhopi::execute(), DQAKsKpi::execute(), DQAJpsi2PPbarAlg::execute(), inclphi::execute(), incllambda::execute(), inclkstar::execute(), inclks::execute(), Rhopi::execute(), Gam4pikp::execute(), TofCheckDigi::Fill_TofTrack(), EvtFSPick::getIndex(), MdcHoughFinder::GetMcInfo(), HoughValidUpdate::GetMcInfo(), EvtTrackGen::init(), init_prime_gen_(), EvtJetSet::jetSetInit(), makeevent_(), MemorySnooper::MemorySnooper(), LocalPionSelector::operator()(), LocalKaonSelector::operator()(), RecMdcKalTrack::operator=(), SimplePIDSvc::preparePID(), EvtPythia::pythiaInit(), ExtMdcTrack::ReadTrk(), RecMdcKalTrack::RecMdcKalTrack(), EvtXsection::setBW(), EventInfo::setEventID(), T2piCrossPart::T2piCrossPart(), T3piCrossPart::T3piCrossPart(), T3piEtaCrossPart::T3piEtaCrossPart(), T4piCrossPart::T4piCrossPart(), EvtDecayTag::TagIndex(), SimplePIDSvc::tofBarrelCorrection(), SimplePIDSvc::tofEndcapCorrection(), TRhoEtaCrossPart::TRhoEtaCrossPart(), FTFinder::updateMdc(), and EvtXsection::Xsection_c().
Definition at line 32 of file prime_gen_wrap.C.