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

Go to the source code of this file.

Functions

int digi_LMD (const int nEvents=2000, const int startEvent=0, TString storePath="", const int verboseLevel=0)
 

Function Documentation

int digi_LMD ( const int  nEvents = 2000,
const int  startEvent = 0,
TString  storePath = "",
const int  verboseLevel = 0 
)

Definition at line 3 of file detectors/lmd/digi_LMD.C.

References ctime, digiparFile, Double_t, fRun, geoPar, inFile, nEvents, outFile, parFile, parInput1, parInput2, rtdb, rtime, startEvent, storePath, timer, TString, and verboseLevel.

4 {
5  // ----- Timer --------------------------------------------------------
6  TStopwatch timer;
7  timer.Start();
8 
9  // Input file (MC events)
10  TString inFile=storePath+"Lumi_MC_";
11  inFile += startEvent;
12  inFile += ".root";
13  // Parameter file
14  TString parFile=storePath+"Lumi_Params_";
15  parFile += startEvent;
16  parFile += ".root";
17 
18  // Parameter file
19  TString digiparFile = "../params/lumi.digi.par";
20 
21  // In general, the following parts need not be touched
22  // ========================================================================
23  // Output file
24  TString outFile = storePath+"Lumi_digi_";
25  outFile += startEvent;
26  outFile += ".root";
27  std::cout << "DigiFileName: " << outFile.Data() << std::endl;
28 
29  // ----- Reconstruction run -------------------------------------------
30  FairRunAna *fRun= new FairRunAna();
31  fRun->SetInputFile(inFile);
32  fRun->SetOutputFile(outFile);
33 // fRun->SetEventMeanTime(50);//[ns] 50= interaction rate 20 MHz;
34  fRun->SetEventMeanTime(80);//[ns] 80= interaction rate 12.5 MHz;
35  // example: cross-section(DPM el+inlel, 1.5 GeV/c)= 125 mb, L=10^32 -> interaction rate 12.5 MHz
36  // fRun->SetEventMeanTime(800);//[ns] 800= interaction rate 5 MHz; //15 GeV
37 
38  // ----- Parameter database --------------------------------------------
39  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
40  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
41  parInput1->open(parFile.Data(),"UPDATE");
42  rtdb->setFirstInput(parInput1);
43  FairParAsciiFileIo* parInput2 = new FairParAsciiFileIo();
44  parInput2->open(digiparFile.Data(),"in");
45  rtdb->setSecondInput(parInput2);
46 
47  // fRun->LoadGeometry();
48 
49 
50  // ----- Digitization ---------------------------------------
51  // =========================================================================
52  // ====== Hit Producers ======
53  // =========================================================================
54 
56  lmdStripProd->SetVerbose(verboseLevel);
57  fRun->AddTask(lmdStripProd);
58 
59  rtdb->setOutput(parInput1);
60  rtdb->print();
61  // ===== End of HitProducers =====
62  // =========================================================================
63  PndSdsGeoPar* geoPar = (PndSdsGeoPar*)(rtdb->getContainer("PndSdsGeoPar"));
64 
65  // ----- Intialise and run --------------------------------------------
66  fRun->Init();
67  fRun->Run(0,nEvents);
68  rtdb->saveOutput();
69  rtdb->print();
70 
71  // ----- Finish -------------------------------------------------------
72  timer.Stop();
73  Double_t rtime = timer.RealTime();
74  Double_t ctime = timer.CpuTime();
75  cout << endl << endl;
76  cout << "Macro finished succesfully." << endl;
77  cout << "Output file is " << outFile << endl;
78  cout << "Parameter file is " << parFile << endl;
79  cout << "Real time " << rtime << " s, CPU time " << ctime << " s\a\a" << endl;
80  cout << endl;
81 
82  return 0;
83 }
int verboseLevel
Definition: Lars/runMvdSim.C:7
PndMvdGeoPar * geoPar
TString outFile
Definition: hit_dirc.C:17
Int_t startEvent
TString storePath
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
Double_t
TString parFile
Definition: hit_dirc.C:14
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
FairParAsciiFileIo * parInput2
Definition: conMvdDigi.C:26
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
Double_t rtime
Definition: hit_dirc.C:113
TString digiparFile