PandaRoot
PndMasterRunSim.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
25 #pragma once
26 
27 #include "FairRunSim.h"
28 #include "FairRuntimeDb.h"
29 #include "FairTask.h"
30 
31 #include "TStopwatch.h"
32 #include "TString.h"
33 
36 class FairGenerator;
37 
38 class FairBoxGenerator;
39 
40 class PndBoxGenerator;
41 
42 class PndMasterRunSim : public FairRunSim {
43  public:
48 
52  virtual ~PndMasterRunSim();
53 
61  virtual Bool_t Setup(TString outprefix = "");
62 
69  void Finish();
70 
77  virtual void CreateGeometry();
78 
85  void CreateGeometryDefault();
86 
92  virtual void AddSimTasks();
93 
103  void SetGenerator();
104 
111  void AddGenerator(FairGenerator *aGen);
112 
119  void SetGenerator(FairGenerator *aGen);
120 
127  void SetDpmFlag(Int_t Mode) { fDpmFlag = Mode; };
128 
134  void SetFtfFlag(Int_t Mode) { fFtfFlag = Mode; };
135 
139  void UseDpmGenerator();
140 
148  void UseFtfGenerator(TString ftfData);
149 
158  void UsePythia8Generator(TString py8Data);
159 
168  void UseEvtGenGenerator(TString EvtGenFile);
169 
182  void UseBoxGenerator(TString BoxConfig);
183 
192  void UsePiPiGenerator(TString pipiConfig);
193 
202  void UseLepLepGenerator(TString leplepConfig);
203  void UseAsciiGenerator(TString AsciiFile);
204 
213  void SetInput(TString par) { fInput = par; }
214 
218  void SetInputDir(TString par) { fInputDir = par; }
219 
223  void SetParamRootFile(TString par) { fParamRootFile = par; }
224 
228  void SetParamAsciiFile(TString par) { fParamAsciiFile = par; }
229 
241  void SetOptions(TString par)
242  {
243  fOptions = par;
244  fOptions.ToLower();
245  }
246  TString GetOptions() { return fOptions; }
247 
251  void SetNumberOfEvents(Int_t par) { fNEvents = par; }
252 
256  void SetEventCounterRate(Int_t par) { fEventCounterRate = par; }
257 
258  virtual void SetupTargetMode() {};
259 
268  void SetTargetMode(Short_t par) { fTargetMode = par; }
269 
275 
276  void PrintListOfTasks(TList *list, TString prefix = " - ");
277  void PrintListOfTasks() { PrintListOfTasks(GetMainTask()->GetListOfTasks()); }
278 
279  protected:
280  void GetRange(TString par, double &min, double &max);
281  void GetCoords(TString par, double &X, double &Y, double &Z);
282  virtual void SetOutputFile(TString outprefix);
283  virtual void SetRtdb();
284  virtual void SetField();
285  virtual void DefineParticles();
291  void CreatePrimGen();
292 
293  TString fInput;
294  TString fInputDir;
295  TString fOutFile;
296  TString fParamRootFile;
297  TString fParamAsciiFile;
298  TString fOptions;
299 
300  Int_t fDpmFlag;
301  Int_t fFtfFlag;
302  Int_t fNEvents;
304  Short_t fTargetMode;
305 
306  FairRuntimeDb *fRtdb;
307  TStopwatch fTimer;
308 
310  ClassDef(PndMasterRunSim, 2);
311 
312 };
TString fInput
Name of the input for the simulation.
void SetInputDir(TString par)
Input directory of the simulation.
Int_t fFtfFlag
Flag for FTF event generator.
void GetCoords(TString par, double &X, double &Y, double &Z)
void Finish()
Final diagnostics.
void CreateGeometryDefault()
It creates all the standard geometry volumes.
Int_t fNEvents
Number of events.
virtual ~PndMasterRunSim()
Default destructor.
virtual void DefineParticles()
virtual void AddSimTasks()
Add simulation tasks.
virtual void SetField()
PndFilteredPrimaryGenerator * GetPndFilteredPrimaryGenerator()
void SetParamAsciiFile(TString par)
Setter of the parameter ascii file.
virtual void SetRtdb()
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:37
void UseEvtGenGenerator(TString EvtGenFile)
Use EvtGen as event generator.
Short_t fTargetMode
Target mode.
void UsePythia8Generator(TString py8Data)
Use Pythia8 as event generator.
void UseDpmGenerator()
Use DPM as event generator.
TString fOptions
Options parsed to the simulation.
Int_t fEventCounterRate
After how many events the counter will print.
void AddGenerator(FairGenerator *aGen)
Add a generator to existing setup.
virtual void SetupTargetMode()
void SetInput(TString par)
Input of the simulation.
virtual Bool_t Setup(TString outprefix="")
Initial setup.
void UseAsciiGenerator(TString AsciiFile)
Primary generator with added event filtering capabilities.
void SetParamRootFile(TString par)
Setter of the parameter root file.
FairFilteredPrimaryGenerator * GetFilteredPrimaryGenerator()
Getter for the primary generator, e.g. to configure the event filter.
void UsePiPiGenerator(TString pipiConfig)
Use PiPiGenerator as event generator.
Primary generator with added event filtering capabilities.
void SetTargetMode(Short_t par)
Setter of the target mode.
friend F32vec4 min(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:36
void SetNumberOfEvents(Int_t par)
Setter of the number of events.
Class for the master simulation chain.
void UseFtfGenerator(TString ftfData)
Use FTF as event generator.
TString fParamRootFile
Name of the parameter root file.
void SetEventCounterRate(Int_t par)
Setter of the event counter rate.
void GetRange(TString par, double &min, double &max)
PndMasterRunSim()
Default constructor.
void UseBoxGenerator(TString BoxConfig)
Use BoxGen as event generator.
void SetOptions(TString par)
Setter of the simulation options.
TString GetOptions()
FairRuntimeDb * fRtdb
Runtime DB.
void SetFtfFlag(Int_t Mode)
Set the FTF noelastic flag.
TString fOutFile
Name of the output file.
TStopwatch fTimer
Timer.
void SetGenerator()
Set the event generator.
TString fInputDir
Name of the input directory for the simulation.
TString fParamAsciiFile
Name of the parameter ascii file.
virtual void SetOutputFile(TString outprefix)
void CreatePrimGen()
Check and create primary generator.
void UseLepLepGenerator(TString leplepConfig)
Use LepLepGenerator as event generator.
void SetDpmFlag(Int_t Mode)
Set the DPM flag.
virtual void CreateGeometry()
It switches between different standard geometry volumes.
Int_t fDpmFlag
Flag for DPM event generator.