FairRoot/PandaRoot
Functions
runLumiPixel0SimDPMDirect_all.C File Reference

Go to the source code of this file.

Functions

int runLumiPixel0SimDPMDirect_all (const int nEvents=10, const int startEvent=0, const double mom=15, TString storePath="tmpOutputDPM", const int verboseLevel=0, const int seed, const int mode=1, const double th_min=0.12)
 

Function Documentation

int runLumiPixel0SimDPMDirect_all ( const int  nEvents = 10,
const int  startEvent = 0,
const double  mom = 15,
TString  storePath = "tmpOutputDPM",
const int  verboseLevel = 0,
const int  seed,
const int  mode = 1,
const double  th_min = 0.12 
)

Definition at line 7 of file runLumiPixel0SimDPMDirect_all.C.

References Bool_t, Cave, ctime, Dipole, Double_t, dpmGen, Drc, Dsk, Emc, fField, fRun, FTof, Fts, gDebug, Gem, kParameterMerged, Magnet, mode, mom, Muo, Mvd, nEvents, output, parOutput, Pipe, primGen, printf(), rtdb, rtime, PndMdt::SetBarrel(), PndMdt::SetEndcap(), PndSdsDetector::SetExclusiveSensorType(), PndMdt::SetForward(), PndEmc::SetGeometryVersion(), PndMdt::SetMdtMagnet(), PndMdt::SetMdtMFIron(), PndMdt::SetMuonFilter(), PndDrc::SetRunCherenkov(), PndEmc::SetStorageOfData(), PndDsk::SetStoreCerenkovs(), PndDsk::SetStoreTrackPoints(), PndSdsDetector::SetVerboseLevel(), simOutput, startEvent, storePath, Stt, timer, TString, and verboseLevel.

9 {
10  // gRandom->SetSeed(seed);
11  // Int_t mode = 1;
12  TStopwatch timer;
13  timer.Start();
14  gDebug=0;
15 
16  //output1
17  TString simOutput=storePath+"/Lumi_MC_";
18  simOutput += startEvent;
19  simOutput += ".root";
20  TString parOutput=storePath+"/Lumi_Params_";
21  parOutput += startEvent;
22  parOutput += ".root";
23  //Load basic libraries
24  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
25  gSystem->Load("libSds");
26  gSystem->Load("libLmd");
27  FairRunSim *fRun = new FairRunSim();
28  cout<<"All libraries succsesfully loaded!"<<endl;
29 
30  //set the MC version used
31  fRun->SetName("TGeant4");
32 
33  fRun->SetOutputFile(simOutput);
34 
35 
36  //set material
37  fRun->SetMaterials("media_pnd.geo");
38 
39  // // //create and add detectors
40 // // //------------------------- CAVE -----------------
41 
42  FairModule *Cave= new PndCave("CAVE");
43  Cave->SetGeometryFileName("pndcave.geo");
44  //Cave->SetGeometryFileName("../macro/lmd/geo/pndcaveVAC.geo"); //LMD is working in vacuum!
45  fRun->AddModule(Cave);
46  //------------------------- Magnet -----------------
47  FairModule *Magnet= new PndMagnet("MAGNET");
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("../macro/lmd/geo/beampipe_201303.root");
56  Pipe->SetGeometryFileName("beampipe_201309.root");
57  fRun->AddModule(Pipe);
58 
59 
60 
61  //Other PANDA systems ----
62  // //------------------------- STT -----------------
63  // FairDetector *Stt= new PndStt("STT", kTRUE);
64  // Stt->SetGeometryFileName("straws_skewed_blocks_35cm_pipe.geo");
65  // fRun->AddModule(Stt);
66  // //------------------------- MVD -----------------
67  // FairDetector *Mvd = new PndMvdDetector("MVD", kTRUE);
68  // Mvd->SetGeometryFileName("Mvd-2.1_FullVersion.root");
69  // fRun->AddModule(Mvd);
70  // //------------------------- GEM -----------------
71  // FairDetector *Gem = new PndGemDetector("GEM", kTRUE);
72  // Gem->SetGeometryFileName("gem_3Stations.root");
73  // fRun->AddModule(Gem);
74  // //------------------------- EMC -----------------
75  // PndEmc *Emc = new PndEmc("EMC",kTRUE);
76  // Emc->SetGeometryVersion(1);
77  // Emc->SetStorageOfData(kFALSE);
78  // fRun->AddModule(Emc);
79  // //------------------------- SCITIL -----------------
80  // FairDetector *SciT = new PndSciT("SCIT",kTRUE);
81  // SciT->SetGeometryFileName("barrel-SciTil_07022013.root");
82  // fRun->AddModule(SciT);
83  // //------------------------- DRC -----------------
84  // PndDrc *Drc = new PndDrc("DIRC", kTRUE);
85  // Drc->SetGeometryFileName("dirc_l0_p0_updated.root");
86  // Drc->SetRunCherenkov(kFALSE);
87  // fRun->AddModule(Drc);
88  // //------------------------- DISC -----------------
89  // PndDsk* Dsk = new PndDsk("DSK", kTRUE);
90  // Dsk->SetStoreCerenkovs(kFALSE);
91  // Dsk->SetStoreTrackPoints(kFALSE);
92  // fRun->AddModule(Dsk);
93  // //------------------------- MDT -----------------
94  // PndMdt *Muo = new PndMdt("MDT",kTRUE);
95  // Muo->SetBarrel("fast");
96  // Muo->SetEndcap("fast");
97  // Muo->SetMuonFilter("fast");
98  // Muo->SetForward("fast");
99  // Muo->SetMdtMagnet(kTRUE);
100  // Muo->SetMdtMFIron(kTRUE);
101  // fRun->AddModule(Muo);
102  // //------------------------- FTS -----------------
103  // FairDetector *Fts= new PndFts("FTS", kTRUE);
104  // Fts->SetGeometryFileName("fts.geo");
105  // fRun->AddModule(Fts);
106  // //------------------------- FTOF -----------------
107  // FairDetector *FTof = new PndFtof("FTOF",kTRUE);
108  // FTof->SetGeometryFileName("ftofwall.root");
109  // fRun->AddModule(FTof);
110  // //------------------------- RICH ----------------
111  // FairDetector *Rich= new PndRich("RICH",kFALSE);
112  // Rich->SetGeometryFileName("rich_v2_shift.geo");
113  // fRun->AddModule(Rich);
114  // //[END] Other PANDA systems ---
115 
116  //Other PANDA systems ----
117  //------------------------- STT -----------------
118  PndStt *Stt= new PndStt("STT", kFALSE);
119  Stt->SetGeometryFileName("straws_skewed_blocks_35cm_pipe.geo");
120  fRun->AddModule(Stt);
121  //------------------------- MVD -----------------
122  PndMvdDetector *Mvd = new PndMvdDetector("MVD", kFALSE);
123  Mvd->SetGeometryFileName("Mvd-2.1_FullVersion.root");
124  fRun->AddModule(Mvd);
125  //------------------------- GEM -----------------
126  PndGemDetector *Gem = new PndGemDetector("GEM", kFALSE);
127  Gem->SetGeometryFileName("gem_3Stations.root");
128  fRun->AddModule(Gem);
129  //------------------------- EMC -----------------
130  PndEmc *Emc = new PndEmc("EMC",kFALSE);
131  Emc->SetGeometryVersion(1);
132  Emc->SetStorageOfData(kFALSE);
133  fRun->AddModule(Emc);
134  //------------------------- SCITIL -----------------
135  PndSciT *SciT = new PndSciT("SCIT",kFALSE);
136  SciT->SetGeometryFileName("barrel-SciTil_07022013.root");
137  fRun->AddModule(SciT);
138  //------------------------- DRC -----------------
139  PndDrc *Drc = new PndDrc("DIRC", kFALSE);
140  Drc->SetGeometryFileName("dirc_l0_p0_updated.root");
141  Drc->SetRunCherenkov(kFALSE);
142  fRun->AddModule(Drc);
143  //------------------------- DISC -----------------
144  PndDsk* Dsk = new PndDsk("DSK", kFALSE);
145  Dsk->SetStoreCerenkovs(kFALSE);
146  Dsk->SetStoreTrackPoints(kFALSE);
147  fRun->AddModule(Dsk);
148  //------------------------- MDT -----------------
149  PndMdt *Muo = new PndMdt("MDT",kFALSE);
150  Muo->SetBarrel("fast");
151  Muo->SetEndcap("fast");
152  Muo->SetMuonFilter("fast");
153  Muo->SetForward("fast");
154  Muo->SetMdtMagnet(kTRUE);
155  Muo->SetMdtMFIron(kTRUE);
156  fRun->AddModule(Muo);
157  //------------------------- FTS -----------------
158  PndFts *Fts= new PndFts("FTS",kFALSE);
159  Fts->SetGeometryFileName("fts.geo");
160  fRun->AddModule(Fts);
161  //------------------------- FTOF -----------------
162  PndFtof *FTof = new PndFtof("FTOF",kFALSE);
163  FTof->SetGeometryFileName("ftofwall.root");
164  fRun->AddModule(FTof);
165  //------------------------- RICH ----------------
166  PndRich *Rich= new PndRich("RICH",kFALSE);
167  Rich->SetGeometryFileName("rich_v2_shift.geo");
168  fRun->AddModule(Rich);
169  //[END] Other PANDA systems ---
170 
171  PndLmdDetector *Lum = new PndLmdDetector("LUM", kTRUE);
172  Lum->SetExclusiveSensorType("LumActive"); //ignore MVD
173  // Lum->SetGeometryFileName("../macro/lmd/geo/HV_MAPS-Design-29052013.root"); // LMD including box etc
174  Lum->SetGeometryFileName("Luminosity-Detector.root");
176  fRun->AddModule(Lum);
177 
178  //particle generator
179  FairPrimaryGenerator* primGen = new FairPrimaryGenerator();
180 
181  //DPM
182  PndDpmDirect *dpmGen = new PndDpmDirect(mom,mode,seed,th_min);
183  primGen->AddGenerator(dpmGen);
184  fRun->SetGenerator(primGen);
185 
186  //reading the new field map in the old format
187  fRun->SetBeamMom(mom);
188 
189  PndMultiField *fField= new PndMultiField("AUTO");
190 
191  // //TMP: read mag.field maps one by one to make sure that 1.5 GeV/c case is treated correctly
192  // PndMultiField *fField= new PndMultiField();
193  // PndTransMap *map_t = new PndTransMap("TransMap", "R");
194  // PndDipoleMap *map_d1 = new PndDipoleMap("DipoleMap1", "R");
195  // PndDipoleMap *map_d2 = new PndDipoleMap("DipoleMap2", "R");
196  // fField->AddField(map_t);
197  // fField->AddField(map_d1);
198  // fField->AddField(map_d2);
199  // PndSolenoidMap *map_s1 = new PndSolenoidMap("SolenoidMap1", "R");
200  // PndSolenoidMap *map_s2 = new PndSolenoidMap("SolenoidMap2", "R");
201  // PndSolenoidMap *map_s3 = new PndSolenoidMap("SolenoidMap3", "R");
202  // PndSolenoidMap *map_s4 = new PndSolenoidMap("SolenoidMap4", "R");
203  // fField->AddField(map_s1);
204  // fField->AddField(map_s2);
205  // fField->AddField(map_s3);
206  // fField->AddField(map_s4);
207 
208  fRun->SetField(fField);
209 
210  //TEST!!!
211  if(nEvents<10)
212  fRun->SetStoreTraj(kTRUE); // toggle this for use with EVE
213  else
214  fRun->SetStoreTraj(kFALSE);
215 
216 
217  //FairLogger
218  // get handle
219  FairLogger *logger = FairLogger::GetLogger();
220  //
221  // log to screen and to file
222  logger->SetLogToScreen(kTRUE);
223  logger->SetLogToFile(kFALSE);
224 
225  logger->SetLogVerbosityLevel("LOW");
226 
227  // Set different levels of verbosity. In the example everything >=INFO goes to the
228  // file and everything >= ERROR is printed on the screen
229  // LogLevels are (FATAL, ERROR, WARNING, INFO, DEBUG, DEBUG1, DEBUG2, DEBUG3, DEBUG4)
230  logger->SetLogScreenLevel("ERROR"); //Only FATAL and ERROR to screen
231 
232 
233  fRun->Init();
234 
235 
236  // // Fill the Parameter containers for this run
237  // //-------------------------------------------
238  FairRuntimeDb *rtdb=fRun->GetRuntimeDb();
239  Bool_t kParameterMerged=kTRUE;
240  FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
241  output->open(parOutput.Data(),"RECREATE");
242  rtdb->setOutput(output);
243 
244  // PndMultiFieldPar* Par = (PndMultiFieldPar*) rtdb->getContainer("PndMultiFieldPar");
245  // if (fField) { Par->SetParameters(fField); }
246  // Par->setInputVersion(fRun->GetRunId(),1);
247  // Par->setChanged();
248 
249  // Transport nEvents
250  // -----------------
251 
252  fRun->Run(nEvents);
253 
254  rtdb->saveOutput();
255  rtdb->print();
256 
257 
258  timer.Stop();
259  Double_t rtime = timer.RealTime();
260  Double_t ctime = timer.CpuTime();
261  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
262  return 0;
263 }
PndDrc * Drc
Definition: sim_emc_apd.C:75
PndMultiField * fField
Definition: sim_emc_apd.C:97
void SetForward(TString name)
Definition: PndMdt.h:34
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
FairDetector * FTof
Definition: sim_ftof.C:49
int verboseLevel
Definition: Lars/runMvdSim.C:7
Bool_t kParameterMerged
Definition: sim_emc_apd.C:113
void SetExclusiveSensorType(const TString sens)
PndDpmGenerator * dpmGen
PndEmc * Emc
Definition: sim_emc_apd.C:55
Int_t startEvent
FairDetector * Mvd
Definition: sim_emc_apd.C:51
void SetMdtMFIron(bool opt=false)
Definition: PndMdt.h:29
TString storePath
Double_t mom
Definition: plot_dirc.C:14
void SetStorageOfData(Bool_t val)
Definition: PndEmc.cxx:941
FairParRootFileIo * output
Definition: sim_emc_apd.C:120
PndMdt * Muo
Definition: sim_emc_apd.C:67
Simulation of EMC.
Definition: PndEmc.h:26
FairPrimaryGenerator * primGen
Definition: sim_emc_apd.C:81
FairDetector * Dsk
Definition: run_DpmSim.C:66
TString parOutput
FairRunAna * fRun
Definition: hit_dirc.C:58
FairDetector * Gem
Definition: runJohan.C:71
Int_t mode
Definition: autocutx.C:47
void SetMdtMagnet(bool opt=false)
Definition: PndMdt.h:27
void SetStoreTrackPoints(Bool_t storeTrackPoints)
Definition: PndDsk.h:148
FairDetector * Stt
Definition: sim_emc_apd.C:47
Double_t
void SetStoreCerenkovs(Bool_t storeCerenkovs)
Definition: PndDsk.h:146
FairModule * Dipole
Definition: sim_emc_apd.C:40
FairModule * Cave
Definition: sim_emc_apd.C:32
Definition: PndDrc.h:31
Int_t nEvents
Definition: hit_dirc.C:11
unsigned int seed
TStopwatch timer
Definition: hit_dirc.C:51
virtual void SetGeometryVersion(const Int_t GeoNumber)
Definition: PndEmc.cxx:966
void SetBarrel(TString name)
Definition: PndMdt.h:31
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
gDebug
Definition: sim_emc_apd.C:6
Double_t ctime
Definition: hit_dirc.C:114
void SetEndcap(TString name)
Definition: PndMdt.h:32
void SetMuonFilter(TString name)
Definition: PndMdt.h:33
TString simOutput
void SetRunCherenkov(Bool_t ch)
Definition: PndDrc.h:222
Definition: PndStt.h:34
Definition: PndMdt.h:20
void SetVerboseLevel(Int_t level)
FairModule * Pipe
Definition: sim_emc_apd.C:44
Double_t rtime
Definition: hit_dirc.C:113
FairDetector * Fts
Definition: sim_ftof_stof.C:58
Definition: PndDsk.h:23
FairModule * Magnet
Definition: sim_emc_apd.C:36
Definition: PndFts.h:25
Definition: PndCave.h:8