FairRoot/PandaRoot
Functions
detectors/lmd/sim_LMD.C File Reference

Go to the source code of this file.

Functions

int sim_LMD (const int nEvents=2000, const int startEvent=0, const double mom=1.5, TString storePath="", const int verboseLevel=0, const int seed=3267, const int mode=1, const double th_min=0.12)
 

Function Documentation

int sim_LMD ( const int  nEvents = 2000,
const int  startEvent = 0,
const double  mom = 1.5,
TString  storePath = "",
const int  verboseLevel = 0,
const int  seed = 3267,
const int  mode = 1,
const double  th_min = 0.12 
)

Definition at line 7 of file detectors/lmd/sim_LMD.C.

References Bool_t, Cave, ctime, Dipole, Double_t, dpmGen, fField, fRun, gDebug, kParameterMerged, Magnet, mode, mom, nEvents, output, parOutput, Pipe, primGen, printf(), rtdb, rtime, seed, PndSdsDetector::SetExclusiveSensorType(), PndSdsDetector::SetVerboseLevel(), simOutput, startEvent, storePath, timer, TString, and verboseLevel.

9 {
10  TStopwatch timer;
11  timer.Start();
12  gDebug=0;
13 
14  //output1
15  TString simOutput=storePath+"Lumi_MC_";
16  simOutput += startEvent;
17  simOutput += ".root";
18  TString parOutput=storePath+"Lumi_Params_";
19  parOutput += startEvent;
20  parOutput += ".root";
21 
22  FairRunSim *fRun = new FairRunSim();
23 
24  //set the MC version used
25  fRun->SetName("TGeant4");
26  //fRun->SetName("TGeant3");
27 
28  fRun->SetOutputFile(simOutput);
29 
30 
31  //set material
32  fRun->SetMaterials("media_pnd.geo");
33 
34  // // //create and add detectors
35 // // //------------------------- CAVE -----------------
36 
37  FairModule *Cave= new PndCave("CAVE");
38  Cave->SetGeometryFileName("pndcave.geo");
39  fRun->AddModule(Cave);
40  //------------------------- Magnet -----------------
41  FairModule *Magnet= new PndMagnet("MAGNET");
42  Magnet->SetGeometryFileName("FullSolenoid_V842.root");
43  fRun->AddModule(Magnet);
44  FairModule *Dipole= new PndMagnet("MAGNET");
45  Dipole->SetGeometryFileName("dipole.geo");
46  fRun->AddModule(Dipole);
47  //------------------------- Pipe -----------------
48  FairModule *Pipe= new PndPipe("PIPE");
49  Pipe->SetGeometryFileName("beampipe_201407.root");
50  fRun->AddModule(Pipe);
51 
52  //------------------------- LMD -----------------
53  PndLmdDetector *Lum = new PndLmdDetector("LUM", kTRUE);
54  Lum->SetExclusiveSensorType("LumActive"); //ignore MVD
55  Lum->SetGeometryFileName("Luminosity-Detector.root");
57  fRun->AddModule(Lum);
58 
59 
60  //particle generator
61  FairPrimaryGenerator* primGen = new FairPrimaryGenerator();
62 
63  //DPM
65  primGen->AddGenerator(dpmGen);
66  fRun->SetGenerator(primGen);
67 
68  //reading the new field map in the old format
69  fRun->SetBeamMom(mom);
70 
71  PndMultiField *fField= new PndMultiField("AUTO");
72  fRun->SetField(fField);
73 
74  if(nEvents<10)
75  fRun->SetStoreTraj(kTRUE); // toggle this for use with EVE
76  else
77  fRun->SetStoreTraj(kFALSE);
78 
79 
80  //FairLogger
81  // get handle
82  FairLogger *logger = FairLogger::GetLogger();
83  //
84  // log to screen and to file
85  logger->SetLogToScreen(kTRUE);
86  logger->SetLogToFile(kFALSE);
87 
88  logger->SetLogVerbosityLevel("LOW");
89 
90  // Set different levels of verbosity. In the example everything >=INFO goes to the
91  // file and everything >= ERROR is printed on the screen
92  // LogLevels are (FATAL, ERROR, WARNING, INFO, DEBUG, DEBUG1, DEBUG2, DEBUG3, DEBUG4)
93  logger->SetLogScreenLevel("ERROR"); //Only FATAL and ERROR to screen
94 
95  fRun->Init();
96 
97 
98  // // Fill the Parameter containers for this run
99  // //-------------------------------------------
100  FairRuntimeDb *rtdb=fRun->GetRuntimeDb();
101  Bool_t kParameterMerged=kTRUE;
102  FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
103  output->open(parOutput.Data(),"RECREATE");
104  rtdb->setOutput(output);
105 
106 
107  // Transport nEvents
108  // -----------------
109 
110  fRun->Run(nEvents);
111 
112  rtdb->saveOutput();
113  rtdb->print();
114 
115 
116  timer.Stop();
117  Double_t rtime = timer.RealTime();
118  Double_t ctime = timer.CpuTime();
119  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
120  return 0;
121 }
PndMultiField * fField
Definition: sim_emc_apd.C:97
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
int verboseLevel
Definition: Lars/runMvdSim.C:7
Bool_t kParameterMerged
Definition: sim_emc_apd.C:113
void SetExclusiveSensorType(const TString sens)
PndDpmGenerator * dpmGen
Int_t startEvent
TString storePath
Double_t mom
Definition: plot_dirc.C:14
FairParRootFileIo * output
Definition: sim_emc_apd.C:120
FairPrimaryGenerator * primGen
Definition: sim_emc_apd.C:81
TString parOutput
FairRunAna * fRun
Definition: hit_dirc.C:58
Int_t mode
Definition: autocutx.C:47
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
unsigned int seed
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
gDebug
Definition: sim_emc_apd.C:6
Double_t ctime
Definition: hit_dirc.C:114
TString simOutput
void SetVerboseLevel(Int_t level)
FairModule * Pipe
Definition: sim_emc_apd.C:44
Double_t rtime
Definition: hit_dirc.C:113
FairModule * Magnet
Definition: sim_emc_apd.C:36
Definition: PndCave.h:8