FairRoot/PandaRoot
Functions
runLumiPixel1bDigiNoise.C File Reference

Go to the source code of this file.

Functions

int runLumiPixel1bDigiNoise (const int nEvents=10, const int startEvent=0, TString storePath="tmpOutput", const int verboseLevel=0, const int pitch=1, const unsigned int seed=0)
 

Function Documentation

int runLumiPixel1bDigiNoise ( const int  nEvents = 10,
const int  startEvent = 0,
TString  storePath = "tmpOutput",
const int  verboseLevel = 0,
const int  pitch = 1,
const unsigned int  seed = 0 
)

Definition at line 1 of file runLumiPixel1bDigiNoise.C.

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

2 {
3  // ----- Timer --------------------------------------------------------
4  TStopwatch timer;
5  timer.Start();
6 
7  gRandom->SetSeed(seed);
8 
9  // gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
10  // gSystem->Load("libSds");
11  // gSystem->Load("libSdsReco");
12  // gSystem->Load("libLmd");
13  // gSystem->Load("libLmdReco");
14  // gSystem->Load("libLmdTrk");
15 
16  // Input file (MC events)
17  TString inFile=storePath+"/Lumi_MC_";
18  inFile += startEvent;
19  inFile += ".root";
20  // Parameter file
21  TString parFile=storePath+"/Lumi_Params_";
22  parFile += startEvent;
23  parFile += ".root";
24  TString DigiFile = storePath+"/Lumi_digi_";
25  DigiFile += startEvent;
26  DigiFile += ".root";
27 
28  // Parameter file
29  TString digiparFile = "lumi.digi.par";
30  //TString digiparFile = "noMClumi.digi.par";
31  // TString digiparFile = "lumi";
32  // switch(pitch){
33  // case 0:{
34  // digiparFile += "50";
35  // break;}
36  // }
37 
38  // digiparFile += ".digi.par";
39 
40  // cout<<"digiparFile = "<<digiparFile<<endl;
41  // In general, the following parts need not be touched
42  // ========================================================================
43  // Output file
44  TString outFile = storePath+"/Lumi_digi_";//noise_";
45  outFile += startEvent;
46  outFile += ".root";
47  std::cout << "DigiFile: " << DigiFile.Data()<< std::endl;
48  std::cout << "RecoFile: " << outFile.Data()<< std::endl;
49 
50  // ----- Reconstruction run -------------------------------------------
51  FairRunAna *fRun= new FairRunAna();
52  fRun->SetInputFile(inFile);
53  fRun->SetOutputFile(outFile);
54  // fRun->SetEventMeanTime(50);//[ns] 50= interaction rate 20 MHz;
55  fRun->SetEventMeanTime(80);//[ns] 80= interaction rate 12.5 MHz;
56  // example: cross-section(DPM el+inlel, 1.5 GeV/c)= 125 mb, L=10^32 -> interaction rate 12.5 MHz
57  // fRun->SetEventMeanTime(400);//[ns] 400= interaction rate 5 MHz; //15 GeV
58 
59  // ----- Parameter database --------------------------------------------
60  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
61  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
62  parInput1->open(parFile.Data(),"UPDATE");
63  rtdb->setFirstInput(parInput1);
64 // Bool_t kParameterMerged=kTRUE;
65 // FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
66 // output->open(parOutFile);
67 // rtdb->setOutput(output);
68  FairParAsciiFileIo* parInput2 = new FairParAsciiFileIo();
69  parInput2->open(digiparFile.Data(),"in");
70  rtdb->setSecondInput(parInput2);
71 
72  // fRun->LoadGeometry();
73 
74 
75  // ----- Digitization ---------------------------------------
76 // PndMvdDigiTask* mvddigi = new PndMvdDigiTask();
77 // mvddigi->SetVerbose(verboseLevel);
78 // fRun->AddTask(mvddigi);
79  // =========================================================================
80  // ====== Hit Producers ======
81  // =========================================================================
82 
83  // ----- MVD Strip hit producer ---------------------------------------
84 // double topPitch=0.015,
85 // botPitch=0.015,
86 // orient=TMath::Pi()*(0.5),
87 // skew=TMath::Pi()*(0.5);
88 // TVector2 topAnchor(0.,0.);
89 // TVector2 botAnchor(0.,0.);
90 // int topFE = 10,
91 // botFE = 4,
92 // nrFEChannels = 128;
93 // double threshold=3000., noise=1000.;
94 // PndMvdStripHitProducer* mvdStripProd
95 // = new PndMvdStripHitProducer(topPitch, botPitch,
96 // orient, skew,
97 // topAnchor,botAnchor,
98 // topFE, botFE, nrFEChannels,
99 // threshold, noise);
100 
101  PndLmdNoiseProducer* lmdNoiseProd = new PndLmdNoiseProducer();
102  // PndLmdStripHitProducerDif* ssdStripProd = new PndLmdStripHitProducerDif(); //TEST
103  lmdNoiseProd->SetVerbose(verboseLevel);
104  fRun->AddTask(lmdNoiseProd);
105  // ----- MVD Pixel hit producer ---------------------------------------
106 // Double_t lx=0.01, ly=0.01, threshold=600, noise=200;
107 // PndMvdHybridHitProducer* mvdPixProd = new PndMvdHybridHitProducer(lx,ly,threshold,noise);
108  // PndSsdHybridHitProducer* ssdPixProd = new PndSsdHybridHitProducer();
109  // ssdPixProd->SetVerbose(verboseLevel);
110  // fRun->AddTask(ssdPixProd);
111 
112  // PndLmdNoiseProducer* lmdNoiseMaker = new PndLmdNoiseProducer();
113  // lmdNoiseMaker->SetVerbose(verboseLevel);
114  // fRun->AddTask(lmdNoiseMaker);
115 
116 
117 // FairParRootFileIo* output=new FairParRootFileIo(kTRUE);
118 // output->open(parOutFile.Data());
119 // rtdb->setOutput(output);
120  rtdb->setOutput(parInput1);
121  rtdb->print();
122  // ===== End of HitProducers =====
123  // =========================================================================
124  PndSdsGeoPar* geoPar = (PndSdsGeoPar*)(rtdb->getContainer("PndSdsGeoPar"));
125 
126  // ----- Intialise and run --------------------------------------------
127  fRun->Init();
128  fRun->Run(0,nEvents);
129  rtdb->saveOutput();
130  rtdb->print();
131 
132  // ----- Finish -------------------------------------------------------
133  timer.Stop();
134  Double_t rtime = timer.RealTime();
135  Double_t ctime = timer.CpuTime();
136  cout << endl << endl;
137  cout << "Macro finished succesfully." << endl;
138  cout << "Output file is " << outFile << endl;
139  cout << "Parameter file is " << parFile << endl;
140  cout << "Real time " << rtime << " s, CPU time " << ctime << " s\a\a" << endl;
141  cout << endl;
142 
143  return 0;
144 }
int verboseLevel
Definition: Lars/runMvdSim.C:7
PndMvdGeoPar * geoPar
TString outFile
Definition: hit_dirc.C:17
Int_t startEvent
TString storePath
TString inFile
Definition: hit_dirc.C:8
FairRunAna * fRun
Definition: hit_dirc.C:58
TString DigiFile
Double_t
TString parFile
Definition: hit_dirc.C:14
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
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