FairRoot/PandaRoot
Functions
tutorials/thailand2017/quickfsimana.C File Reference

Go to the source code of this file.

Functions

void getRange (TString par, double &min, double &max)
 
TString getInitialResonance (TString &fEvtGenFile)
 
void quickfsimana (TString Prefix="", TString Decfile="", Float_t Mom=0., TString anadecay="", Int_t nEvents=1000, TString anaparms="", bool runST=false, int run=0, int runmode=0)
 

Function Documentation

TString getInitialResonance ( TString fEvtGenFile)
void getRange ( TString  par,
double &  min,
double &  max 
)
void quickfsimana ( TString  Prefix = "",
TString  Decfile = "",
Float_t  Mom = 0.,
TString  anadecay = "",
Int_t  nEvents = 1000,
TString  anaparms = "",
bool  runST = false,
int  run = 0,
int  runmode = 0 
)

Definition at line 23 of file tutorials/thailand2017/quickfsimana.C.

References PndFastSim::AddDetector(), FairFilteredPrimaryGenerator::AndFilter(), Bool_t, boxGen, ctime, Double_t, PndFastSim::EnableElectronBremsstrahlung(), PndFastSim::EnableSplitoffs(), fField, fIni, fRun, gDebug, getInitialResonance(), getRange(), PndFastSim::MergeNeutralClusters(), mode, mp, mult, nEvents, primGen, printf(), rtime, run, PndBoxGenerator::SetCosTheta(), PndBoxGenerator::SetDebug(), FairFilteredPrimaryGenerator::SetFilterMaxTries(), PndFastSim::SetInvMassFilter(), PndEvtFilterOnInvMassCounts::SetMinMaxCounts(), PndEvtFilterOnInvMassCounts::SetMinMaxInvMass(), PndEvtFilterOnInvMassCounts::SetPdgCodesToCombine(), PndBoxGenerator::SetPhiRange(), PndSimpleCombinerTask::SetPidAlgo(), PndBoxGenerator::SetPRange(), PndEvtGenDirect::SetStoreTree(), PndBoxGenerator::SetThetaRange(), PndDpmDirect::SetUnstable(), PndFastSim::SetUseFlatCov(), FairFilteredPrimaryGenerator::SetVerbose(), PndFastSim::SetVerbosity(), PndBoxGenerator::SetXYZ(), sqrt(), timer, TString, FairFilteredPrimaryGenerator::WriteEvtFilterStatsToRootFile(), and X.

24 {
25  if (Prefix=="" || Decfile=="" || Mom==0. )
26  {
27  cout << "USAGE:\n";
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";
37  //cout << " [res] : initial resonance or particle type for BOX generator (ignored when running DPM); default = 'pbarpSystem0'\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";
45  return;
46  }
47 
48  // persist fast sim output?
49  bool persist = (anadecay == "" && anaparms == "") || anaparms.Contains("persist");
50 
51  // do some reconstruction ?
52  bool doreco = (anadecay != "" || anaparms.Contains("nevt"));
53 
54  // do particle QA?
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"));
59 
60  // for submission to queue all blanks in decay string were replaced by '§'; now we replace again the other way around
61  anadecay.ReplaceAll("#"," ");
62 
63  // if Mom<0, interprete as -E_cm
64  double mp = 0.938272;
65  if (Mom<0)
66  {
67  double X = (Mom*Mom-2*mp*mp)/(2*mp);
68  Mom = sqrt(X*X-mp*mp);
69  }
70 
71  // Allow shortcut for resonance pbarpSystem
72  anadecay.ReplaceAll("pbp", "pbarpSystem");
73 
74  // Prevent generator from throwing a lot of warnings
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 
80  //-----Evaluate Detector Setup ---------------------------------------
81  bool SwMvdGem = true; // Enable MVD and GEM for central tracking in addition to STT
82  bool SwEmcBar = true; // Enable EMC barrel for calorimetry (neutral detection and PID component)
83  bool SwDrc = true; // Enable Barrel DIRC for PID
84  bool SwDsc = true; // Enable Disc DIRC for PID
85  bool SwFwdSpec = true; // Enable complete Forward Spectrometer (= Fwd Spec. EMC, Fwd Tracking, RICH, Fwd MUO)
86 
87  //----- Switches for Simulation Options ------------------------------
88  Bool_t enableSplitoff = true; // create e.-m. and hadronic split offs
89  Bool_t mergeNeutrals = true; // merge neutrals (for merged pi0s)
90  Bool_t electronBrems = true; // bremsstrahlung loss for electrons
91  Bool_t useEventFilter = false; // enable Fast Sim event filter. *** Needs configuration (see below) ***
92  Bool_t usePndEventFilter = false; // enable Panda event filter. *** Needs configuration (see below) ***
93 
94  //-----General settings-----------------------------------------------
95  TString BaseDir = gSystem->Getenv("VMCWORKDIR");
96  TString splitpars = BaseDir+"/fsim/splitpars.dat";
97  gRandom->SetSeed();
98 
99  //-----User Settings:-------------------------------------------------
100  TString OutputFile = TString::Format("%s_%d_ana.root",Prefix.Data(), run);
101  if (persist) OutputFile = TString::Format("%s_%d_fsim.root",Prefix.Data(), run);
102 
103  gDebug = 0;
104 
105  // choose your event generator
106  Bool_t UseEvtGenDirect = kTRUE;
107  Bool_t UseFtf = kFALSE;
108  Bool_t UseDpm = kFALSE;
109  Bool_t UseBoxGenerator = kFALSE;
110 
111  // use DPM generator; default: inelastic @ pbarmom = mom
112  if (Decfile.BeginsWith("DPM") && !Decfile.EndsWith(".dec"))
113  {
114  UseEvtGenDirect = kFALSE;
115  UseDpm = kTRUE;
116  }
117 
118  // use FTF generator;
119  if (Decfile.BeginsWith("FTF") && !Decfile.EndsWith(".dec"))
120  {
121  UseEvtGenDirect = kFALSE;
122  UseFtf = kTRUE;
123  }
124 
125  // use BOX generator; defaults
126  Double_t BoxMomMin = 0.05; // minimum momentum for box generator
127  Double_t BoxMomMax = Mom; // maximum " "
128  Double_t BoxThtMin = 0. ; // minimum theta for box generator
129  Double_t BoxThtMax = 180.; // maximum " "
130  Double_t BoxPhiMin = 0. ; // minimum phi for box generator
131  Double_t BoxPhiMax = 360.; // maximum " "
132  Bool_t BoxCosTht = false; // isotropic in cos(theta) instead theta
133 
134  Int_t BoxType = 13; // default particle muon
135  Int_t BoxMult = 1; // default particle multiplicity
136  Double_t type=0,mult=0; // ref. parameters for range function
137 
138  if (Decfile.BeginsWith("BOX") && !Decfile.EndsWith(".dec"))
139  {
140  UseEvtGenDirect = kFALSE;
141  UseBoxGenerator = kTRUE;
142  Decfile.ToLower();
143 
144  if (Decfile!="box")
145  {
146  Decfile.ReplaceAll("box","");
147  Decfile.ReplaceAll(" ","");
148  Decfile += ":";
149 
150  while (Decfile.Contains(":"))
151  {
152  TString curpar = Decfile(0,Decfile.Index(":"));
153  Decfile = Decfile(Decfile.Index(":")+1,1000);
154  curpar.ReplaceAll("[","("); curpar.ReplaceAll("]",")");
155 
156  if (curpar.BeginsWith("type(")) {getRange(curpar,type,mult); BoxType = (Int_t)type; BoxMult = (Int_t)mult; }
157  if (curpar.BeginsWith("p(")) getRange(curpar,BoxMomMin,BoxMomMax);
158  if (curpar.BeginsWith("tht(")) getRange(curpar,BoxThtMin,BoxThtMax);
159  if (curpar.BeginsWith("ctht(")) {getRange(curpar,BoxThtMin,BoxThtMax); BoxCosTht=true;}
160  if (curpar.BeginsWith("phi(")) getRange(curpar,BoxPhiMin,BoxPhiMax);
161  }
162  }
163 
164  cout <<"BOX generator range: type["<<BoxType<<","<<BoxMult<<"] p["<<BoxMomMin<<","<<BoxMomMax<<"] tht["<<BoxThtMin<<","<<BoxThtMax<<"]"<<(BoxCosTht?"*":"")<<" phi["<<BoxPhiMin<<","<<BoxPhiMax<<"]"<<endl;
165  }
166 
167 
168  // Start a stop watch
169  TStopwatch timer;
170  timer.Start();
171 
172  // Create the Simulation run manager
173  // --------------------------------
174  FairRunSim *fRun = new FairRunSim();
175  fRun->SetOutputFile(OutputFile.Data());
176  fRun->SetGenerateRunInfo(kFALSE);
177  if (!persist) fRun->SetUserConfig(BaseDir+"/tutorials/analysis/g3ConfigNoMC.C");
178 
179  FairLogger::GetLogger()->SetLogToFile(kFALSE);
180 
181 
182  // Create and Set Event Generator
183  // -------------------------------
185  if (!usePndEventFilter) primGen->SetVerbose(0);
186  //FairPrimaryGenerator* primGen = new FairPrimaryGenerator();
187  fRun->SetGenerator(primGen);
188  fRun->SetName("TGeant3");
189 
190  // Box Generator
191  if(UseBoxGenerator)
192  {
193  PndBoxGenerator* boxGen = new PndBoxGenerator(BoxType, BoxMult);
194  boxGen->SetDebug(0);
195 
196  boxGen->SetPRange(BoxMomMin,BoxMomMax); // GeV/c
197  boxGen->SetPhiRange(BoxPhiMin, BoxPhiMax); // Azimuth angle range [degree]
198  boxGen->SetThetaRange(BoxThtMin, BoxThtMax); // Polar angle in lab system range [degree]
199 
200  if (BoxCosTht) boxGen->SetCosTheta();
201 
202  boxGen->SetXYZ(0., 0., 0.); //cm
203  primGen->AddGenerator(boxGen);
204  }
205 
206  // DPM Generator
207  if(UseDpm)
208  {
209  int mode = 0;
210  if (Decfile=="DPM1") mode = 1;
211  if (Decfile=="DPM2") mode = 2;
212 
213  PndDpmDirect *Dpm= new PndDpmDirect(Mom,mode); // 0 = inelastic, 1 = inelastic & elastic, 2 = elastic
214  // since fastsim doesn't have a transport, let all long-living resonances decay by the generator
215  Dpm->SetUnstable(111); // pi0
216  Dpm->SetUnstable(310); // K_S0
217  Dpm->SetUnstable(311); // K0
218  Dpm->SetUnstable(-311); // K0bar
219  Dpm->SetUnstable(3122); // Lambda0
220  Dpm->SetUnstable(-3122); // anti-Lambda0
221  Dpm->SetUnstable(221); // eta*/
222  Dpm->SetUnstable(3222); // Sigma+
223  Dpm->SetUnstable(-3222); // anti-Sigma-
224  Dpm->SetUnstable(3334); // Omega-
225  primGen->AddGenerator(Dpm);
226  }
227 
228  // FTF Generator
229  if(UseFtf)
230  {
231  bool noelastic = true;
232  if (Decfile=="FTF1") noelastic=false;
233  PndFtfDirect *Ftf = new PndFtfDirect("anti_proton", "G4_H", 1, "ftfp", Mom, 0, noelastic);
234  primGen->AddGenerator(Ftf);
235  }
236 
237  // EvtGen Generator
238  if(UseEvtGenDirect)
239  {
240  TString Resonance=getInitialResonance(Decfile);
241  Resonance.ReplaceAll("pbp","pbarpSystem");
242 
243  PndEvtGenDirect *EvtGen = new PndEvtGenDirect(Resonance, Decfile.Data(), Mom);
244  EvtGen->SetStoreTree(kTRUE);
245  primGen->AddGenerator(EvtGen);
246  }
247 
248  // ------------- switch off the transport of particles
249  primGen->DoTracking(kFALSE);
250 
251  //---------------------Create and Set the Field(s)----------
252  PndMultiField *fField= new PndMultiField("AUTO");
253  fRun->SetField(fField);
254 
255  // Setup the Fast Simulation Task
256  //-----------------------------
257  PndFastSim* fastSim = new PndFastSim(persist);
258 
259  // increasing verbosity increases the amount of console output (mainly for debugging)
260  fastSim->SetVerbosity(0);
261 
262  // set PANDA event filters
263  //-----------------------------
264  if (usePndEventFilter)
265  {
266  cout <<"Using FairEventFilter"<<endl;
267  primGen->SetFilterMaxTries(100000);
268 
269  //FairEvtFilterOnSingleParticleCounts* chrgFilter = new FairEvtFilterOnSingleParticleCounts("chrgFilter");
270  //chrgFilter->AndMinCharge(4, FairEvtFilter::kCharged);
271  //primGen->AndFilter(chrgFilter);
272 
273  //FairEvtFilterOnCounts* neutFilter = new FairEvtFilterOnCounts("neutFilter");
274  //neutFilter->AndMaxCharge(4, FairEvtFilter::kNeutral);
275  //primGen->AndFilter(neutFilter);
276 
277  PndEvtFilterOnInvMassCounts* eeInv= new PndEvtFilterOnInvMassCounts("eeInvMFilter");
278  //eeInv->SetVerbose();//highest commenting level of the FairEvtFilterOnCounts
279  eeInv->SetPdgCodesToCombine( 13, -13);
280  eeInv->SetMinMaxInvMass( 2.5, 3.3 );
281  eeInv->SetMinMaxCounts(1,10000);
282  primGen->AndFilter(eeInv); //add filter to fFilterList
283  }
284 
285  // set event filters
286  //-----------------------------
287  if (useEventFilter)
288  {
289  // Filters are:
290  // -----------
291  // fastSim->SetMultFilter(type, min, max);
292  // requires min <= mult <= max
293 
294  // available types are:
295 
296  // "+" : positive charged particles
297  // "-" : negative charged particles
298  // "gam" : gammas
299  // "pi0" : pi0 candidates ( -> 2 gammas); mass window 0.135 +- 0.03 GeV
300  // "eta" : eta candidates ( -> 2 gammas); mass window 0.547 +- 0.04 GeV
301  // "ks" : K_S candidates ( -> pi+ pi-); mass window 0.497 +- 0.04 GeV
302 
303  //fastSim->SetMultFilter("ks", 1,1000); // at least 1 KS
304 
305 // fastSim->SetMultFilter("+", 2,1000); // at least 2 trk+
306 // fastSim->SetMultFilter("-", 2,1000); // at least 2 trk-
307 // fastSim->SetMultFilter("gam", 0, 4); // at most 4 gammas
308 
309  // fastSim->SetInvMassFilter(comb, m_min, m_max, mult);
310 
311  // requires at least mult combined candidates with m_min < m < m_max
312 
313  // comb is a TString describing the combinatoric
314  // - particle codes are: e+ e- mu+ mu- pi+ pi- k+ k- p+ p- gam pi0 ks eta
315  // - codes must be separated with a single blank
316  // - for charged final states only the mass is set; no pdg code selection is done!
317  // - optional a 'cc' added at the end of also takes into account charge conjugation
318 
319  // Examples:
320  // - ("k+ k-", 0.98, 1.1, 2) : forms K+ K- candidate and requires >=2 in the given window
321  // - ("ks k+ pi- cc", 2.8, 3.2,1 ) : forms ks k+ pi- / ks k- pi+ cands and req. at least one in window
322 
323  fastSim->SetInvMassFilter("mu+ mu-",2.5,3.3,1); // look for J/psi -> e+ e- candidate
324  }
325 
326  // enable the merging of neutrals if they have similar direction
327  //-----------------------------
328  fastSim->MergeNeutralClusters(mergeNeutrals);
329 
330  // enable bremsstahlung loss for electrons
331  //-----------------------------
332  fastSim->EnableElectronBremsstrahlung(electronBrems);
333 
334  //enable the producting of parametrized neutral (hadronic) split offs
335  // generate electro-magnetic / hadronic split offs in the EMC? switch off when running w/o EMC
336 
337  if (enableSplitoff)
338  fastSim->EnableSplitoffs(splitpars.Data());
339 
340  fastSim->SetUseFlatCov(true);
341  // -----------------------------------------------------------------------------------
342  //Tracking: Set up in parts of theta coverage. All modelled by PndFsmSimpleTracker.
343  // Mind: Numbers on resolution (pRes,thtRes,phiRes) and efficiency are guessed
344  // -----------------------------------------------------------------------------------
345  if (SwMvdGem) // MVD and GEM are enabled; combined tracking available
346  {
347  // - (Full Panda Tracking: STT MVD GEM FTS)
348 
349  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");
350  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");
351  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");
352  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");
353  }
354  else // MVD and GEM are disabled; only STT tracking in central region
355  {
356  // - STT alone:
357  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");
358  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");
359  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");
360  }
361 
362  if (SwFwdSpec) // Fwd spectrometer enabled -> use Fwd tracking system
363  {
364  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");
365  }
366 
367  // -----------------------------------------------------------------------------------
368  // Vertexing
369  // -----------------------------------------------------------------------------------
370  if (SwMvdGem) // MVD and GEM are enabled -> better vertexing in central region
371  {
372  fastSim->AddDetector("ScVtxMvd", "thtMin=5. thtMax=145. ptmin=0.1 vtxRes=0.005 efficiency=1."); // efficiency=1: all tracks found in trackers will get a vertex information
373  fastSim->AddDetector("ScVtxNoMvd", "thtMin=0. thtMax=5. ptmin=0.0 vtxRes=0.05 efficiency=1."); // efficiency=1: all tracks found in trackers will get a vertex information
374  }
375  else // MVD and GEM are disabled -> no good vertexing at all
376  {
377  fastSim->AddDetector("ScVtxNoMvd", "thtMin=0. thtMax=160. ptmin=0.1 vtxRes=0.1 efficiency=1."); // efficiency=1: all tracks found in trackers will get a vertex information
378  }
379  // -----------------------------------------------------------------------------------
380  // EM Calorimeters w/ default parameters
381  // (don't have to be set, just to list the available parameters
382  // -----------------------------------------------------------------------------------
383 
384  fastSim->AddDetector("EmcFwCap", "thtMin=10.0 thtMax=22.0 Emin=0.01 dist=2.5");
385  fastSim->AddDetector("EmcBwCap", "thtMin=142.0 thtMax=160.0 Emin=0.01 dist=0.7");
386 
387  if (SwEmcBar)
388  {
389  // EmcBarrel also allows to set phiMin and phiMax and can be added multiple times as EmcBarrel1, EmcBarrel2, etc.
390  // Should be made constistent with EmcPidBarrel below
391  fastSim->AddDetector("EmcBarrel","thtMin=22.0 thtMax=142.0 Emin=0.01 barrelRadius=0.5");
392  }
393 
394  if (SwFwdSpec) // Fwd spectrometer enabled -> use Fwd EMC
395  {
396  fastSim->AddDetector("EmcFS", "thtMin=0.05 thtMax=10.0 aPar=0.013 bPar=0.0283 Emin=0.01 dist=8.2");
397  }
398 
399  // -----------------------------------------------------------------------------------
400  // PID
401  // -----------------------------------------------------------------------------------
402 
403  // PID detectors being always in: STT, MUO Barrel, EMC FwdCap, EMC BwdCap
404  //Note: A dEdX parametrization from 2008
405  fastSim->AddDetector("SttPid","thtMin=7.8 thtMax=159.5 ptmin=0.1 dEdxRes=0.15 efficiency=1.");
406  fastSim->AddDetector("ScMdtPidBarrel", "thtMin=10.0 thtMax=130.0 pmin=0.5 efficiency=0.95 misId=0.01");
407  fastSim->AddDetector("ScEmcPidFwCap", "thtMin=10.0 thtMax=22.0 ptmin=0.0 pmin=0.0 efficiency=1.0");
408  fastSim->AddDetector("ScEmcPidBwCap", "thtMin=142.0 thtMax=160.0 ptmin=0.0 pmin=0.0 efficiency=1.0");
409 
410  if (SwMvdGem) // MVD and GEM are enabled -> MVD PID available
411  {
412  //Note: A Bethe-Bloch-Landau-Gauss Prametrization from 2008
413  fastSim->AddDetector("MvdPid","thtMin=5. thtMax=133.6 ptmin=0.1 dEdxResMulti=1. efficiency=1.");
414  }
415 
416  if (SwEmcBar) // EMC Barrel enable -> EMC barrel PID available
417  {
418  fastSim->AddDetector("ScEmcPidBarrel", "thtMin=22.0 thtMax=142.0 ptmin=0.2 pmin=0.0 efficiency=1.0");
419  }
420 
421  if (SwDrc) // Barrel DIRC enabled
422  {
423  fastSim->AddDetector("DrcBarrel","thtMin=22.0 thtMax=140.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075");
424  }
425 
426  if (SwDsc) // Disc DIRC enabled
427  {
428  fastSim->AddDetector("DrcDisc","thtMin=5.0 thtMax=22.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075");
429  }
430 
431  if (SwFwdSpec) // Fwd spectrometer enabled -> use RICH, FwdMUO and EMC FS
432  {
433  fastSim->AddDetector("ScEmcPidFS", "thtMin=0.5 thtMax=10.0 ptmin=0.0 pmin=0.5 efficiency=1.0");
434  fastSim->AddDetector("Rich","angleXMax=5.0 angleYMax=10.0 dthtc=0.01 nPhotMin=5 effNPhotons=0.075");
435  fastSim->AddDetector("ScMdtPidForward","thtMin=0.0 thtMax=10.0 pmin=0.5 efficiency=0.95 misId=0.01");
436  }
437 
438 
439  fRun->AddTask(fastSim);
440 
441 
442  // ***********************
443  // *** SoftTriggerTask ***
444  // ***********************
445 
446  if (runST)
447  {
448  // this file contains the trigger line definitions
449  TString triggercfg = TString(gSystem->Getenv("VMCWORKDIR"))+"/softrig/triggerlines_fsim.cfg";
450 
451  PndSoftTriggerTask *stTask = new PndSoftTriggerTask(Mom, 0, 0, triggercfg);
452  stTask->SetFastSimDefaults();
453  stTask->SetQAEvent();
454  fRun->AddTask(stTask);
455  }
456 
457  // ***********************
458  // *** SoftTriggerTask ***
459  // ***********************
460 
461 
462 
463  // *****************************
464  // *** PndSimpleCombinerTask ***
465  // *****************************
466 
467  if (doreco)
468  {
469  PndSimpleCombinerTask *scTask = new PndSimpleCombinerTask(anadecay, anaparms+":algo=PidChargedProbability",Mom, run, runmode);
470  scTask->SetPidAlgo("PidChargedProbability");
471  fRun->AddTask(scTask);
472  }
473 
474  // *****************************
475  // *** PndSimpleCombinerTask ***
476  // *****************************
477 
478 
479 
480  // *****************************
481  // *** PndParticleQATask ***
482  // *****************************
483 
484  if (partQA)
485  {
486  PndParticleQATask *partQaTask = new PndParticleQATask(kTRUE,chrg,neut,mc); // particle QA task for FastSim
487  fRun->AddTask(partQaTask);
488  }
489 
490  // *****************************
491  // *** PndParticleQATask ***
492  // *****************************
493 
494 
495  //------------------------- Initialize the RUN -----------------
496  fRun->Init();
497 
498  //------------------------- Run the Simulation -----------------
499  fRun->Run(nEvents);
500 
501  //------------------------- Write Filter Info to File -----------
502  if (usePndEventFilter) primGen->WriteEvtFilterStatsToRootFile();
503 
504  //------------------------Print some info and exit----------------
505  timer.Stop();
506  Double_t rtime = timer.RealTime();
507  Double_t ctime = timer.CpuTime();
508  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
509 }
PndMultiField * fField
Definition: sim_emc_apd.C:97
Bool_t SetMinMaxCounts(Int_t min, Int_t max)
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
void SetThetaRange(Double32_t thetamin=0, Double32_t thetamax=90)
Int_t run
Definition: autocutx.C:47
void WriteEvtFilterStatsToRootFile(TFile *outputFile=NULL)
Writes all relevant event filter information to the output root file.
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
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="")
Definition: PndFastSim.cxx:313
void SetXYZ(Double32_t x=0, Double32_t y=0, Double32_t z=0)
void SetPidAlgo(TString algo)
TString getInitialResonance(TString &fEvtGenFile)
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...
void getRange(TString par, double &min, double &max)
static const double mp
Definition: mzparameters.h:11
void SetUseFlatCov(bool v=true)
Definition: PndFastSim.h:64
FairPrimaryGenerator * primGen
Definition: sim_emc_apd.C:81
Bool_t SetMinMaxInvMass(Double_t min, Double_t max)
FairRunAna * fRun
Definition: hit_dirc.C:58
Int_t mode
Definition: autocutx.C:47
void SetUnstable(int pdg)
Primary generator with added event filtering capabilities.
bool MergeNeutralClusters(bool merge=true, double par=0.389)
Definition: PndFastSim.h:61
void SetInvMassFilter(TString filter, double min, double max, int mult=1)
Definition: PndFastSim.cxx:373
void SetStoreTree(Bool_t store=true)
Double_t
void EnableElectronBremsstrahlung(bool brems=true)
Definition: PndFastSim.h:62
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
gDebug
Definition: sim_emc_apd.C:6
void SetDebug(Bool_t debug=0)
bool EnableSplitoffs(std::string fname="splitpars.dat")
Definition: PndFastSim.cxx:224
Double_t ctime
Definition: hit_dirc.C:114
FairBoxGenerator * boxGen
Definition: sim_emc_apd.C:85
double X
Definition: anaLmdDigi.C:68
void SetVerbosity(int vb)
Definition: PndFastSim.h:59
Bool_t SetPdgCodesToCombine(Int_t pdgCode1, Int_t pdgCode2, Int_t pdgCode3=kInvalidPdgCode, Int_t pdgCode4=kInvalidPdgCode, Int_t pdgCode5=kInvalidPdgCode)
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
TLorentzVector fIni
Definition: full_core_ntp.C:29
Double_t rtime
Definition: hit_dirc.C:113
Double_t mult
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)
void SetVerbose(Int_t verbose=12)
Set the level of commenting output.