FairRoot/PandaRoot
|
Class for the master simulation chain. More...
#include <PndMasterRunSim.h>
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... | |
FairFilteredPrimaryGenerator * | GetFilteredPrimaryGenerator () |
Getter for the primary generator, e.g. to configure the event filter. More... | |
PndFilteredPrimaryGenerator * | GetPndFilteredPrimaryGenerator () |
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... | |
Class for the master simulation chain.
This class is the basic for the simulation macro. It loads the environment and all the standard detectors.
Definition at line 31 of file PndMasterRunSim.h.
PndMasterRunSim::PndMasterRunSim | ( | ) |
Default constructor.
Definition at line 54 of file PndMasterRunSim.cxx.
References fTimer.
|
virtual |
void PndMasterRunSim::AddGenerator | ( | FairGenerator * | aGen | ) |
Add a generator to existing setup.
and produce their particle content in each even simultaneously.
void PndMasterRunSim::AddSimTasks | ( | ) |
Add simulation tasks.
It adds all the standard simulation tasks
Definition at line 379 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_radlength_complete(), and tut_sim().
void PndMasterRunSim::CreateGeometry | ( | ) |
It switches between different standard geometry volumes.
According to fOptions, it creates the standard geometry volumes for the full setup, or dedicated geometries (such as day1)
Definition at line 125 of file PndMasterRunSim.cxx.
References CreateGeometryDay1(), CreateGeometryDefault(), CreateGeometryPhase1(), and fOptions.
Referenced by prod_sim(), sim_box(), sim_complete(), sim_day1(), and tut_sim().
void PndMasterRunSim::CreateGeometryDay1 | ( | ) |
It creates the standard geometry volumes for day1 phase.
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 283 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().
void PndMasterRunSim::CreateGeometryDefault | ( | ) |
It creates all the standard geometry volumes.
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 133 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().
void PndMasterRunSim::CreateGeometryPhase1 | ( | ) |
It creates the standard geometry volumes for phase1 of the experiment.
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 208 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().
void PndMasterRunSim::Finish | ( | ) |
Final diagnostics.
It prints CPU time, memory usage, used parameters, and eventually send the information to CDash
Definition at line 727 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_radlength_complete(), and tut_sim().
|
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().
|
inline |
Definition at line 248 of file PndMasterRunSim.h.
References fOptions.
|
inline |
Definition at line 274 of file PndMasterRunSim.h.
Referenced by prod_sim().
|
private |
Definition at line 797 of file PndMasterRunSim.cxx.
Referenced by UseBoxGenerator(), UseLepLepGenerator(), and UsePiPiGenerator().
|
inline |
Set the DPM flag.
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().
|
inline |
Setter of the event counter rate.
Definition at line 258 of file PndMasterRunSim.h.
References fEventCounterRate, and par.
|
inline |
Set the FTF noelastic flag.
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().
void PndMasterRunSim::SetGenerator | ( | ) |
Set the 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 391 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_radlength_complete(), and tut_sim().
void PndMasterRunSim::SetGenerator | ( | FairGenerator * | boxGen | ) |
Set the 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 630 of file PndMasterRunSim.cxx.
References fOptions.
void PndMasterRunSim::SetGenerator | ( | PndBoxGenerator * | boxGen | ) |
Set the 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 619 of file PndMasterRunSim.cxx.
References fOptions.
|
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.
Referenced by prod_sim(), sim_box(), sim_complete(), sim_complete_newSTT(), sim_day1(), sim_radlength_complete(), and tut_sim().
|
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().
|
inline |
Setter of the number of events.
Definition at line 253 of file PndMasterRunSim.h.
Referenced by prod_sim(), sim_box(), sim_complete(), sim_complete_newSTT(), sim_day1(), sim_radlength_complete(), and tut_sim().
|
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.
Referenced by prod_sim(), sim_complete(), and sim_day1().
|
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_radlength_complete(), and tut_sim().
|
inline |
Setter of the parameter root file.
Definition at line 229 of file PndMasterRunSim.h.
References fParamRootFile, and par.
Referenced by Setup().
|
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.
Initial 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_radlength_complete(), and tut_sim().
void PndMasterRunSim::UseBoxGenerator | ( | TString | BoxConfig | ) |
Use BoxGen as 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.
BoxConfig | configuration string of the BOX generator |
Definition at line 470 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().
void PndMasterRunSim::UseDpmGenerator | ( | ) |
Use DPM as event generator.
Definition at line 641 of file PndMasterRunSim.cxx.
References fDpmFlag.
Referenced by SetGenerator().
void PndMasterRunSim::UseEvtGenGenerator | ( | TString | EvtGenFile | ) |
Use EvtGen as 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.
EvtGenFile | Filename of the .dec file |
Definition at line 664 of file PndMasterRunSim.cxx.
References fInputDir, s, PndEvtGenDirect::SetStoreTree(), and TString.
Referenced by SetGenerator().
void PndMasterRunSim::UseFtfGenerator | ( | TString | ftfData | ) |
Use FTF as 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 649 of file PndMasterRunSim.cxx.
References fFtfFlag.
Referenced by SetGenerator().
void PndMasterRunSim::UseLepLepGenerator | ( | TString | leplepConfig | ) |
Use LepLepGenerator as 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)'
leplepConfig | configuration string of the LepLep generator |
Definition at line 573 of file PndMasterRunSim.cxx.
References Double_t, GetRange(), pid(), PndLepLepGenerator::SetBeamMom(), PndLepLepGenerator::SetCosThetaMax(), PndLepLepGenerator::SetCosThetaMin(), and TString.
void PndMasterRunSim::UsePiPiGenerator | ( | TString | pipiConfig | ) |
Use PiPiGenerator as event generator.
This call sets the PndPiPiGenerator as event generator. The format of the config string is: 'PIPI:cosTheta(min, max)'
pipiConfig | configuration string of the PiPi generator |
Definition at line 534 of file PndMasterRunSim.cxx.
References Double_t, GetRange(), PndPiPiGenerator::SetBeamMom(), PndPiPiGenerator::SetCosThetaMax(), PndPiPiGenerator::SetCosThetaMin(), and TString.
Referenced by SetGenerator().
|
private |
Flag for DPM event generator.
Definition at line 287 of file PndMasterRunSim.h.
Referenced by SetDpmFlag(), and UseDpmGenerator().
|
private |
After how many events the counter will print.
Definition at line 290 of file PndMasterRunSim.h.
Referenced by AddSimTasks(), and SetEventCounterRate().
|
private |
Flag for FTF event generator.
Definition at line 288 of file PndMasterRunSim.h.
Referenced by SetFtfFlag(), and UseFtfGenerator().
|
private |
Name of the input for the simulation.
Definition at line 280 of file PndMasterRunSim.h.
Referenced by SetGenerator(), SetInput(), and Setup().
|
private |
Name of the input directory for the simulation.
Definition at line 281 of file PndMasterRunSim.h.
Referenced by SetInputDir(), and UseEvtGenGenerator().
|
private |
Number of events.
Definition at line 289 of file PndMasterRunSim.h.
Referenced by AddSimTasks(), and SetNumberOfEvents().
|
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().
|
private |
Name of the output file.
Definition at line 282 of file PndMasterRunSim.h.
|
private |
Name of the parameter ascii file.
Definition at line 284 of file PndMasterRunSim.h.
Referenced by Finish(), SetParamAsciiFile(), and Setup().
|
private |
Name of the parameter root file.
Definition at line 283 of file PndMasterRunSim.h.
Referenced by Finish(), SetParamRootFile(), and Setup().
|
private |
|
private |
Target mode.
Definition at line 291 of file PndMasterRunSim.h.
Referenced by SetGenerator(), SetTargetMode(), and Setup().
|
private |
Timer.
Definition at line 294 of file PndMasterRunSim.h.
Referenced by Finish(), and PndMasterRunSim().