FairRoot/PandaRoot
macro/QA/run3/sim_complete.C
Go to the documentation of this file.
1 // Macro for running Panda simulation with Geant3 or Geant4 (M. Al-Turany)
2 // This macro is supposed to run the full simulation of the panda detector
3 // to run the macro:
4 // root sim_complete.C or in root session root>.x sim_complete.C
5 // to run with different options:(e.g more events, different momentum, Geant4)
6 // root sim_complete.C"(100, "TGeant4",2)"
7 
8 int sim_complete(Int_t nEvents = 1000, TString SimEngine ="TGeant3", Double_t BeamMomentum = 6.231552)
9 {
10  //-----User Settings:------------------------------------------------------
11  TString parAsciiFile = "all.par";
12  // TString inputGenerator =
13  // EvtGen -> "xxxxxxxx.dec"
14  // DPM -> "dpm_xxxxx"
15  // FTF -> "ftf_xxxxx"
16  TString inputGenerator = "psi2s_Jpsi2pi_Jpsi_mumu.dec";
17  TString inputDir = gSystem->Getenv("VMCWORKDIR");
18  inputDir += "/macro/QA/run3/";
19  gRandom->SetSeed(1234);
20  //-------------------------------------------------------------------------
21  // ----- Create the Simulation run manager ------------------------------
23  fRun->SetInput(inputGenerator);
24  fRun->SetInputDir(inputDir);
25  fRun->SetName(SimEngine);
26  fRun->SetParamAsciiFile(parAsciiFile);
28  fRun->SetBeamMom(BeamMomentum);
29  // ----- Initialization ------------------------------------------------
30  fRun->Setup();
31  // ----- Geometry -----------------------------------------------------
32  fRun->CreateGeometry();
33  // ----- Event generator ----------------------------------------------
34  fRun->SetGenerator();
35  // ----- Add tasks ----------------------------------------------------
36  fRun->AddSimTasks();
37  // ----- Intialise and run --------------------------------------------
38  fRun->Init();
39  fRun->Run(nEvents);
40  fRun->Finish();
41 
42  //return 0;
43  return 0;
44 };
45 
void SetInputDir(TString par)
Input directory of the simulation.
void Finish()
Final diagnostics.
Bool_t Setup(TString outprefix="")
Initial setup.
void SetParamAsciiFile(TString par)
Setter of the parameter ascii file.
double BeamMomentum
Definition: sim_ftof_stof.C:17
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.
FairRunAna * fRun
Definition: hit_dirc.C:58
void AddSimTasks()
Add simulation tasks.
Double_t
Int_t nEvents
Definition: hit_dirc.C:11
void SetNumberOfEvents(Int_t par)
Setter of the number of events.
void CreateGeometry()
It switches between different standard geometry volumes.
Class for the master simulation chain.
int sim_complete(Int_t nEvents=1000, TString SimEngine="TGeant3", Double_t BeamMomentum=6.231552)
void SetGenerator()
Set the event generator.