FairRoot/PandaRoot
macro/master/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 = 100, TString SimEngine ="TGeant3", Double_t BeamMomentum = 6.231552, TString prefix= "evtcomplete")
9 {
10  //-----User Settings:------------------------------------------------------
11 // gDebug=5;
12  TString parAsciiFile = "all.par";
13 
14  TString options = "";
15  // TString inputGenerator =
16  // EvtGen -> "xxxxxxxx.dec" (parses dec-file for initial particle) or "xxxxxxx.dec:initial_particle"
17  // DPM -> "dpm_xxxxx"
18  // FTF -> "ftf_xxxxx"
19  // BOX -> "box:type(pdgcode,mult):p(min,max):tht(min,max):phi(min,max)"
20  // PIPI -> "pipi:cosTheta(min,max)"
21  // LEP -> "leplep:pid(value):gegm(value):cosTheta(min,max)"
22 
23  //TString inputGenerator = "psi2s_Jpsi2pi_Jpsi_mumu.dec";
24  //TString inputGenerator = "ftf";
25  //TString inputGenerator = "ftf";
26  //TString inputGenerator = "box:type(211,1):p(1,1):tht(10,120):phi(0,360)";
27  TString inputGenerator = "box:type(211,10):p(0.5,1.5):tht(5,90):phi(0,360)";
28 
29  //-------------------------------------------------------------------------
30  // ----- Create the Simulation run manager ------------------------------
32  fRun->SetInput(inputGenerator);
33  fRun->SetName(SimEngine);
34  fRun->SetParamAsciiFile(parAsciiFile);
36  fRun->SetBeamMom(BeamMomentum);
37  fRun->SetStoreTraj(kTRUE);
38  fRun->SetOptions(options);
39  // ----- Initialization ------------------------------------------------
40  fRun->Setup(prefix);
41  // ----- Geometry -----------------------------------------------------
42  fRun->CreateGeometry();
43  // ----- Event generator ----------------------------------------------
44  fRun->SetGenerator();
45 
46  // ----- Event filter setup -------------------------------------------
48  primGen->SetVerbose(0);
49  // ---- Example configuration for the event filter ------------------------
50  //FairEvtFilterOnSingleParticleCounts* chrgFilter = new FairEvtFilterOnSingleParticleCounts("chrgFilter");
51  //chrgFilter->AndMinCharge(4, FairEvtFilter::kCharged);
52  //primGen->AndFilter(chrgFilter);
53 
54  // ----- Add tasks ----------------------------------------------------
55  fRun->AddSimTasks();
56  // ----- Intialise and run --------------------------------------------
57  fRun->Init();
58  fRun->Run(nEvents);
59  fRun->Finish();
60  return 0;
61 }
62 
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
FairPrimaryGenerator * primGen
Definition: sim_emc_apd.C:81
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.
Primary generator with added event filtering capabilities.
FairFilteredPrimaryGenerator * GetFilteredPrimaryGenerator()
Getter for the primary generator, e.g. to configure the event filter.
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=100, TString SimEngine="TGeant3", Double_t BeamMomentum=6.231552, TString prefix="evtcomplete")
void SetOptions(TString par)
Setter of the simulation options This string can be: "" -> default settings full setup "day1" -> Set...
void SetGenerator()
Set the event generator.
void SetVerbose(Int_t verbose=12)
Set the level of commenting output.