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