25 if (Prefix==
"" || Decfile==
"" || Mom==0. )
28 cout <<
"quickfsimana.C( <pref>, <decfile>, <mom>, <decay>, [nevt], [parms], [runST], [runnum], [mode] )\n\n";
29 cout <<
" <pref> : output file names prefix\n";
30 cout <<
" <decfile> : EvtGen decfile 'xxx.dec' or 'xxx.dec:iniRes'; DPM/FTF/BOX uses DPM/FTF generator or BOX generator instead\n";
31 cout <<
" DPM settings: DPM = inelastic only, DPM1 = inel. + elastic, DPM2 = elastic only\n";
32 cout <<
" FTF settings: FTF = inelastic only, FTF1 = inel. + elastic\n";
33 cout <<
" BOX settings: optional ranges 'p/tht/phi[min,max]' separated with colon; single number = fixed value; example: 'BOX:p[1,5]:tht[45]:phi[90,210]'\n";
34 cout <<
" <mom> : EvtGen, DPM, FTF: pbar momentum (negative values are interpreted as -E_cm); BOX generator w/o special settings: maximum particle momentum\n";
35 cout <<
" [decay] : the decay pattern to be reconstructed, e.g. 'phi -> K+ K-; D_s+ -> phi pi+'; '': only fast sim w/o reco will be run\n";
36 cout <<
" [nevt] : number of events; default = 1000\n";
38 cout <<
" [parms] : parameters for the analysis, e.g. 'mwin=0.4:mwin(phi)=0.1:emin=0.1:pmin=0.1:qamc'; 'qapart' runs PndParticleQATask: 'persist' saves PndPidCandidates\n";
39 cout <<
" [runST] : if 'true' runs Software Trigger (default: false)\n";
40 cout <<
" [runnum] : integer run number (default: 0)\n";
41 cout <<
" [mode] : arbitrary mode number (default: 0)\n\n";
42 cout <<
"Example 1 - Do reco for EvtGen events : root -l -b -q 'quickfsimana.C(\"jpsi2pi\", \"pp_jpsi2pi_jpsi_mumu.dec\", 6.23, \"J/psi -> mu+ mu-; pbp -> J/psi pi+ pi-\", 1000, \"fit4c:mwin=0.6\")'\n";
43 cout <<
"Example 2 - Particle QA for BOX gen : root -l -b -q 'quickfsimana.C(\"single_kplus\", \"BOX:type(321,1)\", 8.0, \"\", 1000, \"qapart\")'\n";
44 cout <<
"Example 3 - Run fast sim only for DPM : root -l -b -q 'quickfsimana.C(\"bkg\", \"DPM\", 6.23, \"\", 1000)'\n\n";
49 bool persist = (anadecay ==
"" && anaparms ==
"") || anaparms.Contains(
"persist");
52 bool doreco = (anadecay !=
"" || anaparms.Contains(
"nevt"));
55 bool partQA = (anaparms.Contains(
"qapart"));
56 bool mc = !(anaparms.Contains(
"!mc")) && !(anaparms.Contains(
"qamc"));
57 bool neut = !(anaparms.Contains(
"!neut"));
58 bool chrg = !(anaparms.Contains(
"!chrg"));
61 anadecay.ReplaceAll(
"#",
" ");
67 double X = (Mom*Mom-2*mp*
mp)/(2*mp);
68 Mom =
sqrt(X*X-mp*mp);
72 anadecay.ReplaceAll(
"pbp",
"pbarpSystem");
75 TLorentzVector
fIni(0,0,Mom,mp+
sqrt(Mom*Mom+mp*mp));
76 TDatabasePDG *pdg=TDatabasePDG::Instance();
77 pdg->AddParticle(
"pbarpSystem",
"pbarpSystem",
fIni.M(),kFALSE,0.1,0,
"",88888,0);
78 pdg->AddParticle(
"pbarpSystem0",
"pbarpSystem0",
fIni.M(),kFALSE,0.1,0,
"",88880,0);
79 pdg->AddParticle(
"eta_c1",
"eta_c1",4.3,kFALSE,0.02,0,
"",999441);
86 bool SwFwdSpec =
true;
89 Bool_t enableSplitoff =
true;
90 Bool_t mergeNeutrals =
true;
91 Bool_t electronBrems =
true;
92 Bool_t useEventFilter =
false;
93 Bool_t usePndEventFilter =
false;
96 TString BaseDir = gSystem->Getenv(
"VMCWORKDIR");
97 TString splitpars = BaseDir+
"/fsim/splitpars.dat";
101 TString OutputFile = TString::Format(
"%s_%d_ana.root",Prefix.Data(),
run);
102 if (persist) OutputFile = TString::Format(
"%s_%d_fsim.root",Prefix.Data(),
run);
107 Bool_t UseEvtGenDirect = kTRUE;
110 Bool_t UseBoxGenerator = kFALSE;
113 if (Decfile.BeginsWith(
"DPM") && !Decfile.EndsWith(
".dec"))
115 UseEvtGenDirect = kFALSE;
120 if (Decfile.BeginsWith(
"FTF") && !Decfile.EndsWith(
".dec"))
122 UseEvtGenDirect = kFALSE;
139 if (Decfile.BeginsWith(
"BOX") && !Decfile.EndsWith(
".dec"))
141 UseEvtGenDirect = kFALSE;
142 UseBoxGenerator = kTRUE;
147 Decfile.ReplaceAll(
"box",
"");
148 Decfile.ReplaceAll(
" ",
"");
151 while (Decfile.Contains(
":"))
153 TString curpar = Decfile(0,Decfile.Index(
":"));
154 Decfile = Decfile(Decfile.Index(
":")+1,1000);
155 curpar.ReplaceAll(
"[",
"("); curpar.ReplaceAll(
"]",
")");
157 if (curpar.BeginsWith(
"type(")) {
getRange(curpar,type,
mult); BoxType = (Int_t)type; BoxMult = (Int_t)
mult; }
158 if (curpar.BeginsWith(
"p("))
getRange(curpar,BoxMomMin,BoxMomMax);
159 if (curpar.BeginsWith(
"tht("))
getRange(curpar,BoxThtMin,BoxThtMax);
160 if (curpar.BeginsWith(
"ctht(")) {
getRange(curpar,BoxThtMin,BoxThtMax); BoxCosTht=
true;}
161 if (curpar.BeginsWith(
"phi("))
getRange(curpar,BoxPhiMin,BoxPhiMax);
165 cout <<
"BOX generator range: type["<<BoxType<<
","<<BoxMult<<
"] p["<<BoxMomMin<<
","<<BoxMomMax<<
"] tht["<<BoxThtMin<<
","<<BoxThtMax<<
"]"<<(BoxCosTht?
"*":
"")<<
" phi["<<BoxPhiMin<<
","<<BoxPhiMax<<
"]"<<endl;
175 FairRunSim *
fRun =
new FairRunSim();
176 fRun->SetOutputFile(OutputFile.Data());
177 fRun->SetGenerateRunInfo(kFALSE);
178 if (!persist) fRun->SetUserConfig(BaseDir+
"/tutorials/analysis/g3ConfigNoMC.C");
180 FairLogger::GetLogger()->SetLogToFile(kFALSE);
186 if (!usePndEventFilter) primGen->
SetVerbose(0);
188 fRun->SetGenerator(primGen);
189 fRun->SetName(
"TGeant3");
203 boxGen->
SetXYZ(0., 0., 0.);
204 primGen->AddGenerator(boxGen);
211 if (Decfile==
"DPM1") mode = 1;
212 if (Decfile==
"DPM2") mode = 2;
226 primGen->AddGenerator(Dpm);
232 bool noelastic =
true;
233 if (Decfile==
"FTF1") noelastic=
false;
235 primGen->AddGenerator(Ftf);
242 Resonance.ReplaceAll(
"pbp",
"pbarpSystem");
246 primGen->AddGenerator(EvtGen);
250 primGen->DoTracking(kFALSE);
254 fRun->SetField(fField);
265 if (usePndEventFilter)
267 cout <<
"Using FairEventFilter"<<endl;
364 fastSim->
AddDetector(
"ScSttAlone",
"thtMin=145. thtMax=159.5 ptmin=0.1 pmin=0.0 pRes=0.04 thtRes=0.006 phiRes=0.007 efficiency=0.25");
365 fastSim->
AddDetector(
"ScSttMvd",
"thtMin=20.9 thtMax=145. ptmin=0.1 pmin=0.0 pRes=0.02 thtRes=0.001 phiRes=0.001 efficiency=0.85");
366 fastSim->
AddDetector(
"ScSttMvdGem",
"thtMin=7.8 thtMax=20.9 ptmin=0.1 pmin=0.0 pRes=0.02 thtRes=0.001 phiRes=0.001 efficiency=0.85");
367 fastSim->
AddDetector(
"ScMvdGem",
"thtMin=5. thtMax=7.8 ptmin=0.1 pmin=0.0 pRes=0.03 thtRes=0.001 phiRes=0.001 efficiency=0.60");
372 fastSim->
AddDetector(
"ScSttAlone",
"thtMin=133.6 thtMax=159.5 ptmin=0.1 pmin=0.0 pRes=0.04 thtRes=0.006 phiRes=0.007 efficiency=0.25");
373 fastSim->
AddDetector(
"ScSttAlone2",
"thtMin=20.9 thtMax=133.6 ptmin=0.1 pmin=0.0 pRes=0.04 thtRes=0.006 phiRes=0.007 efficiency=0.80");
374 fastSim->
AddDetector(
"ScSttAlone3",
"thtMin=7.8 thtMax=20.9 ptmin=0.1 pmin=0.0 pRes=0.04 thtRes=0.006 phiRes=0.007 efficiency=0.25");
379 fastSim->
AddDetector(
"ScFts",
"thtMin=0. thtMax=5. ptmin=0.0 pmin=0.5 pRes=0.05 thtRes=0.002 phiRes=0.002 efficiency=0.80");
387 fastSim->
AddDetector(
"ScVtxMvd",
"thtMin=5. thtMax=145. ptmin=0.1 vtxRes=0.005 efficiency=1.");
388 fastSim->
AddDetector(
"ScVtxNoMvd",
"thtMin=0. thtMax=5. ptmin=0.0 vtxRes=0.05 efficiency=1.");
392 fastSim->
AddDetector(
"ScVtxNoMvd",
"thtMin=0. thtMax=160. ptmin=0.1 vtxRes=0.1 efficiency=1.");
399 fastSim->
AddDetector(
"EmcFwCap",
"thtMin=10.0 thtMax=22.0 Emin=0.01 dist=2.5");
400 fastSim->
AddDetector(
"EmcBwCap",
"thtMin=142.0 thtMax=160.0 Emin=0.01 dist=0.7");
406 fastSim->
AddDetector(
"EmcBarrel",
"thtMin=22.0 thtMax=142.0 Emin=0.01 barrelRadius=0.5");
411 fastSim->
AddDetector(
"EmcFS",
"thtMin=0.05 thtMax=10.0 aPar=0.013 bPar=0.0283 Emin=0.01 dist=8.2");
420 fastSim->
AddDetector(
"SttPid",
"thtMin=7.8 thtMax=159.5 ptmin=0.1 dEdxRes=0.15 efficiency=1.");
421 fastSim->
AddDetector(
"ScMdtPidBarrel",
"thtMin=10.0 thtMax=130.0 pmin=0.5 efficiency=0.95 misId=0.01");
422 fastSim->
AddDetector(
"ScEmcPidFwCap",
"thtMin=10.0 thtMax=22.0 ptmin=0.0 pmin=0.0 efficiency=1.0");
423 fastSim->
AddDetector(
"ScEmcPidBwCap",
"thtMin=142.0 thtMax=160.0 ptmin=0.0 pmin=0.0 efficiency=1.0");
428 fastSim->
AddDetector(
"MvdPid",
"thtMin=5. thtMax=133.6 ptmin=0.1 dEdxResMulti=1. efficiency=1.");
433 fastSim->
AddDetector(
"ScEmcPidBarrel",
"thtMin=22.0 thtMax=142.0 ptmin=0.2 pmin=0.0 efficiency=1.0");
438 fastSim->
AddDetector(
"DrcBarrel",
"thtMin=22.0 thtMax=140.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075");
443 fastSim->
AddDetector(
"DrcDisc",
"thtMin=5.0 thtMax=22.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075");
448 fastSim->
AddDetector(
"ScEmcPidFS",
"thtMin=0.5 thtMax=10.0 ptmin=0.0 pmin=0.5 efficiency=1.0");
449 fastSim->
AddDetector(
"Rich",
"angleXMax=5.0 angleYMax=10.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075");
450 fastSim->
AddDetector(
"ScMdtPidForward",
"thtMin=0.0 thtMax=10.0 pmin=0.5 efficiency=0.95 misId=0.01");
454 fRun->AddTask(fastSim);
464 TString triggercfg =
TString(gSystem->Getenv(
"VMCWORKDIR"))+
"/softrig/triggerlines_fsim.cfg";
467 stTask->SetFastSimDefaults();
468 stTask->SetQAEvent();
469 fRun->AddTask(stTask);
486 fRun->AddTask(scTask);
502 fRun->AddTask(partQaTask);
523 printf(
"RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
void SetThetaRange(Double32_t thetamin=0, Double32_t thetamax=90)
void WriteEvtFilterStatsToRootFile(TFile *outputFile=NULL)
Writes all relevant event filter information to the output root file.
friend F32vec4 sqrt(const F32vec4 &a)
void AndFilter(FairEvtFilter *filter)
Register a non-veto event filter using a logical AND to connect with previously defined non-veto even...
bool AddDetector(std::string name, std::string params="")
void SetXYZ(Double32_t x=0, Double32_t y=0, Double32_t z=0)
void SetPidAlgo(TString algo)
void SetFilterMaxTries(Int_t maxTries=99999)
Define the maximum number of times that this object should try to find an event which suits all event...
Bool_t AndMinPdgCodes(Int_t min, Int_t pdgCode1, Int_t pdgCode2=kInvalidPdgCode, Int_t pdgCode3=kInvalidPdgCode, Int_t pdgCode4=kInvalidPdgCode, Int_t pdgCode5=kInvalidPdgCode, Int_t pdgCode6=kInvalidPdgCode, Int_t pdgCode7=kInvalidPdgCode, Int_t pdgCode8=kInvalidPdgCode)
void SetUseFlatCov(bool v=true)
FairPrimaryGenerator * primGen
void getRange(TString par, double &min, double &max)
TString getInitialResonance(TString &fEvtGenFile)
void SetUnstable(int pdg)
Primary generator with added event filtering capabilities.
bool MergeNeutralClusters(bool merge=true, double par=0.389)
void SetInvMassFilter(TString filter, double min, double max, int mult=1)
void SetStoreTree(Bool_t store=true)
void EnableElectronBremsstrahlung(bool brems=true)
void SetDebug(Bool_t debug=0)
bool EnableSplitoffs(std::string fname="splitpars.dat")
FairBoxGenerator * boxGen
void SetVerbosity(int vb)
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)
void SetVerbose(Int_t verbose=12)
Set the level of commenting output.