FairRoot/PandaRoot
Functions
runLumiPixel0SimFTFDirect.C File Reference

Go to the source code of this file.

Functions

int runLumiPixel0SimFTFDirect (const int nEvents=10, const int startEvent=0, const double mom=15, TString storePath="tmpOutputDPM", const int verboseLevel=0, const int seed)
 

Function Documentation

int runLumiPixel0SimFTFDirect ( const int  nEvents = 10,
const int  startEvent = 0,
const double  mom = 15,
TString  storePath = "tmpOutputDPM",
const int  verboseLevel = 0,
const int  seed 
)

Definition at line 7 of file runLumiPixel0SimFTFDirect.C.

References Bool_t, Cave, ctime, Dipole, Double_t, fField, fRun, gDebug, kParameterMerged, Magnet, mom, nEvents, output, parOutput, Pipe, primGen, printf(), rtdb, rtime, PndSdsDetector::SetExclusiveSensorType(), PndSdsDetector::SetVerboseLevel(), simOutput, startEvent, storePath, 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("pndcaveVAC.geo"); //vac cave is not really necessary
45  //Cave->SetGeometryFileName("../macro/lmd/geo/pndcaveVAC.geo"); //LMD is working in vacuum!
46  fRun->AddModule(Cave);
47  //------------------------- Magnet -----------------
48  FairModule *Magnet= new PndMagnet("MAGNET");
49  Magnet->SetGeometryFileName("FullSuperconductingSolenoid_v831.root");
50  fRun->AddModule(Magnet);
51  FairModule *Dipole= new PndMagnet("MAGNET");
52  Dipole->SetGeometryFileName("dipole.geo");
53  fRun->AddModule(Dipole);
54  //------------------------- Pipe -----------------
55  FairModule *Pipe= new PndPipe("PIPE");
56  // Pipe->SetGeometryFileName("../macro/lmd/geo/beampipe_201303.root");
57  Pipe->SetGeometryFileName("beampipe_201309.root");
58  fRun->AddModule(Pipe);
59 
60  PndLmdDetector *Lum = new PndLmdDetector("LUM", kTRUE);
61  Lum->SetExclusiveSensorType("LumActive"); //ignore MVD
62  // Lum->SetGeometryFileName("../macro/lmd/geo/HV_MAPS-Design-29052013.root"); // LMD including box etc
63  Lum->SetGeometryFileName("Luminosity-Detector.root");
65  fRun->AddModule(Lum);
66 
67  //Other PANDA systems ----
68  // //------------------------- STT -----------------
69  // FairDetector *Stt= new PndStt("STT", kTRUE);
70  // Stt->SetGeometryFileName("straws_skewed_blocks_35cm_pipe.geo");
71  // fRun->AddModule(Stt);
72  // //------------------------- MVD -----------------
73  // FairDetector *Mvd = new PndMvdDetector("MVD", kTRUE);
74  // Mvd->SetGeometryFileName("Mvd-2.1_FullVersion.root");
75  // fRun->AddModule(Mvd);
76  // //------------------------- GEM -----------------
77  // FairDetector *Gem = new PndGemDetector("GEM", kTRUE);
78  // Gem->SetGeometryFileName("gem_3Stations.root");
79  // fRun->AddModule(Gem);
80  // //------------------------- EMC -----------------
81  // PndEmc *Emc = new PndEmc("EMC",kTRUE);
82  // Emc->SetGeometryVersion(1);
83  // Emc->SetStorageOfData(kFALSE);
84  // fRun->AddModule(Emc);
85  // //------------------------- SCITIL -----------------
86  // FairDetector *SciT = new PndSciT("SCIT",kTRUE);
87  // SciT->SetGeometryFileName("barrel-SciTil_07022013.root");
88  // fRun->AddModule(SciT);
89  // //------------------------- DRC -----------------
90  // PndDrc *Drc = new PndDrc("DIRC", kTRUE);
91  // Drc->SetGeometryFileName("dirc_l0_p0_updated.root");
92  // Drc->SetRunCherenkov(kFALSE);
93  // fRun->AddModule(Drc);
94  // //------------------------- DISC -----------------
95  // PndDsk* Dsk = new PndDsk("DSK", kTRUE);
96  // Dsk->SetStoreCerenkovs(kFALSE);
97  // Dsk->SetStoreTrackPoints(kFALSE);
98  // fRun->AddModule(Dsk);
99  // //------------------------- MDT -----------------
100  // PndMdt *Muo = new PndMdt("MDT",kTRUE);
101  // Muo->SetBarrel("fast");
102  // Muo->SetEndcap("fast");
103  // Muo->SetMuonFilter("fast");
104  // Muo->SetForward("fast");
105  // Muo->SetMdtMagnet(kTRUE);
106  // Muo->SetMdtMFIron(kTRUE);
107  // fRun->AddModule(Muo);
108  // //------------------------- FTS -----------------
109  // FairDetector *Fts= new PndFts("FTS", kTRUE);
110  // Fts->SetGeometryFileName("fts.geo");
111  // fRun->AddModule(Fts);
112  // //------------------------- FTOF -----------------
113  // FairDetector *FTof = new PndFtof("FTOF",kTRUE);
114  // FTof->SetGeometryFileName("ftofwall.root");
115  // fRun->AddModule(FTof);
116  // //------------------------- RICH ----------------
117  // FairDetector *Rich= new PndRich("RICH",kFALSE);
118  // Rich->SetGeometryFileName("rich_v2_shift.geo");
119  // fRun->AddModule(Rich);
120  // //[END] Other PANDA systems ---
121 
122  // //Other PANDA systems ----
123  // //------------------------- STT -----------------
124  // PndStt *Stt= new PndStt("STT", kFALSE);
125  // Stt->SetGeometryFileName("straws_skewed_blocks_35cm_pipe.geo");
126  // fRun->AddModule(Stt);
127  // //------------------------- MVD -----------------
128  // PndMvdDetector *Mvd = new PndMvdDetector("MVD", kFALSE);
129  // Mvd->SetGeometryFileName("Mvd-2.1_FullVersion.root");
130  // fRun->AddModule(Mvd);
131  // //------------------------- GEM -----------------
132  // PndGemDetector *Gem = new PndGemDetector("GEM", kFALSE);
133  // Gem->SetGeometryFileName("gem_3Stations.root");
134  // fRun->AddModule(Gem);
135  // //------------------------- EMC -----------------
136  // PndEmc *Emc = new PndEmc("EMC",kFALSE);
137  // Emc->SetGeometryVersion(1);
138  // Emc->SetStorageOfData(kFALSE);
139  // fRun->AddModule(Emc);
140  // //------------------------- SCITIL -----------------
141  // PndSciT *SciT = new PndSciT("SCIT",kFALSE);
142  // SciT->SetGeometryFileName("barrel-SciTil_07022013.root");
143  // fRun->AddModule(SciT);
144  // //------------------------- DRC -----------------
145  // PndDrc *Drc = new PndDrc("DIRC", kFALSE);
146  // Drc->SetGeometryFileName("dirc_l0_p0_updated.root");
147  // Drc->SetRunCherenkov(kFALSE);
148  // fRun->AddModule(Drc);
149  // //------------------------- DISC -----------------
150  // PndDsk* Dsk = new PndDsk("DSK", kFALSE);
151  // Dsk->SetStoreCerenkovs(kFALSE);
152  // Dsk->SetStoreTrackPoints(kFALSE);
153  // fRun->AddModule(Dsk);
154  // //------------------------- MDT -----------------
155  // PndMdt *Muo = new PndMdt("MDT",kFALSE);
156  // Muo->SetBarrel("fast");
157  // Muo->SetEndcap("fast");
158  // Muo->SetMuonFilter("fast");
159  // Muo->SetForward("fast");
160  // Muo->SetMdtMagnet(kTRUE);
161  // Muo->SetMdtMFIron(kTRUE);
162  // fRun->AddModule(Muo);
163  // //------------------------- FTS -----------------
164  // PndFts *Fts= new PndFts("FTS",kFALSE);
165  // Fts->SetGeometryFileName("fts.geo");
166  // fRun->AddModule(Fts);
167  // //------------------------- FTOF -----------------
168  // PndFtof *FTof = new PndFtof("FTOF",kFALSE);
169  // FTof->SetGeometryFileName("ftofwall.root");
170  // fRun->AddModule(FTof);
171  // //------------------------- RICH ----------------
172  // PndRich *Rich= new PndRich("RICH",kFALSE);
173  // Rich->SetGeometryFileName("rich_v2_shift.geo");
174  // fRun->AddModule(Rich);
175  // //[END] Other PANDA systems ---
176 
177 
178  //particle generator
179  FairPrimaryGenerator* primGen = new FairPrimaryGenerator();
180 
181  //FTF
182  TString macfile = gSystem->Getenv("VMCWORKDIR");
183  macfile += "/pgenerators/FtfEvtGen/PbarP.mac";
184  PndFtfDirect *Ftf = new PndFtfDirect(macfile.Data());
185  primGen->AddGenerator(Ftf);
186  fRun->SetGenerator(primGen);
187 
188 
189  fRun->SetBeamMom(mom);
190  PndMultiField *fField= new PndMultiField("AUTO");
191 
192  // //TMP: read mag.field maps one by one to make sure that 1.5 GeV/c case is treated correctly
193  // PndMultiField *fField= new PndMultiField();
194  // PndTransMap *map_t = new PndTransMap("TransMap", "R");
195  // PndDipoleMap *map_d1 = new PndDipoleMap("DipoleMap1", "R");
196  // PndDipoleMap *map_d2 = new PndDipoleMap("DipoleMap2", "R");
197  // fField->AddField(map_t);
198  // fField->AddField(map_d1);
199  // fField->AddField(map_d2);
200  // PndSolenoidMap *map_s1 = new PndSolenoidMap("SolenoidMap1", "R");
201  // PndSolenoidMap *map_s2 = new PndSolenoidMap("SolenoidMap2", "R");
202  // PndSolenoidMap *map_s3 = new PndSolenoidMap("SolenoidMap3", "R");
203  // PndSolenoidMap *map_s4 = new PndSolenoidMap("SolenoidMap4", "R");
204  // fField->AddField(map_s1);
205  // fField->AddField(map_s2);
206  // fField->AddField(map_s3);
207  // fField->AddField(map_s4);
208 
209  fRun->SetField(fField);
210 
211  //TEST!!!
212  if(nEvents<10)
213  fRun->SetStoreTraj(kTRUE); // toggle this for use with EVE
214  else
215  fRun->SetStoreTraj(kFALSE);
216 
217 
218  //FairLogger
219  // get handle
220  FairLogger *logger = FairLogger::GetLogger();
221  //
222  // log to screen and to file
223  logger->SetLogToScreen(kTRUE);
224  logger->SetLogToFile(kFALSE);
225 
226  logger->SetLogVerbosityLevel("LOW");
227 
228  // Set different levels of verbosity. In the example everything >=INFO goes to the
229  // file and everything >= ERROR is printed on the screen
230  // LogLevels are (FATAL, ERROR, WARNING, INFO, DEBUG, DEBUG1, DEBUG2, DEBUG3, DEBUG4)
231  logger->SetLogScreenLevel("ERROR"); //Only FATAL and ERROR to screen
232 
233 
234  fRun->Init();
235 
236 
237  // // Fill the Parameter containers for this run
238  // //-------------------------------------------
239  FairRuntimeDb *rtdb=fRun->GetRuntimeDb();
240  Bool_t kParameterMerged=kTRUE;
241  FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
242  output->open(parOutput.Data(),"RECREATE");
243  rtdb->setOutput(output);
244 
245  // PndMultiFieldPar* Par = (PndMultiFieldPar*) rtdb->getContainer("PndMultiFieldPar");
246  // if (fField) { Par->SetParameters(fField); }
247  // Par->setInputVersion(fRun->GetRunId(),1);
248  // Par->setChanged();
249 
250  // Transport nEvents
251  // -----------------
252 
253  fRun->Run(nEvents);
254 
255  rtdb->saveOutput();
256  rtdb->print();
257 
258 
259  timer.Stop();
260  Double_t rtime = timer.RealTime();
261  Double_t ctime = timer.CpuTime();
262  printf("RealTime=%f seconds, CpuTime=%f seconds\n",rtime,ctime);
263  return 0;
264 }
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)
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
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
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