FairRoot/PandaRoot
QA/mvd/sim_mvd.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_mvd(Int_t nEvents = 1000, TString SimEngine ="TGeant3", Double_t BeamMomentum = 1.5)
9 {
10  //-----User Settings:------------------------------------------------------
11 // gDebug=5;
12  TString parAsciiFile = "all.par";
13 
14  TString prefix = "mvdqa"; // prefix string for output files
15 
16  // TString inputGenerator =
17  // EvtGen -> "xxxxxxxx.dec" (parses dec-file for initial particle) or "xxxxxxx.dec:initial_particle"
18  // DPM -> "dpm_xxxxx"
19  // FTF -> "ftf_xxxxx"
20  // BOX -> "box:type(pdgcode,mult):p(min,max):tht(min,max):phi(min,max)"
21  // PIPI -> "pipi:cosTheta(min,max)"
22  // LEP -> "leplep:pid(value):gegm(value):cosTheta(min,max)"
23 
24  //TString inputGenerator = "psi2s_Jpsi2pi_Jpsi_mumu.dec";
25  //TString inputGenerator = "dpm";
26  //TString inputGenerator = "ftf";
27  TString inputGenerator = "box:type(211,1):p(1,1):tht(10,120):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(kFALSE);
38  // ----- Initialization ------------------------------------------------
39  fRun->Setup(prefix);
40  // ----- Geometry -----------------------------------------------------
41  FairModule *Cave= new PndCave("CAVE");
42  Cave->SetGeometryFileName("pndcave.geo");
43  fRun->AddModule(Cave);
44  //------------------------- Magnet -----------------
45  // This part is commented because the MDT geometry contains the magnet now
46  //FairModule *Magnet= new PndMagnet("MAGNET");
47  //Magnet->SetGeometryFileName("FullSolenoid_V842.root");
48  //Magnet->SetGeometryFileName("FullSuperconductingSolenoid_v831.root");
49  //fRun->AddModule(Magnet);
50  FairModule *Dipole= new PndMagnet("MAGNET");
51  Dipole->SetGeometryFileName("dipole.geo");
52  fRun->AddModule(Dipole);
53  //------------------------- Pipe -----------------
54  FairModule *Pipe= new PndPipe("PIPE");
55  Pipe->SetGeometryFileName("beampipe_201309.root");
56  fRun->AddModule(Pipe);
57 
58  //------------------------- MVD -----------------
59  FairDetector *Mvd = new PndMvdDetector("MVD", kTRUE);
60  Mvd->SetGeometryFileName("Mvd-2.1_FullVersion.root");
61  fRun->AddModule(Mvd);
62  // ----- Event generator ----------------------------------------------
63  fRun->SetGenerator();
64 
65  FairPrimaryGenerator* primGen = fRun->GetPrimaryGenerator();
66 
67  FairBoxGenerator* boxGen = new FairBoxGenerator(211, 2); // 13 = muon; 1 = multipl.
68  boxGen->SetPRange(0.5,2.5); // GeV/c
69  boxGen->SetPhiRange(0., 360.); // Azimuth angle range [degree]
70  boxGen->SetThetaRange(5., 150.); // Polar angle in lab system range [degree]
71  boxGen->SetXYZ(0., 0., 0.); // cm
72  primGen->AddGenerator(boxGen);
73 
74  FairBoxGenerator* boxGen2 = new FairBoxGenerator(-211, 2);
75  boxGen2->SetPRange(0.5,2.5);
76  boxGen2->SetPhiRange(0.,360.);
77  boxGen2->SetThetaRange(5., 150.);
78  primGen->AddGenerator(boxGen2);
79 
80  // ----- Add tasks ----------------------------------------------------
81  fRun->AddSimTasks();
82  // ----- Intialise and run --------------------------------------------
83  fRun->Init();
84  fRun->Run(nEvents);
85  fRun->Finish();
86  return 0;
87 }
void Finish()
Final diagnostics.
int sim_mvd(Int_t nEvents=1000, TString SimEngine="TGeant3", Double_t BeamMomentum=1.5)
Definition: QA/mvd/sim_mvd.C:8
PndBoxGenerator * boxGen2
Definition: sim_pid.C:96
Bool_t Setup(TString outprefix="")
Initial setup.
FairDetector * Mvd
Definition: sim_emc_apd.C:51
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
FairRunAna * fRun
Definition: hit_dirc.C:58
void AddSimTasks()
Add simulation tasks.
Double_t
FairModule * Dipole
Definition: sim_emc_apd.C:40
FairModule * Cave
Definition: sim_emc_apd.C:32
Int_t nEvents
Definition: hit_dirc.C:11
void SetNumberOfEvents(Int_t par)
Setter of the number of events.
Class for the master simulation chain.
FairBoxGenerator * boxGen
Definition: sim_emc_apd.C:85
FairModule * Pipe
Definition: sim_emc_apd.C:44
void SetGenerator()
Set the event generator.
Definition: PndCave.h:8