FairRoot/PandaRoot
rho/tut_sim.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 void tut_sim(Int_t nEvents = 100, TString prefix = "signal", TString inputGenerator="pp_jpsi2pi_jpsi_mumu.dec", Double_t BeamMomentum = 6.231552, TString SimEngine ="TGeant3")
9 {
10  // TString inputGenerator =
11  // EvtGen -> "xxxxxxxx.dec" (parses dec-file for initial particle) or "xxxxxxx.dec:initial_particle"
12  // DPM -> "dpm_xxxxx"
13  // FTF -> "ftf_xxxxx"
14  // BOX -> "box:type(pdgcode,mult):p(min,max):tht(min,max):phi(min,max)"
15 
16  //----- Other parameter examples for inputGenerator -----------------------
17  // inputGenerator = "dpm";
18  // inputGenerator = "ftf";
19  // inputGenerator = "box:type(211,1):p(1,1):tht(10,120):phi(0,360)";
20 
21  //-----User Settings:------------------------------------------------------
22  TString parAsciiFile = "all.par"; // the standard param. file
23 
24  //-------------------------------------------------------------------------
25  // ----- Create the Simulation run manager ------------------------------
27  fRun->SetInput(inputGenerator);
28  fRun->SetName(SimEngine);
29  fRun->SetParamAsciiFile(parAsciiFile);
31  fRun->SetBeamMom(BeamMomentum);
32  // ----- Initialization ------------------------------------------------
33  fRun->Setup(prefix);
34  // ----- Geometry -----------------------------------------------------
35  fRun->CreateGeometry();
36  // ----- Event generator ----------------------------------------------
37  fRun->SetGenerator();
38 
39  // ----- Event filter setup -------------------------------------------
41  primGen->SetVerbose(0);
42  // ---- Example configuration for the event filter ------------------------
43  //FairEvtFilterOnSingleParticleCounts* chrgFilter = new FairEvtFilterOnSingleParticleCounts("chrgFilter");
44  //chrgFilter->AndMinCharge(4, FairEvtFilter::kCharged);
45  //primGen->AndFilter(chrgFilter);
46 
47  // ----- Add tasks ----------------------------------------------------
48  fRun->AddSimTasks();
49  // ----- Intialise and run --------------------------------------------
50  fRun->Init();
51  fRun->Run(nEvents);
52  fRun->Finish();
53 }
54 
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.
void SetGenerator()
Set the event generator.
void tut_sim(Int_t nEvents=100, TString prefix="signal", TString inputGenerator="pp_jpsi2pi_jpsi_mumu.dec", Double_t BeamMomentum=6.231552, TString SimEngine="TGeant3")
Definition: rho/tut_sim.C:8
void SetVerbose(Int_t verbose=12)
Set the level of commenting output.