FairRoot/PandaRoot
Functions
rho/tut_sim.C File Reference

Go to the source code of this file.

Functions

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")
 

Function Documentation

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 at line 8 of file rho/tut_sim.C.

References PndMasterRunSim::AddSimTasks(), BeamMomentum, PndMasterRunSim::CreateGeometry(), PndMasterRunSim::Finish(), fRun, PndMasterRunSim::GetFilteredPrimaryGenerator(), nEvents, primGen, PndMasterRunSim::SetGenerator(), PndMasterRunSim::SetInput(), PndMasterRunSim::SetNumberOfEvents(), PndMasterRunSim::SetParamAsciiFile(), PndMasterRunSim::Setup(), FairFilteredPrimaryGenerator::SetVerbose(), and TString.

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 }
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.
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 SetVerbose(Int_t verbose=12)
Set the level of commenting output.