FairRoot/PandaRoot
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PndMasterRunSim Class Reference

Class for the master simulation chain. More...

#include <PndMasterRunSim.h>

Inheritance diagram for PndMasterRunSim:

Public Member Functions

 PndMasterRunSim ()
 Default constructor. More...
 
virtual ~PndMasterRunSim ()
 Default destructor. More...
 
Bool_t Setup (TString outprefix="")
 Initial setup. More...
 
void Finish ()
 Final diagnostics. More...
 
void CreateGeometry ()
 It switches between different standard geometry volumes. More...
 
void CreateGeometryDefault ()
 It creates all the standard geometry volumes. More...
 
void CreateGeometryPhase1 ()
 It creates the standard geometry volumes for phase1 of the experiment. More...
 
void CreateGeometryDay1 ()
 It creates the standard geometry volumes for day1 phase. More...
 
void AddSimTasks ()
 Add simulation tasks. More...
 
void SetGenerator ()
 Set the event generator. More...
 
void AddGenerator (FairGenerator *aGen)
 Add a generator to existing setup. More...
 
void SetGenerator (FairGenerator *boxGen)
 Set the event generator for FairBoxGenerator. More...
 
void SetGenerator (PndBoxGenerator *boxGen)
 Set the event generator for PndBoxGenerator. More...
 
void SetDpmFlag (Int_t Mode)
 Set the DPM flag. More...
 
void SetFtfFlag (Int_t Mode)
 Set the FTF noelastic flag. More...
 
void UseDpmGenerator ()
 Use DPM as event generator. More...
 
void UseFtfGenerator (TString ftfData)
 Use FTF as event generator. More...
 
void UseEvtGenGenerator (TString EvtGenFile)
 Use EvtGen as event generator. More...
 
void UseBoxGenerator (TString BoxConfig)
 Use BoxGen as event generator. More...
 
void UsePiPiGenerator (TString pipiConfig)
 Use PiPiGenerator as event generator. More...
 
void UseLepLepGenerator (TString leplepConfig)
 Use LepLepGenerator as event generator. More...
 
void SetInput (TString par)
 Input of the simulation This string can be: a) the name of the dec file for EvtGen, ending w/ .dec b) "dpm" if you want to use dpm c) "ftf" if you want to use ftf d) "box:[...]" if you want to use box. More...
 
void SetInputDir (TString par)
 Input directory of the simulation. More...
 
void SetParamRootFile (TString par)
 Setter of the parameter root file. More...
 
void SetParamAsciiFile (TString par)
 Setter of the parameter ascii file. More...
 
void SetOptions (TString par)
 Setter of the simulation options This string can be: "" -> default settings full setup "day1" -> Setup for day1 experiment: no GEM, FTS1234, NO DISC, NO RICH "gem2" (added to "day1") -> Setup for day1 experiment with 2 GEM planes (first two) "gem3" (added to "day1") -> Setup for day1 experiment with 3 GEM planes "fts1256" (added to "day1") -> Setup for day1 experiment with FTS1256 insted of FTS1234 "strip" (added to "day1") -> Setup for day1 experiment with only the strip part of the MVD instead of the full MVD Example: "day1+gem+fts1256" means day1 setup + GEM planes + fst1256. More...
 
TString GetOptions ()
 
void SetNumberOfEvents (Int_t par)
 Setter of the number of events. More...
 
void SetEventCounterRate (Int_t par)
 Setter of the event counter rate. More...
 
void SetTargetMode (Short_t par)
 Setter of the target mode. More...
 
FairFilteredPrimaryGeneratorGetFilteredPrimaryGenerator ()
 Getter for the primary generator, e.g. to configure the event filter. More...
 
PndFilteredPrimaryGeneratorGetPndFilteredPrimaryGenerator ()
 

Private Member Functions

void GetRange (TString par, double &min, double &max)
 

Private Attributes

TString fInput
 Name of the input for the simulation. More...
 
TString fInputDir
 Name of the input directory for the simulation. More...
 
TString fOutFile
 Name of the output file. More...
 
TString fParamRootFile
 Name of the parameter root file. More...
 
TString fParamAsciiFile
 Name of the parameter ascii file. More...
 
TString fOptions
 Options parsed to the simulation. More...
 
Int_t fDpmFlag
 Flag for DPM event generator. More...
 
Int_t fFtfFlag
 Flag for FTF event generator. More...
 
Int_t fNEvents
 Number of events. More...
 
Int_t fEventCounterRate
 After how many events the counter will print. More...
 
Short_t fTargetMode
 Target mode. More...
 
FairRuntimeDb * fRtdb
 Runtime DB. More...
 
TStopwatch fTimer
 Timer. More...
 

Detailed Description

Class for the master simulation chain.

Master Simulation Class

This class is the basic for the simulation macro. It loads the environment and all the standard detectors.

Author
Stefano Spataro spata.nosp@m.ro@t.nosp@m.o.inf.nosp@m.n.it, Torino University
Version
1.0
Date
Feb 3, 2016

Definition at line 31 of file PndMasterRunSim.h.

Constructor & Destructor Documentation

PndMasterRunSim::PndMasterRunSim ( )

Default constructor.

Definition at line 54 of file PndMasterRunSim.cxx.

References fTimer.

54  :
56 {
57  fTimer.Start();
58 }
TString fInput
Name of the input for the simulation.
Int_t fFtfFlag
Flag for FTF event generator.
Int_t fNEvents
Number of events.
Short_t fTargetMode
Target mode.
TString fOptions
Options parsed to the simulation.
Int_t fEventCounterRate
After how many events the counter will print.
TString fParamRootFile
Name of the parameter root file.
FairRuntimeDb * fRtdb
Runtime DB.
TString fOutFile
Name of the output file.
TStopwatch fTimer
Timer.
TString fInputDir
Name of the input directory for the simulation.
TString fParamAsciiFile
Name of the parameter ascii file.
Int_t fDpmFlag
Flag for DPM event generator.
PndMasterRunSim::~PndMasterRunSim ( )
virtual

Default destructor.

Definition at line 60 of file PndMasterRunSim.cxx.

References gGeoManager.

61 {
62  if (gROOT->GetVersionInt() >= 60602 && gGeoManager!=NULL) {
63  gGeoManager->GetListOfVolumes()->Delete();
64  gGeoManager->GetListOfShapes()->Delete();
65  delete gGeoManager;
66  }
67 }
TGeoManager * gGeoManager

Member Function Documentation

void PndMasterRunSim::AddGenerator ( FairGenerator *  aGen)

Add a generator to existing setup.

Adds a generator to the existing one. BOTH generators will be active

and produce their particle content in each even simultaneously.

void PndMasterRunSim::AddSimTasks ( )

Add simulation tasks.

Add Master simulation tasks

It adds all the standard simulation tasks

Definition at line 380 of file PndMasterRunSim.cxx.

References AddTask(), fEventCounterRate, fNEvents, fOptions, and sim().

Referenced by prod_sim(), sim_box(), sim_complete(), sim_complete_newSTT(), sim_day1(), sim_mvd(), sim_radlength_complete(), and tut_sim().

381 {
382  // ----- Event Counter --------------------------------
383  AddTask(new PndEventCounterTask("Event Counter", fNEvents, fEventCounterRate));
384 
386  AddTask(sim);
387 
388  return;
389 }
sim(Int_t nEvents=1, TString SimEngine="TGeant4", Float_t mom=6.231552)
Int_t fNEvents
Number of events.
The default sim tasks.
TString fOptions
Options parsed to the simulation.
Int_t fEventCounterRate
After how many events the counter will print.
fRun AddTask(drcdigi)
void PndMasterRunSim::CreateGeometry ( )

It switches between different standard geometry volumes.

Master Geometry List

According to fOptions, it creates the standard geometry volumes for the full setup, or dedicated geometries (such as day1)

Definition at line 126 of file PndMasterRunSim.cxx.

References CreateGeometryDay1(), CreateGeometryDefault(), CreateGeometryPhase1(), and fOptions.

Referenced by prod_sim(), sim_box(), sim_complete(), sim_day1(), and tut_sim().

127 {
128  if (fOptions.Contains("phase1")) CreateGeometryPhase1();
129  else if (fOptions.Contains("day1")) CreateGeometryDay1();
130  else CreateGeometryDefault();
131 }
void CreateGeometryDefault()
It creates all the standard geometry volumes.
TString fOptions
Options parsed to the simulation.
void CreateGeometryDay1()
It creates the standard geometry volumes for day1 phase.
void CreateGeometryPhase1()
It creates the standard geometry volumes for phase1 of the experiment.
void PndMasterRunSim::CreateGeometryDay1 ( )

It creates the standard geometry volumes for day1 phase.

Master Geometry List

It creates all the standard geometry volumes which have to be used in simulation, with the setup for day1 experiments. All the MCPoint will be stored, except for EMC

Definition at line 284 of file PndMasterRunSim.cxx.

References AddModule(), Cave, Dipole, Drc, Emc, fOptions, FTof, Fts, Gem, Muo, Mvd, Pipe, PndMdt::SetBarrel(), PndMdt::SetEndcap(), PndMdt::SetForward(), PndEmc::SetGeometryVersion(), PndMdt::SetMdtCoil(), PndMdt::SetMdtMagnet(), PndMdt::SetMdtMFIron(), PndMdt::SetMuonFilter(), PndDrc::SetRunCherenkov(), PndEmc::SetStorageOfData(), and Stt.

Referenced by CreateGeometry().

285 {
286  //------------------------- CAVE -----------------
287  FairModule *Cave= new PndCave("CAVE");
288  Cave->SetGeometryFileName("pndcave.geo");
289  AddModule(Cave);
290  //------------------------- Magnet -----------------
291  // This part is commented because the MDT geometry contains the magnet now
292  //FairModule *Magnet= new PndMagnet("MAGNET");
293  //Magnet->SetGeometryFileName("FullSolenoid_V842.root");
294  //Magnet->SetGeometryFileName("FullSuperconductingSolenoid_v831.root");
295  //AddModule(Magnet);
296  FairModule *Dipole= new PndMagnet("MAGNET");
297  Dipole->SetGeometryFileName("dipole.geo");
298  AddModule(Dipole);
299  //------------------------- Pipe -----------------
300  FairModule *Pipe= new PndPipe("PIPE");
301  Pipe->SetGeometryFileName("beampipe_201309.root");
302  AddModule(Pipe);
303  //------------------------- STT -----------------
304  FairDetector *Stt= new PndStt("STT", kTRUE);
305  Stt->SetGeometryFileName("straws_skewed_blocks_35cm_pipe.geo");
306  AddModule(Stt);
307  //------------------------- MVD -----------------
308  if (fOptions.Contains("strip")||fOptions.Contains("nopixels")){
309  FairDetector *Mvd = new PndMvdDetector("MVD", kTRUE);
310  Mvd->SetGeometryFileName("Mvd-2.1-Strips.root");
311  AddModule(Mvd);
312  } else {
313  FairDetector *Mvd = new PndMvdDetector("MVD", kTRUE);
314  Mvd->SetGeometryFileName("Mvd-2.1_FullVersion.root");
315  AddModule(Mvd);
316  }
317  //------------------------- EMC -----------------
318  PndEmc *Emc = new PndEmc("EMC",kTRUE);
319  Emc->SetGeometryVersion(1);
320  Emc->SetStorageOfData(kFALSE);
321  AddModule(Emc);
322  //------------------------- SCITIL -----------------
323  FairDetector *SciT = new PndSciT("SCIT",kTRUE);
324  SciT->SetGeometryFileName("SciTil_201601.root");
325  AddModule(SciT);
326  //------------------------- DRC -----------------
327  PndDrc *Drc = new PndDrc("DIRC", kTRUE);
328  Drc->SetGeometryFileName("dirc_e3_b3_l6_m40.root");
329  Drc->SetRunCherenkov(kFALSE);
330  AddModule(Drc);
331  //------------------------- MDT -----------------
332  PndMdt *Muo = new PndMdt("MDT",kTRUE);
333  Muo->SetBarrel("fast");
334  Muo->SetEndcap("fast");
335  Muo->SetMuonFilter("fast");
336  Muo->SetForward("fast");
337  Muo->SetMdtMagnet(kTRUE);
338  Muo->SetMdtCoil(kTRUE);
339  Muo->SetMdtMFIron(kTRUE);
340  AddModule(Muo);
341  //------------------------- FTOF -----------------
342  FairDetector *FTof = new PndFtof("FTOF",kTRUE);
343  FTof->SetGeometryFileName("ftofwall.root");
344  AddModule(FTof);
345 
346  if (fOptions.Contains("nogem")||fOptions.Contains("gem0")) {
347  // do nothing
348  }
349  else if (fOptions.Contains("gem3")) // GEM 3 Stations
350  {
351  FairDetector *Gem = new PndGemDetector("GEM", kTRUE);
352  Gem->SetGeometryFileName("gem_3Stations_realistic_v2.root");
353  AddModule(Gem);
354  }
355  else //GEM 2 Stations
356  {
357  //------------------------- GEM -----------------
358  FairDetector *Gem = new PndGemDetector("GEM", kTRUE);
359  Gem->SetGeometryFileName("gem_2Stations_realistic_v2.root");
360  AddModule(Gem);
361  }
362 
363  if (fOptions.Contains("fts1256"))
364  {
365  //------------------------- FTS -----------------
366  FairDetector *Fts= new PndFts("FTS", kTRUE);
367  Fts->SetGeometryFileName("fts_1256.geo");
368  AddModule(Fts);
369  }
370  else
371  {
372  //------------------------- FTS -----------------
373  FairDetector *Fts= new PndFts("FTS", kTRUE);
374  Fts->SetGeometryFileName("fts_reduced.geo");
375  AddModule(Fts);
376  }
377 }
PndDrc * Drc
Definition: sim_emc_apd.C:75
void SetForward(TString name)
Definition: PndMdt.h:34
FairDetector * FTof
Definition: sim_ftof.C:49
PndEmc * Emc
Definition: sim_emc_apd.C:55
void SetMdtCoil(bool opt=false)
Definition: PndMdt.h:28
FairDetector * Mvd
Definition: sim_emc_apd.C:51
void SetMdtMFIron(bool opt=false)
Definition: PndMdt.h:29
void SetStorageOfData(Bool_t val)
Definition: PndEmc.cxx:941
PndMdt * Muo
Definition: sim_emc_apd.C:67
Simulation of EMC.
Definition: PndEmc.h:26
TString fOptions
Options parsed to the simulation.
FairDetector * Gem
Definition: runJohan.C:71
void SetMdtMagnet(bool opt=false)
Definition: PndMdt.h:27
FairDetector * Stt
Definition: sim_emc_apd.C:47
FairModule * Dipole
Definition: sim_emc_apd.C:40
FairModule * Cave
Definition: sim_emc_apd.C:32
Definition: PndDrc.h:31
virtual void SetGeometryVersion(const Int_t GeoNumber)
Definition: PndEmc.cxx:966
void SetBarrel(TString name)
Definition: PndMdt.h:31
fRun AddModule(Cave)
void SetEndcap(TString name)
Definition: PndMdt.h:32
void SetMuonFilter(TString name)
Definition: PndMdt.h:33
void SetRunCherenkov(Bool_t ch)
Definition: PndDrc.h:222
Definition: PndStt.h:34
Definition: PndMdt.h:20
FairModule * Pipe
Definition: sim_emc_apd.C:44
FairDetector * Fts
Definition: sim_ftof_stof.C:58
Definition: PndFts.h:25
Definition: PndCave.h:8
void PndMasterRunSim::CreateGeometryDefault ( )

It creates all the standard geometry volumes.

Master Geometry List

It creates all the standard geometry volumes which have to be used in simulation. All the MCPoint will be stored, expect for EMC.

Definition at line 134 of file PndMasterRunSim.cxx.

References AddModule(), Cave, Dipole, Drc, Dsk, Emc, FTof, Fts, Gem, Muo, Mvd, Pipe, PndMdt::SetBarrel(), PndMdt::SetEndcap(), PndMdt::SetForward(), PndEmc::SetGeometryVersion(), PndMdt::SetMdtCoil(), PndMdt::SetMdtMagnet(), PndMdt::SetMdtMFIron(), PndMdt::SetMuonFilter(), PndDrc::SetRunCherenkov(), PndEmc::SetStorageOfData(), PndDsk::SetStoreCerenkovs(), PndDsk::SetStoreTrackPoints(), and Stt.

Referenced by CreateGeometry().

135 {
136  //------------------------- CAVE -----------------
137  FairModule *Cave= new PndCave("CAVE");
138  Cave->SetGeometryFileName("pndcave.geo");
139  AddModule(Cave);
140  //------------------------- Magnet -----------------
141  // This part is commented because the MDT geometry contains the magnet now
142  //FairModule *Magnet= new PndMagnet("MAGNET");
143  //Magnet->SetGeometryFileName("FullSolenoid_V842.root");
144  //Magnet->SetGeometryFileName("FullSuperconductingSolenoid_v831.root");
145  //AddModule(Magnet);
146  FairModule *Dipole= new PndMagnet("MAGNET");
147  Dipole->SetGeometryFileName("dipole.geo");
148  AddModule(Dipole);
149  //------------------------- Pipe -----------------
150  FairModule *Pipe= new PndPipe("PIPE");
151  Pipe->SetGeometryFileName("beampipe_201309.root");
152  AddModule(Pipe);
153  //------------------------- STT -----------------
154  FairDetector *Stt= new PndStt("STT", kTRUE);
155  Stt->SetGeometryFileName("straws_skewed_blocks_35cm_pipe.geo");
156  AddModule(Stt);
157  //------------------------- MVD -----------------
158  FairDetector *Mvd = new PndMvdDetector("MVD", kTRUE);
159  Mvd->SetGeometryFileName("Mvd-2.1_FullVersion.root");
160  AddModule(Mvd);
161  //------------------------- GEM -----------------
162  FairDetector *Gem = new PndGemDetector("GEM", kTRUE);
163  Gem->SetGeometryFileName("gem_3Stations_realistic_v2.root");
164  AddModule(Gem);
165  //------------------------- EMC -----------------
166  PndEmc *Emc = new PndEmc("EMC",kTRUE);
167  Emc->SetGeometryVersion(1);
168  Emc->SetStorageOfData(kFALSE);
169  AddModule(Emc);
170  //------------------------- SCITIL -----------------
171  FairDetector *SciT = new PndSciT("SCIT",kTRUE);
172  SciT->SetGeometryFileName("SciTil_201601.root");
173  AddModule(SciT);
174  //------------------------- DRC -----------------
175  PndDrc *Drc = new PndDrc("DIRC", kTRUE);
176  Drc->SetGeometryFileName("dirc_e3_b3_l6_m40.root");
177  Drc->SetRunCherenkov(kFALSE);
178  AddModule(Drc);
179  //------------------------- DISC -----------------
180  PndDsk* Dsk = new PndDsk("DSK", kTRUE);
181  Dsk->SetStoreCerenkovs(kFALSE);
182  Dsk->SetStoreTrackPoints(kFALSE);
183  AddModule(Dsk);
184  //------------------------- MDT -----------------
185  PndMdt *Muo = new PndMdt("MDT",kTRUE);
186  Muo->SetBarrel("fast");
187  Muo->SetEndcap("fast");
188  Muo->SetMuonFilter("fast");
189  Muo->SetForward("fast");
190  Muo->SetMdtMagnet(kTRUE);
191  Muo->SetMdtCoil(kTRUE);
192  Muo->SetMdtMFIron(kTRUE);
193  AddModule(Muo);
194  //------------------------- FTS -----------------
195  FairDetector *Fts= new PndFts("FTS", kTRUE);
196  Fts->SetGeometryFileName("fts.geo");
197  AddModule(Fts);
198  //------------------------- FTOF -----------------
199  FairDetector *FTof = new PndFtof("FTOF",kTRUE);
200  FTof->SetGeometryFileName("ftofwall.root");
201  AddModule(FTof);
202  //------------------------- RICH ----------------
203  PndRich *Rich= new PndRich("RICH",kTRUE);
204  Rich->SetGeometryFileName("rich_v313.root");
205  AddModule(Rich);
206 }
PndDrc * Drc
Definition: sim_emc_apd.C:75
void SetForward(TString name)
Definition: PndMdt.h:34
FairDetector * FTof
Definition: sim_ftof.C:49
PndEmc * Emc
Definition: sim_emc_apd.C:55
void SetMdtCoil(bool opt=false)
Definition: PndMdt.h:28
FairDetector * Mvd
Definition: sim_emc_apd.C:51
void SetMdtMFIron(bool opt=false)
Definition: PndMdt.h:29
void SetStorageOfData(Bool_t val)
Definition: PndEmc.cxx:941
PndMdt * Muo
Definition: sim_emc_apd.C:67
Simulation of EMC.
Definition: PndEmc.h:26
FairDetector * Dsk
Definition: run_DpmSim.C:66
FairDetector * Gem
Definition: runJohan.C:71
void SetMdtMagnet(bool opt=false)
Definition: PndMdt.h:27
void SetStoreTrackPoints(Bool_t storeTrackPoints)
Definition: PndDsk.h:148
FairDetector * Stt
Definition: sim_emc_apd.C:47
void SetStoreCerenkovs(Bool_t storeCerenkovs)
Definition: PndDsk.h:146
FairModule * Dipole
Definition: sim_emc_apd.C:40
FairModule * Cave
Definition: sim_emc_apd.C:32
Definition: PndDrc.h:31
virtual void SetGeometryVersion(const Int_t GeoNumber)
Definition: PndEmc.cxx:966
void SetBarrel(TString name)
Definition: PndMdt.h:31
fRun AddModule(Cave)
void SetEndcap(TString name)
Definition: PndMdt.h:32
void SetMuonFilter(TString name)
Definition: PndMdt.h:33
void SetRunCherenkov(Bool_t ch)
Definition: PndDrc.h:222
Definition: PndStt.h:34
Definition: PndMdt.h:20
FairModule * Pipe
Definition: sim_emc_apd.C:44
FairDetector * Fts
Definition: sim_ftof_stof.C:58
Definition: PndDsk.h:23
Definition: PndFts.h:25
Definition: PndCave.h:8
void PndMasterRunSim::CreateGeometryPhase1 ( )

It creates the standard geometry volumes for phase1 of the experiment.

Master Geometry List

It creates all the standard geometry volumes which have to be used in simulation, with the setup for phase1 experiments. All the MCPoint will be stored, except for EMC

Definition at line 209 of file PndMasterRunSim.cxx.

References AddModule(), Cave, Dipole, Drc, Emc, FTof, Fts, Gem, Muo, Mvd, Pipe, PndMdt::SetBarrel(), PndMdt::SetEndcap(), PndMdt::SetForward(), PndEmc::SetGeometryVersion(), PndMdt::SetMdtCoil(), PndMdt::SetMdtMagnet(), PndMdt::SetMdtMFIron(), PndMdt::SetMuonFilter(), PndDrc::SetRunCherenkov(), PndEmc::SetStorageOfData(), and Stt.

Referenced by CreateGeometry().

210 {
211  //------------------------- CAVE -----------------
212  FairModule *Cave= new PndCave("CAVE");
213  Cave->SetGeometryFileName("pndcave.geo");
214  AddModule(Cave);
215  //------------------------- Magnet -----------------
216  // This part is commented because the MDT geometry contains the magnet now
217  //FairModule *Magnet= new PndMagnet("MAGNET");
218  //Magnet->SetGeometryFileName("FullSolenoid_V842.root");
219  //Magnet->SetGeometryFileName("FullSuperconductingSolenoid_v831.root");
220  //AddModule(Magnet);
221  FairModule *Dipole= new PndMagnet("MAGNET");
222  Dipole->SetGeometryFileName("dipole.geo");
223  AddModule(Dipole);
224  //------------------------- Pipe -----------------
225  FairModule *Pipe= new PndPipe("PIPE");
226  Pipe->SetGeometryFileName("beampipe_201309.root");
227  AddModule(Pipe);
228  //------------------------- STT -----------------
229  FairDetector *Stt= new PndStt("STT", kTRUE);
230  Stt->SetGeometryFileName("straws_skewed_blocks_35cm_pipe.geo");
231  AddModule(Stt);
232  //------------------------- MVD -----------------
233  FairDetector *Mvd = new PndMvdDetector("MVD", kTRUE);
234  Mvd->SetGeometryFileName("Mvd-2.1_FullVersion.root");
235  AddModule(Mvd);
236  //------------------------- GEM -----------------
237  FairDetector *Gem = new PndGemDetector("GEM", kTRUE);
238  Gem->SetGeometryFileName("gem_3Stations_realistic_v2.root");
239  AddModule(Gem);
240  //------------------------- EMC -----------------
241  PndEmc *Emc = new PndEmc("EMC",kTRUE);
242  Emc->SetGeometryVersion(1);
243  Emc->SetStorageOfData(kFALSE);
244  AddModule(Emc);
245  //------------------------- SCITIL -----------------
246  FairDetector *SciT = new PndSciT("SCIT",kTRUE);
247  SciT->SetGeometryFileName("SciTil_201601.root");
248  AddModule(SciT);
249  //------------------------- DRC -----------------
250  PndDrc *Drc = new PndDrc("DIRC", kTRUE);
251  Drc->SetGeometryFileName("dirc_e3_b3_l6_m40.root");
252  Drc->SetRunCherenkov(kFALSE);
253  AddModule(Drc);
254  //------------------------- DISC -----------------
255  //PndDsk* Dsk = new PndDsk("DSK", kTRUE);
256  //Dsk->SetStoreCerenkovs(kFALSE);
257  //Dsk->SetStoreTrackPoints(kFALSE);
258  //AddModule(Dsk);
259  //------------------------- MDT -----------------
260  PndMdt *Muo = new PndMdt("MDT",kTRUE);
261  Muo->SetBarrel("fast");
262  Muo->SetEndcap("fast");
263  Muo->SetMuonFilter("fast");
264  Muo->SetForward("fast");
265  Muo->SetMdtMagnet(kTRUE);
266  Muo->SetMdtCoil(kTRUE);
267  Muo->SetMdtMFIron(kTRUE);
268  AddModule(Muo);
269  //------------------------- FTS -----------------
270  FairDetector *Fts= new PndFts("FTS", kTRUE);
271  Fts->SetGeometryFileName("fts.geo");
272  AddModule(Fts);
273  //------------------------- FTOF -----------------
274  FairDetector *FTof = new PndFtof("FTOF",kTRUE);
275  FTof->SetGeometryFileName("ftofwall.root");
276  AddModule(FTof);
277  //------------------------- RICH ----------------
278  //PndRich *Rich= new PndRich("RICH",kTRUE);
279  //Rich->SetGeometryFileName("rich_v313.root");
280  //AddModule(Rich);
281 }
PndDrc * Drc
Definition: sim_emc_apd.C:75
void SetForward(TString name)
Definition: PndMdt.h:34
FairDetector * FTof
Definition: sim_ftof.C:49
PndEmc * Emc
Definition: sim_emc_apd.C:55
void SetMdtCoil(bool opt=false)
Definition: PndMdt.h:28
FairDetector * Mvd
Definition: sim_emc_apd.C:51
void SetMdtMFIron(bool opt=false)
Definition: PndMdt.h:29
void SetStorageOfData(Bool_t val)
Definition: PndEmc.cxx:941
PndMdt * Muo
Definition: sim_emc_apd.C:67
Simulation of EMC.
Definition: PndEmc.h:26
FairDetector * Gem
Definition: runJohan.C:71
void SetMdtMagnet(bool opt=false)
Definition: PndMdt.h:27
FairDetector * Stt
Definition: sim_emc_apd.C:47
FairModule * Dipole
Definition: sim_emc_apd.C:40
FairModule * Cave
Definition: sim_emc_apd.C:32
Definition: PndDrc.h:31
virtual void SetGeometryVersion(const Int_t GeoNumber)
Definition: PndEmc.cxx:966
void SetBarrel(TString name)
Definition: PndMdt.h:31
fRun AddModule(Cave)
void SetEndcap(TString name)
Definition: PndMdt.h:32
void SetMuonFilter(TString name)
Definition: PndMdt.h:33
void SetRunCherenkov(Bool_t ch)
Definition: PndDrc.h:222
Definition: PndStt.h:34
Definition: PndMdt.h:20
FairModule * Pipe
Definition: sim_emc_apd.C:44
FairDetector * Fts
Definition: sim_ftof_stof.C:58
Definition: PndFts.h:25
Definition: PndCave.h:8
void PndMasterRunSim::Finish ( )

Final diagnostics.

Master Final diagnostics

It prints CPU time, memory usage, used parameters, and eventually send the information to CDash

Definition at line 728 of file PndMasterRunSim.cxx.

References ctime, Double_t, fOptions, fOutFile, fParamAsciiFile, fParamRootFile, fRtdb, fTimer, gGeoManager, outfile, and rtime.

Referenced by prod_sim(), sim_complete(), sim_complete_newSTT(), sim_day1(), sim_mvd(), sim_radlength_complete(), and tut_sim().

729 {
730  fRtdb->saveOutput();
731 
732  cout<<"PndMasterRunAna::Finish(): Tasks that ran just now:"<<endl;
733  TFile* outfile=fRootManager->GetOutFile();
734  bool wasopen=outfile->IsOpen ();
735  if (!wasopen)
736  {
737  cout<<"file is "<< ((wasopen) ? "" : "not " ) <<"open" <<endl;
738  outfile=new TFile(outfile->GetName(),"UPDATE");
739  }
740  outfile->cd();
741 
742  // write the summary of event filter to output root file
743  if (!strcmp(fGen->ClassName(),"PndFilteredPrimaryGenerator"))
744  ((PndFilteredPrimaryGenerator*)fGen)->WriteEvtFilterStatsToRootFile(outfile);
745  else
746  ((FairFilteredPrimaryGenerator*)fGen)->WriteEvtFilterStatsToRootFile(outfile);
747 
748  FairFileHeader* outheader=(FairFileHeader*)outfile->Get("FileHeader");
749  cout<<"Task tha ran just now:"<<endl;
750  for(const auto&& os : *(outheader->GetListOfTasks()) ) cout<<" - "<<((TObjString*)os)->GetString().Data()<<endl;
751 
752  TObjString outoptions(fOptions);
753  outoptions.Write("PndOptions",kOverwrite);
754 
755  outfile->Write();
756  if(!wasopen) outfile->Close();
757 
758  cout << endl;
759  if (gROOT->GetVersionInt() >= 60602) {
760  gGeoManager->GetListOfVolumes()->Delete();
761  gGeoManager->GetListOfShapes()->Delete();
762  delete gGeoManager;
763  }
764 
765  // Extract the maximal used memory an add is as Dart measurement
766  // This line is filtered by CTest and the value send to CDash
767  FairSystemInfo sysInfo;
768  Float_t maxMemory=sysInfo.GetMaxMemory();
769  cout << "<DartMeasurement name=\"MaxMemory\" type=\"numeric/double\">";
770  cout << maxMemory;
771  cout << "</DartMeasurement>" << endl;
772 
773  fTimer.Stop();
774  Double_t rtime = fTimer.RealTime();
775  Double_t ctime = fTimer.CpuTime();
776 
777  Float_t cpuUsage=ctime/rtime;
778  cout << "<DartMeasurement name=\"CpuLoad\" type=\"numeric/double\">";
779  cout << cpuUsage;
780  cout << "</DartMeasurement>" << endl;
781 
782  cout << endl;
783  cout << "Output file is\t\t" << fOutFile << endl;
784  cout << "Parameter ROOT file is\t" << fParamRootFile << endl;
785  cout << "Parameter ASCII file is\t" << fParamAsciiFile << endl;
786  cout << "Real time " << rtime << " s, CPU time " << ctime
787  << "s" << endl;
788  cout << "CPU usage " << cpuUsage*100. << "%" << endl;
789  cout << "Max Memory " << maxMemory << " MB" << endl;
790 
791  cout << "Macro finished successfully." << endl;
792 
793 }
TGeoManager * gGeoManager
TString fOptions
Options parsed to the simulation.
Primary generator with added event filtering capabilities.
Double_t
Primary generator with added event filtering capabilities.
Double_t ctime
Definition: hit_dirc.C:114
TString fParamRootFile
Name of the parameter root file.
FairRuntimeDb * fRtdb
Runtime DB.
TString fOutFile
Name of the output file.
Double_t rtime
Definition: hit_dirc.C:113
TStopwatch fTimer
Timer.
TString fParamAsciiFile
Name of the parameter ascii file.
TString outfile
FairFilteredPrimaryGenerator* PndMasterRunSim::GetFilteredPrimaryGenerator ( )
inline

Getter for the primary generator, e.g. to configure the event filter.

Definition at line 273 of file PndMasterRunSim.h.

Referenced by sim_complete(), sim_complete_newSTT(), sim_day1(), sim_radlength_complete(), and tut_sim().

273 {return (FairFilteredPrimaryGenerator*)fGen;}
Primary generator with added event filtering capabilities.
TString PndMasterRunSim::GetOptions ( )
inline

Definition at line 248 of file PndMasterRunSim.h.

References fOptions.

248 { return fOptions;}
TString fOptions
Options parsed to the simulation.
PndFilteredPrimaryGenerator* PndMasterRunSim::GetPndFilteredPrimaryGenerator ( )
inline

Definition at line 274 of file PndMasterRunSim.h.

Referenced by prod_sim().

274 {return (PndFilteredPrimaryGenerator*)fGen;}
Primary generator with added event filtering capabilities.
void PndMasterRunSim::GetRange ( TString  par,
double &  min,
double &  max 
)
private

Definition at line 798 of file PndMasterRunSim.cxx.

References par, and TString.

Referenced by UseBoxGenerator(), UseLepLepGenerator(), and UsePiPiGenerator().

799 {
800  par.ReplaceAll(" ","");
801  par = par(par.Index("(")+1, par.Length()-par.Index("(")-2);
802 
803  TString smin=par, smax=par;
804 
805  if (par.Contains(","))
806  {
807  smin = par(0,par.Index(","));
808  smax = par(par.Index(",")+1,1000);
809  }
810 
811  min = smin.Atof();
812  max = smax.Atof();
813 }
Double_t par[3]
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:25
void PndMasterRunSim::SetDpmFlag ( Int_t  Mode)
inline

Set the DPM flag.

Parameters
Mode= 0. - DPM - No elastic scattering, only inelastic
Mode= 1. - DPM - Elastic and inelastic interactions (default)
Mode= 2. - DPM - Only elastic scattering, no inelastic one

Definition at line 145 of file PndMasterRunSim.h.

References fDpmFlag.

Referenced by prod_sim().

145 { fDpmFlag = Mode; };
Int_t fDpmFlag
Flag for DPM event generator.
void PndMasterRunSim::SetEventCounterRate ( Int_t  par)
inline

Setter of the event counter rate.

Definition at line 258 of file PndMasterRunSim.h.

References fEventCounterRate, and par.

Double_t par[3]
Int_t fEventCounterRate
After how many events the counter will print.
void PndMasterRunSim::SetFtfFlag ( Int_t  Mode)
inline

Set the FTF noelastic flag.

Parameters
Mode= 0. - FTF - Elastic and inelastic interactions (default)
Mode= 1. - FTF - No elastic scattering, only inelastic

Definition at line 152 of file PndMasterRunSim.h.

References fFtfFlag.

Referenced by prod_sim().

152 { fFtfFlag = Mode; };
Int_t fFtfFlag
Flag for FTF event generator.
void PndMasterRunSim::SetGenerator ( )

Set the event generator.

Master event generator

This call set the event generator according to the input name. If the input name contains "dpm" it uses dpm, if it contains "ftf" then ftf, if ".dec" it runs evtgen using the input name as namefile of the .dec file. If the input name contains "box" the macro breaks, since in that case the SetGenerator(PndBoxGenerator *boxGen) function must be used.

Definition at line 392 of file PndMasterRunSim.cxx.

References fInput, fOptions, fTargetMode, TString, UseBoxGenerator(), UseDpmGenerator(), UseEvtGenGenerator(), UseFtfGenerator(), and UsePiPiGenerator().

Referenced by prod_sim(), sim_box(), sim_complete(), sim_complete_newSTT(), sim_day1(), sim_mvd(), sim_radlength_complete(), and tut_sim().

393 {
394  if (fOptions.Contains("pndfiltprim"))
395  fGen = new PndFilteredPrimaryGenerator();
396  else
397  fGen = new FairFilteredPrimaryGenerator();
398 
399  switch (fTargetMode)
400  {
401  case 0:
402  LOG(INFO) << "Using no Vertex smearing" << FairLogger::endl;
403  break;
404  case 1:
405  LOG(INFO) << "Using Cluster Jet Target" << FairLogger::endl;
406  // a cluster-jet beam at the interaction zone with a horizontal width
407  // of e.g. dx = 1 mm and a length in accelerator beam direction of dz = 10 mm.
408  // Target TDR, page 44
409  fGen->SetTarget(0., 1./2.355); // From FWHM to sigma
410  fGen->SmearVertexZ(kTRUE);
411  fGen->SmearGausVertexZ(kTRUE);
412  fGen->SetBeam(0., 0., 0.1, 0.1);
413  fGen->SmearVertexXY(kTRUE);
414  break;
415  case 2:
416  LOG(INFO) << "Using Pellet Target" << FairLogger::endl;
417  // At PANDA a beam diameter around 3mm is needed and one may want even
418  // smaller size when PTR is not possible.
419  // Target TDR, page 61
420  fGen->SetTarget(0., 0.3);
421  fGen->SmearVertexZ(kTRUE);
422  fGen->SmearGausVertexZ(kTRUE);
423  fGen->SetBeam(0., 0., 0.3, 0.3);
424  fGen->SmearVertexXY(kTRUE);
425  break;
426  case 3:
427  LOG(INFO) << "Using Pellet Tracking Target" << FairLogger::endl;
428  // A position resolution σ(x, y, z) < 0.2 mm in the in- teraction position
429  // is desirable for event reconstruc- tion.
430  // Target TDR, page 61
431  fGen->SetTarget(0., 0.02);
432  fGen->SmearVertexZ(kTRUE);
433  fGen->SmearGausVertexZ(kTRUE);
434  fGen->SetBeam(0., 0., 0.02, 0.02);
435  fGen->SmearVertexXY(kTRUE);
436  break;
437  default:
438  LOG(INFO) << "Unkwown target mode - Using no vertex smearing" << FairLogger::endl;
439  }
440 
441  TString input = fInput;
442  input.ToLower();
443 
444  if (input.EndsWith(".dec") || input.Contains(".dec:"))
445  {
447  }
448  else if (input.BeginsWith("dpm"))
449  {
450  UseDpmGenerator();
451  }
452  else if (input.BeginsWith("ftf"))
453  {
455  }
456  else if (input.BeginsWith("box"))
457  {
459  }
460  else if (input.BeginsWith("pipi"))
461  {
463  }
464  else
465  {
466  LOG(WARNING)<< "Generator could not be identified from input '"<<fInput.Data()<<"'!!" << FairLogger::endl;
467  }
468 
469 }
TString fInput
Name of the input for the simulation.
void UseEvtGenGenerator(TString EvtGenFile)
Use EvtGen as event generator.
Short_t fTargetMode
Target mode.
void UseDpmGenerator()
Use DPM as event generator.
TString fOptions
Options parsed to the simulation.
Primary generator with added event filtering capabilities.
void UsePiPiGenerator(TString pipiConfig)
Use PiPiGenerator as event generator.
Primary generator with added event filtering capabilities.
void UseFtfGenerator(TString ftfData)
Use FTF as event generator.
void UseBoxGenerator(TString BoxConfig)
Use BoxGen as event generator.
void PndMasterRunSim::SetGenerator ( FairGenerator *  boxGen)

Set the event generator for FairBoxGenerator.

Master event generator for FairBoxGenerator

This call set the FairBoxGenerator as event generator. The user should create a FairBoxGenerator object with all the settings, and pass it as argument to the function.

Definition at line 631 of file PndMasterRunSim.cxx.

References fOptions.

632  {
633  LOG(INFO) << "Using FairBoxGenerator generator" << FairLogger::endl;
634  if (fOptions.Contains("PndFiltPrim"))
635  fGen = new PndFilteredPrimaryGenerator();
636  else
637  fGen = new FairFilteredPrimaryGenerator();
638  fGen->AddGenerator(boxGen);
639 }
TString fOptions
Options parsed to the simulation.
Primary generator with added event filtering capabilities.
Primary generator with added event filtering capabilities.
FairBoxGenerator * boxGen
Definition: sim_emc_apd.C:85
void PndMasterRunSim::SetGenerator ( PndBoxGenerator boxGen)

Set the event generator for PndBoxGenerator.

Master event generator for PndBoxGenerator

This call set the PndBoxGenerator as event generator. The user should create a PndBoxGenerator object with all the settings, and pass it as argument to the function.

Definition at line 620 of file PndMasterRunSim.cxx.

References fOptions.

621 {
622  LOG(INFO) << "Using PndBoxGenerator generator" << FairLogger::endl;
623  if (fOptions.Contains("PndFiltPrim"))
624  fGen = new PndFilteredPrimaryGenerator();
625  else
626  fGen = new FairFilteredPrimaryGenerator();
627  fGen->AddGenerator(boxGen);
628 }
TString fOptions
Options parsed to the simulation.
Primary generator with added event filtering capabilities.
Primary generator with added event filtering capabilities.
void PndMasterRunSim::SetInput ( TString  par)
inline

Input of the simulation This string can be: a) the name of the dec file for EvtGen, ending w/ .dec b) "dpm" if you want to use dpm c) "ftf" if you want to use ftf d) "box:[...]" if you want to use box.

Definition at line 219 of file PndMasterRunSim.h.

References fInput, and par.

Referenced by prod_sim(), sim_box(), sim_complete(), sim_complete_newSTT(), sim_day1(), sim_radlength_complete(), and tut_sim().

219 { fInput = par;}
TString fInput
Name of the input for the simulation.
Double_t par[3]
void PndMasterRunSim::SetInputDir ( TString  par)
inline

Input directory of the simulation.

Definition at line 224 of file PndMasterRunSim.h.

References fInputDir, and par.

Referenced by sim_complete(), and sim_day1().

224 { fInputDir = par;}
Double_t par[3]
TString fInputDir
Name of the input directory for the simulation.
void PndMasterRunSim::SetNumberOfEvents ( Int_t  par)
inline

Setter of the number of events.

Definition at line 253 of file PndMasterRunSim.h.

References fNEvents, and par.

Referenced by prod_sim(), sim_box(), sim_complete(), sim_complete_newSTT(), sim_day1(), sim_mvd(), sim_radlength_complete(), and tut_sim().

253 { fNEvents = par;}
Int_t fNEvents
Number of events.
Double_t par[3]
void PndMasterRunSim::SetOptions ( TString  par)
inline

Setter of the simulation options This string can be: "" -> default settings full setup "day1" -> Setup for day1 experiment: no GEM, FTS1234, NO DISC, NO RICH "gem2" (added to "day1") -> Setup for day1 experiment with 2 GEM planes (first two) "gem3" (added to "day1") -> Setup for day1 experiment with 3 GEM planes "fts1256" (added to "day1") -> Setup for day1 experiment with FTS1256 insted of FTS1234 "strip" (added to "day1") -> Setup for day1 experiment with only the strip part of the MVD instead of the full MVD Example: "day1+gem+fts1256" means day1 setup + GEM planes + fst1256.

Definition at line 247 of file PndMasterRunSim.h.

References fOptions, and par.

Referenced by prod_sim(), sim_complete(), and sim_day1().

247 { fOptions = par; fOptions.ToLower();}
Double_t par[3]
TString fOptions
Options parsed to the simulation.
void PndMasterRunSim::SetParamAsciiFile ( TString  par)
inline

Setter of the parameter ascii file.

Definition at line 234 of file PndMasterRunSim.h.

References fParamAsciiFile, and par.

Referenced by prod_sim(), sim_box(), sim_complete(), sim_complete_newSTT(), sim_day1(), sim_mvd(), sim_radlength_complete(), and tut_sim().

234 { fParamAsciiFile = par;}
Double_t par[3]
TString fParamAsciiFile
Name of the parameter ascii file.
void PndMasterRunSim::SetParamRootFile ( TString  par)
inline

Setter of the parameter root file.

Definition at line 229 of file PndMasterRunSim.h.

References fParamRootFile, and par.

Referenced by Setup().

229 { fParamRootFile = par;}
Double_t par[3]
TString fParamRootFile
Name of the parameter root file.
void PndMasterRunSim::SetTargetMode ( Short_t  par)
inline

Setter of the target mode.

Target mode 0 - No IP smearing (default) 1 - Cluster Jet 2 - Pellet target 3 - Pellet Tracking target

Definition at line 268 of file PndMasterRunSim.h.

References fTargetMode, and par.

268 { fTargetMode = par;}
Double_t par[3]
Short_t fTargetMode
Target mode.
Bool_t PndMasterRunSim::Setup ( TString  outprefix = "")

Initial setup.

Master Inital setup

This command set the source files, load the proper parameters, and set the relevant flags. If something fails, it returns a kFALSE value.

Definition at line 70 of file PndMasterRunSim.cxx.

References allDigiFile, Bool_t, creator, Double_t, fIni, fInput, fOptions, fOutFile, fParamAsciiFile, fParamRootFile, fRtdb, fTargetMode, kParameterMerged, mom, parIo1, parOutput, SetField(), SetMaterials(), SetOutputFile(), SetParamRootFile(), SetUseFairLinks(), sqrt(), and TString.

Referenced by prod_sim(), sim_box(), sim_complete(), sim_complete_newSTT(), sim_day1(), sim_mvd(), sim_radlength_complete(), and tut_sim().

71 {
72  TString inputName = outprefix;
73 
74  // If no prefix is given, we create one from fInput and force lower-case
75  if (inputName=="")
76  {
77  inputName = fInput;
78  inputName.ToLower();
79  }
80 
81  if (inputName.EndsWith(".dec")) inputName.Remove(inputName.Length()-4,4);
82  inputName.ReplaceAll(":","_");
83 
84  PndFileNameCreator creator(inputName.Data());
85  SetOutputFile(creator.GetSimFileName().data());
86  fOutFile = creator.GetSimFileName().data();
87  SetParamRootFile(creator.GetParFileName().data());
88  SetMaterials("media_pnd.geo");
89  SetGenerateRunInfo(kFALSE);
90  SetUseFairLinks(kTRUE);
91 
92  // ----- Parameter database --------------------------------------------
93  TString allDigiFile = gSystem->Getenv("VMCWORKDIR");
94  allDigiFile += "/macro/params/";
95  allDigiFile += fParamAsciiFile;
96 
97  fRtdb = this->GetRuntimeDb();
98  Bool_t kParameterMerged=kFALSE; // No use until now
99  FairParRootFileIo* parOutput = new FairParRootFileIo(kParameterMerged);
100  parOutput->open(fParamRootFile,"RECREATE");
101 
102  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
103  parIo1->open(allDigiFile.Data(),"in");
104 
105  fRtdb->setFirstInput(parIo1);
106  fRtdb->setOutput(parOutput);
107 
108  // ----- Create and Set the Field(s) ------------------------------------
109  PndMultiField *field= new PndMultiField("AUTO");
110  SetField(field);
111 
112  // ---- Defining PANDA particles -----------------------------------------
113  Double_t mom = GetBeamMom();
114  TLorentzVector fIni(0, 0, mom, sqrt(mom*mom+9.3827203e-01*9.3827203e-01)+9.3827203e-01);
115  TDatabasePDG::Instance()->AddParticle("ppSystem" ,"ppSystem", fIni.M(), kFALSE, 0.1, 6, "", 98888);
116  TDatabasePDG::Instance()->AddParticle("pbarpSystem" ,"pbarpSystem", fIni.M(), kFALSE, 0.1, 0, "", 88888);
117  TDatabasePDG::Instance()->AddParticle("pbarpSystem0","pbarpSystem0", fIni.M(), kFALSE, 0.1, 0, "", 88880);
118  TDatabasePDG::Instance()->AddParticle("pbarpSystem1","pbarpSystem1", fIni.M(), kFALSE, 0.1, 0, "", 88881);
119  TDatabasePDG::Instance()->AddParticle("pbarpSystem2","pbarpSystem2", fIni.M(), kFALSE, 0.1, 0, "", 88882);
120 
121  if (fOptions.Contains("day1")) fTargetMode = 1;
122  return kTRUE;
123 }
TString fInput
Name of the input for the simulation.
Bool_t kParameterMerged
Definition: sim_emc_apd.C:113
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
Double_t mom
Definition: plot_dirc.C:14
Short_t fTargetMode
Target mode.
TString allDigiFile
Definition: hit_muo.C:36
TString fOptions
Options parsed to the simulation.
TString parOutput
void SetParamRootFile(TString par)
Setter of the parameter root file.
A simple class which adds the corresponding file extensions to a given base class.
Double_t
fRun SetField(fField)
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
TString fParamRootFile
Name of the parameter root file.
fRun SetMaterials("media_pnd.geo")
fRun SetOutputFile(outFile)
PndMvdCreateDefaultApvMap * creator
FairRuntimeDb * fRtdb
Runtime DB.
TLorentzVector fIni
Definition: full_core_ntp.C:29
TString fOutFile
Name of the output file.
fRun SetUseFairLinks(kTRUE)
TString fParamAsciiFile
Name of the parameter ascii file.
void PndMasterRunSim::UseBoxGenerator ( TString  BoxConfig)

Use BoxGen as event generator.

Box event generator

This call sets BoxGenerator as event generator. The format of the config string is for isotrop events in theta: 'BOX:type(pdg,mult):p(min,max):phi(min,max):tht(min,max)' for isotrop events in cos(theta): 'BOX:type(pdg,mult):p(min,max):phi(min,max):ctht(min,max)' Instead of range 'var(min,max)' also a fixed value can be set with 'var(value)' All variables left out are set to defaults.

Parameters
BoxConfigconfiguration string of the BOX generator

Definition at line 471 of file PndMasterRunSim.cxx.

References Bool_t, boxGen, Double_t, GetRange(), mult, PndBoxGenerator::SetCosTheta(), PndBoxGenerator::SetDebug(), PndBoxGenerator::SetPhiRange(), PndBoxGenerator::SetPRange(), PndBoxGenerator::SetPtRange(), PndBoxGenerator::SetThetaRange(), PndBoxGenerator::SetXYZ(), and TString.

Referenced by SetGenerator().

472 {
473  // use BOX generator; defaults
474 
475  Double_t BoxMomMin = 0.05; // minimum momentum for box generator
476  Double_t BoxMomMax = 10.; // maximum " "
477  Double_t BoxThtMin = 0. ; // minimum theta for box generator
478  Double_t BoxThtMax = 180.; // maximum " "
479  Double_t BoxPhiMin = 0. ; // minimum phi for box generator
480  Double_t BoxPhiMax = 360.; // maximum " "
481  Bool_t BoxCosTht = false; // isotropic in cos(theta) instead theta
482  Bool_t BoxPt = false; // is pt given instead of p
483 
484  Int_t BoxType = 13; // default particle muon
485  Int_t BoxMult = 1; // default particle multiplicity
486  Double_t type=0,mult=0; // ref. parameters for range function
487 
488  BoxConfig.ToLower();
489 
490  if (BoxConfig!="box")
491  {
492  BoxConfig.ReplaceAll("box","");
493  BoxConfig.ReplaceAll(" ","");
494  BoxConfig += ":";
495 
496  while (BoxConfig.Contains(":"))
497  {
498  TString curpar = BoxConfig(0,BoxConfig.Index(":"));
499  BoxConfig = BoxConfig(BoxConfig.Index(":")+1,1000);
500  curpar.ReplaceAll("[","(");
501  curpar.ReplaceAll("]",")");
502 
503  if (curpar.BeginsWith("type(")) {GetRange(curpar,type,mult); BoxType = (Int_t)type; BoxMult = (Int_t)mult; }
504  if (curpar.BeginsWith("p(")) GetRange(curpar,BoxMomMin,BoxMomMax);
505  if (curpar.BeginsWith("pt(")) {GetRange(curpar,BoxMomMin,BoxMomMax); BoxPt = true;}
506  if (curpar.BeginsWith("tht(")) GetRange(curpar,BoxThtMin,BoxThtMax);
507  if (curpar.BeginsWith("ctht(")) {GetRange(curpar,BoxThtMin,BoxThtMax); BoxCosTht=true;}
508  if (curpar.BeginsWith("phi(")) GetRange(curpar,BoxPhiMin,BoxPhiMax);
509  }
510  }
511 
512  PndBoxGenerator* boxGen = new PndBoxGenerator(BoxType, BoxMult);
513  boxGen->SetDebug(0);
514 
515  if (BoxPt == true){
516  boxGen->SetPtRange(BoxMomMin, BoxMomMax);
517  } else {
518  boxGen->SetPRange(BoxMomMin,BoxMomMax); // GeV/c
519  }
520  boxGen->SetPhiRange(BoxPhiMin, BoxPhiMax); // Azimuth angle range [degree]
521  boxGen->SetThetaRange(BoxThtMin, BoxThtMax); // Polar angle in lab system range [degree]
522 
523  if (BoxCosTht) boxGen->SetCosTheta();
524 
525  boxGen->SetXYZ(0., 0., 0.); //cm
526 
527  LOG(INFO) << "Using PndBoxGenerator(" << GetBeamMom() <<", pdg="<<BoxType<<" mult="<<BoxMult
528  <<" ) generator with range p["<<BoxMomMin<<","<<BoxMomMax<<"] tht["<<BoxThtMin<<","<<BoxThtMax<<"]"<<(BoxCosTht?"*":"")<<" phi["<<BoxPhiMin<<","<<BoxPhiMax<<"]" << FairLogger::endl;
529 
530  // cout <<"BOX generator range: p["<<BoxMomMin<<","<<BoxMomMax<<"] tht["<<BoxThtMin<<","<<BoxThtMax<<"]"<<(BoxCosTht?"*":"")<<" phi["<<BoxPhiMin<<","<<BoxPhiMax<<"]"<<endl;
531 
532  fGen->AddGenerator(boxGen);
533 }
void SetThetaRange(Double32_t thetamin=0, Double32_t thetamax=90)
void SetXYZ(Double32_t x=0, Double32_t y=0, Double32_t z=0)
Double_t
void SetPtRange(Double32_t ptmin=0, Double32_t ptmax=10)
void SetDebug(Bool_t debug=0)
FairBoxGenerator * boxGen
Definition: sim_emc_apd.C:85
void GetRange(TString par, double &min, double &max)
void SetPRange(Double32_t pmin=0, Double32_t pmax=10)
Double_t mult
void SetPhiRange(Double32_t phimin=0, Double32_t phimax=360)
void PndMasterRunSim::UseDpmGenerator ( )

Use DPM as event generator.

Definition at line 642 of file PndMasterRunSim.cxx.

References fDpmFlag.

Referenced by SetGenerator().

643 {
644  LOG(INFO) << "Using PndDpmDirect(" << GetBeamMom() << ", " << fDpmFlag << ") generator" << FairLogger::endl;
645  PndDpmDirect *Dpm= new PndDpmDirect(GetBeamMom(), fDpmFlag);
646  fGen->AddGenerator(Dpm);
647 }
Int_t fDpmFlag
Flag for DPM event generator.
void PndMasterRunSim::UseEvtGenGenerator ( TString  EvtGenFile)

Use EvtGen as event generator.

EvtGen event generator

This call set EvtGen as event generator. The user should set the .dec file, and the function will retrieve automaticall beam momentum and initial state.

Parameters
EvtGenFileFilename of the .dec file

Definition at line 665 of file PndMasterRunSim.cxx.

References fInputDir, s, PndEvtGenDirect::SetStoreTree(), and TString.

Referenced by SetGenerator().

666 {
667 
668  TString IniRes="";
669 
670  if (EvtGenFile.Contains(":")) // is the initial resonance provide as <decfile>.dec:iniRes ?
671  {
672  IniRes = EvtGenFile(EvtGenFile.Index(":")+1,1000);
673  EvtGenFile = EvtGenFile(0,EvtGenFile.Index(":"));
674  }
675 
676  if (IniRes=="") // we need to search the decay file
677  {
678  TString fnamepath=fInputDir+EvtGenFile;
679  std::ifstream fs(fnamepath.Data());
680  char line[250];
681 
682  while (fs)
683  {
684  fs.getline(line,249);
685  TString s(line);
686  s.ReplaceAll("\r","");
687  if (IniRes=="" && s.Contains("Decay "))
688  {
689  if (s.Contains("#")) s=s(0,s.Index("#"));
690  s.ReplaceAll("Decay ","");
691  s.ReplaceAll(" ","");
692  IniRes = s;
693  }
694  }
695  fs.close();
696  }
697  /*
698  // Looping over the dec file trying to find the first string "Decay", in order to find the initai
699  // state as the following string
700  FILE *dec = fopen(fInputDir+EvtGenFile,"r");
701  if (dec==NULL) LOG(FATAL) << "The EvtGen dec file does not exist!! " << EvtGenFile << FairLogger::endl;
702 
703  char temp[6], particle[20];
704  Bool_t found = kFALSE;
705  while(fgets(temp, 6, dec) !=NULL)
706  {
707  if((strstr(temp, "Decay")) != NULL)
708  {
709  fscanf(dec, "%s",particle);
710  LOG(INFO) << "It was found a " << particle << " as initial state." << FairLogger::endl;
711  found = kTRUE;
712  break;
713  }
714  }
715  */
716  if (IniRes=="") LOG(FATAL) << "The input file is not a proper .dec!! " << FairLogger::endl;
717 
718  // TString EvtInput =gSystem->Getenv("VMCWORKDIR");
719  // EvtInput+="/macro/run/psi2s_Jpsi2pi_Jpsi_mumu.dec";
720  LOG(INFO) << "Using PndEvtGenDirect(" <<IniRes << ", " << (fInputDir+EvtGenFile).Data() << ", " << GetBeamMom() << ") generator" << FairLogger::endl;
721  PndEvtGenDirect *EvtGen = new PndEvtGenDirect(IniRes, (fInputDir+EvtGenFile).Data(), GetBeamMom());
722  EvtGen->SetStoreTree(kTRUE);
723  fGen->AddGenerator(EvtGen);
724 
725 }
TLorentzVector s
Definition: Pnd2DStar.C:50
void SetStoreTree(Bool_t store=true)
TString fInputDir
Name of the input directory for the simulation.
void PndMasterRunSim::UseFtfGenerator ( TString  ftfData)

Use FTF as event generator.

FTF event generator

This call set FTF as event generator. If no input file is given FtfDirect is used. With input file the events are taken from ftfData.

Definition at line 650 of file PndMasterRunSim.cxx.

References fFtfFlag.

Referenced by SetGenerator().

651 {
652  //if ( strncmp(fName,"TGeant4",7 ) == 0 ) LOG(FATAL) << "FTF does not run with Geant4 !!!" << FairLogger::endl;
653  if (ftfData.Contains(".root")){
654  LOG(INFO) << "Using PndFtfGenerator with input file " << ftfData << FairLogger::endl;
655  PndFtfGenerator* Ftf = new PndFtfGenerator(ftfData);
656  fGen->AddGenerator(Ftf);
657  } else {
658  LOG(INFO) << "Using PndFtfDirect(anti_proton, G4_H, 1, ftfp, " << GetBeamMom() << ", " << gRandom->GetSeed() <<", "<<fFtfFlag<< ") generator" << FairLogger::endl;
659  PndFtfDirect *Ftf = new PndFtfDirect("anti_proton", "G4_H", 1, "ftfp", GetBeamMom(), gRandom->GetSeed(), fFtfFlag);
660  fGen->AddGenerator(Ftf);
661  }
662 }
Int_t fFtfFlag
Flag for FTF event generator.
void PndMasterRunSim::UseLepLepGenerator ( TString  leplepConfig)

Use LepLepGenerator as event generator.

LepLep event generator

This call sets the PndLepLepGenerator as event generator. The format of the config string is: 'LEPLEP:pid(value):gegm(value):cosTheta(min, max)'

Parameters
leplepConfigconfiguration string of the LepLep generator

Definition at line 574 of file PndMasterRunSim.cxx.

References Double_t, GetRange(), pid(), PndLepLepGenerator::SetBeamMom(), PndLepLepGenerator::SetCosThetaMax(), PndLepLepGenerator::SetCosThetaMin(), and TString.

575 {
576  // use BOX generator; defaults
577 
578  Double_t cosThetaMin = 0.0;
579  Double_t cosThetaMax = 1.0;
580  Double_t pid = -1.0;
581  Double_t GeGmRatio = -1.0;
582  Double_t dummy = 1.0;
583 
584  leplepConfig.ToLower();
585 
586  if (leplepConfig!="")
587  {
588  leplepConfig.ReplaceAll("leplep","");
589  leplepConfig.ReplaceAll(" ","");
590  leplepConfig += ":";
591 
592  while (leplepConfig.Contains(":"))
593  {
594  TString curpar = leplepConfig(0,leplepConfig.Index(":"));
595  leplepConfig = leplepConfig(leplepConfig.Index(":")+1,1000);
596  curpar.ReplaceAll("[","(");
597  curpar.ReplaceAll("]",")");
598 
599  if (curpar.BeginsWith("pid(")) GetRange(curpar, pid, dummy);
600  if (curpar.BeginsWith("gegm(")) GetRange(curpar, GeGmRatio, dummy);
601  if (curpar.BeginsWith("cosTheta(")) GetRange(curpar, cosThetaMin, cosThetaMax);
602  }
603  }
604 
605  PndLepLepGenerator* leplepGen = new PndLepLepGenerator();
606  leplepGen->SetBeamMom(GetBeamMom());
607 
608  leplepGen->SetCosThetaMin(cosThetaMin);
609  leplepGen->SetCosThetaMax(cosThetaMax);
610 
611 
612  LOG(INFO) << "Using PndleplepGenerator(BeamMom = " << GetBeamMom() << " GeV/c, cosThetaRange = "<< cosThetaMin << " : " << cosThetaMax << ")" << FairLogger::endl;
613 
614  // cout <<"BOX generator range: p["<<BoxMomMin<<","<<BoxMomMax<<"] tht["<<BoxThtMin<<","<<BoxThtMax<<"]"<<(BoxCosTht?"*":"")<<" phi["<<BoxPhiMin<<","<<BoxPhiMax<<"]"<<endl;
615 
616  fGen->AddGenerator(leplepGen);
617 }
void SetBeamMom(Double_t in_P)
int pid()
Double_t
void SetCosThetaMax(Double_t in_cos_theta_max)
void GetRange(TString par, double &min, double &max)
void SetCosThetaMin(Double_t in_cos_theta_min)
void PndMasterRunSim::UsePiPiGenerator ( TString  pipiConfig)

Use PiPiGenerator as event generator.

PiPi event generator

This call sets the PndPiPiGenerator as event generator. The format of the config string is: 'PIPI:cosTheta(min, max)'

Parameters
pipiConfigconfiguration string of the PiPi generator

Definition at line 535 of file PndMasterRunSim.cxx.

References Double_t, GetRange(), PndPiPiGenerator::SetBeamMom(), PndPiPiGenerator::SetCosThetaMax(), PndPiPiGenerator::SetCosThetaMin(), and TString.

Referenced by SetGenerator().

536 {
537  // use BOX generator; defaults
538 
539  Double_t cosThetaMin = 0.0;
540  Double_t cosThetaMax = 1.0;
541 
542  pipiConfig.ToLower();
543 
544  if (pipiConfig!="pipi")
545  {
546  pipiConfig.ReplaceAll("pipi","");
547  pipiConfig.ReplaceAll(" ","");
548  pipiConfig += ":";
549 
550  while (pipiConfig.Contains(":"))
551  {
552  TString curpar = pipiConfig(0,pipiConfig.Index(":"));
553  pipiConfig = pipiConfig(pipiConfig.Index(":")+1,1000);
554  curpar.ReplaceAll("[","(");
555  curpar.ReplaceAll("]",")");
556 
557  if (curpar.BeginsWith("cosTheta(")) GetRange(curpar, cosThetaMin, cosThetaMax);
558  }
559  }
560 
561  PndPiPiGenerator* pipiGen = new PndPiPiGenerator();
562  pipiGen->SetBeamMom(GetBeamMom());
563  pipiGen->SetCosThetaMin(cosThetaMin);
564  pipiGen->SetCosThetaMax(cosThetaMax);
565 
566 
567  LOG(INFO) << "Using PndPiPiGenerator(BeamMom = " << GetBeamMom() << " GeV/c, cosThetaRange = "<< cosThetaMin << " : " << cosThetaMax << ")" << FairLogger::endl;
568 
569  // cout <<"BOX generator range: p["<<BoxMomMin<<","<<BoxMomMax<<"] tht["<<BoxThtMin<<","<<BoxThtMax<<"]"<<(BoxCosTht?"*":"")<<" phi["<<BoxPhiMin<<","<<BoxPhiMax<<"]"<<endl;
570 
571  fGen->AddGenerator(pipiGen);
572 }
void SetBeamMom(Double_t in_P)
void SetCosThetaMax(Double_t in_cos_theta_max)
Double_t
void SetCosThetaMin(Double_t in_cos_theta_min)
void GetRange(TString par, double &min, double &max)

Member Data Documentation

Int_t PndMasterRunSim::fDpmFlag
private

Flag for DPM event generator.

Definition at line 287 of file PndMasterRunSim.h.

Referenced by SetDpmFlag(), and UseDpmGenerator().

Int_t PndMasterRunSim::fEventCounterRate
private

After how many events the counter will print.

Definition at line 290 of file PndMasterRunSim.h.

Referenced by AddSimTasks(), and SetEventCounterRate().

Int_t PndMasterRunSim::fFtfFlag
private

Flag for FTF event generator.

Definition at line 288 of file PndMasterRunSim.h.

Referenced by SetFtfFlag(), and UseFtfGenerator().

TString PndMasterRunSim::fInput
private

Name of the input for the simulation.

Definition at line 280 of file PndMasterRunSim.h.

Referenced by SetGenerator(), SetInput(), and Setup().

TString PndMasterRunSim::fInputDir
private

Name of the input directory for the simulation.

Definition at line 281 of file PndMasterRunSim.h.

Referenced by SetInputDir(), and UseEvtGenGenerator().

Int_t PndMasterRunSim::fNEvents
private

Number of events.

Definition at line 289 of file PndMasterRunSim.h.

Referenced by AddSimTasks(), and SetNumberOfEvents().

TString PndMasterRunSim::fOptions
private

Options parsed to the simulation.

Definition at line 285 of file PndMasterRunSim.h.

Referenced by AddSimTasks(), CreateGeometry(), CreateGeometryDay1(), Finish(), GetOptions(), SetGenerator(), SetOptions(), and Setup().

TString PndMasterRunSim::fOutFile
private

Name of the output file.

Definition at line 282 of file PndMasterRunSim.h.

Referenced by Finish(), and Setup().

TString PndMasterRunSim::fParamAsciiFile
private

Name of the parameter ascii file.

Definition at line 284 of file PndMasterRunSim.h.

Referenced by Finish(), SetParamAsciiFile(), and Setup().

TString PndMasterRunSim::fParamRootFile
private

Name of the parameter root file.

Definition at line 283 of file PndMasterRunSim.h.

Referenced by Finish(), SetParamRootFile(), and Setup().

FairRuntimeDb* PndMasterRunSim::fRtdb
private

Runtime DB.

Definition at line 293 of file PndMasterRunSim.h.

Referenced by Finish(), and Setup().

Short_t PndMasterRunSim::fTargetMode
private

Target mode.

Definition at line 291 of file PndMasterRunSim.h.

Referenced by SetGenerator(), SetTargetMode(), and Setup().

TStopwatch PndMasterRunSim::fTimer
private

Timer.

Definition at line 294 of file PndMasterRunSim.h.

Referenced by Finish(), and PndMasterRunSim().


The documentation for this class was generated from the following files: