FairRoot/PandaRoot
Tobias/runMvdDigi.C
Go to the documentation of this file.
1 {
2  // ----- Timer --------------------------------------------------------
3  TStopwatch timer;
4  timer.Start();
5 
6  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
7  Int_t iVerbose = 0;
8  Int_t nStart = 400;
9  Int_t nEvents = 1000;
10 // gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
11  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
12  // Input file (MC events)
13  //TString inFile = "Mvd_DPMfixed_4GeV_10000.root"; //"MvdG4_DPM405_Mag_5000.root";
14  //TString inFile = "data/mvdparams.root";
15  TString inFile = "MvdTpc_D+D-_10G_1000.root";
16  // Parameter file
17  TString parFile = "MvdParams.root";
18  //TString parFile = "data/mvdparams.root";
19  // Parameter output file
20 // TString parOutFile = "Test/testParamsOutput.root";
21  TString sysFile = gSystem->Getenv("VMCWORKDIR");
23  MvdDigiparFile += "/macro/params/all.par";
24 
25 
26 
27  // In general, the following parts need not be touched
28  // ========================================================================
29  // Output file
30  PndFileNameCreator creator(inFile.Data());
31  TString outFile = creator.GetDigiFileName().c_str(); //"MvdG4_DPM405_Mag_5000_digi.root";
32  std::cout << "DigiFileName: " << outFile.Data() << std::endl;
33 
34  // ----- Reconstruction run -------------------------------------------
35  FairRunAna *fRun= new FairRunAna();
36  fRun->SetInputFile(inFile);
37  fRun->SetOutputFile(outFile);
38 
39 
40  // ----- Parameter database --------------------------------------------
41  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
42  FairParRootFileIo* parInput1 = new FairParRootFileIo(kTRUE);
43  parInput1->open(parFile.Data(),"UPDATE");
44  rtdb->setFirstInput(parInput1);
45 // Bool_t kParameterMerged=kTRUE;
46 // FairParRootFileIo* output=new FairParRootFileIo(kParameterMerged);
47 // output->open(parOutFile);
48 // rtdb->setOutput(output);
49  FairParAsciiFileIo* parInput2 = new FairParAsciiFileIo();
50  parInput2->open(MvdDigiparFile.Data(),"in");
51  rtdb->setSecondInput(parInput2);
52 
53  fRun->LoadGeometry();
54 
55 
56  // ----- Digitization ---------------------------------------
57 // PndMvdDigiTask* mvddigi = new PndMvdDigiTask();
58 // mvddigi->SetVerbose(iVerbose);
59 // fRun->AddTask(mvddigi);
60  // =========================================================================
61  // ====== Hit Producers ======
62  // =========================================================================
63 
64  // ----- MVD Strip hit producer ---------------------------------------
65 // double topPitch=0.015,
66 // botPitch=0.015,
67 // orient=TMath::Pi()*(0.5),
68 // skew=TMath::Pi()*(0.5);
69 // TVector2 topAnchor(0.,0.);
70 // TVector2 botAnchor(0.,0.);
71 // int topFE = 10,
72 // botFE = 4,
73 // nrFEChannels = 128;
74 // double threshold=3000., noise=1000.;
75 // PndMvdStripHitProducer* mvdStripProd
76 // = new PndMvdStripHitProducer(topPitch, botPitch,
77 // orient, skew,
78 // topAnchor,botAnchor,
79 // topFE, botFE, nrFEChannels,
80 // threshold, noise);
81 
83  mvdStripProd->SetVerbose(iVerbose);
84  fRun->AddTask(mvdStripProd);
85  // ----- MVD Pixel hit producer ---------------------------------------
86 // Double_t lx=0.01, ly=0.01, threshold=600, noise=200;
87 // PndMvdHybridHitProducer* mvdPixProd = new PndMvdHybridHitProducer(lx,ly,threshold,noise);
89  mvdPixProd->SetVerbose(iVerbose);
90  fRun->AddTask(mvdPixProd);
91 
93  mvdNoiseMaker->SetVerbose(iVerbose);
94  fRun->AddTask(mvdNoiseMaker);
95 
96  // ----- MVD hit producer --------------------------------------------
97 
100  mvdmccls->SetVerbose(iVerbose);
101  fRun->AddTask(mvdmccls);
102 
104  mvdClusterizer->SetVerbose(iVerbose);
105  fRun->AddTask(mvdClusterizer);
106 
107  // ----- STT analysis tasks --------------------------------------------
108  // digitize ....
109 // PndSttHitProducerIdeal* sttHitProducer = new PndSttHitProducerIdeal();
110 // PndSttHitProducerRealFast* sttHitProducer = new PndSttHitProducerRealFast();
111 // fRun->AddTask(sttHitProducer);
112 
113  // ------ TPC digi tasks ---------------------------
114 /* PndTpcClusterizerTask* tpcClusterizer = new PndTpcClusterizerTask();
115  //tpcClusterizer->SetPersistence();
116  fRun->AddTask(tpcClusterizer);
117 
118  PndTpcDriftTask* tpcDrifter = new PndTpcDriftTask();
119  // tpcDrifter->SetPersistence();
120  tpcDrifter->SetDistort(false);
121  fRun->AddTask(tpcDrifter);
122 
123  PndTpcGemTask* tpcGem = new PndTpcGemTask();
124  //tpcGem->SetPersistence();
125  fRun->AddTask(tpcGem);
126 
127  PndTpcPadResponseTask* tpcPadResponse = new PndTpcPadResponseTask();
128  tpcPadResponse->SetPersistence();
129  fRun->AddTask(tpcPadResponse);
130 
131  PndTpcElectronicsTask* tpcElec = new PndTpcElectronicsTask();
132  tpcElec->SetPersistence();
133  fRun->AddTask(tpcElec);
134 */
135  // ----- EMC hit producers ---------------------------------
136 /* PndEmcHitProducer* emcHitProd = new PndEmcHitProducer();
137  fRun->AddTask(emcHitProd); // hit production
138 
139  //PndEmcMakeDigi* emcMakeDigi=new PndEmcMakeDigi();
140  //fRun->AddTask(emcMakeDigi); // fast digitization
141 
142  PndEmcHitsToWaveform* emcHitsToWaveform= new PndEmcHitsToWaveform(iVerbose);
143  PndEmcWaveformToDigi* emcWaveformToDigi=new PndEmcWaveformToDigi(iVerbose);
144  fRun->AddTask(emcHitsToWaveform); // full digitization
145  fRun->AddTask(emcWaveformToDigi); // full digitization
146 
147  PndEmcMakeCluster* emcMakeCluster= new PndEmcMakeCluster(iVerbose);
148  fRun->AddTask(emcMakeCluster);
149 
150  PndEmcMakeBump* emcMakeBump= new PndEmcMakeBump();
151  fRun->AddTask(emcMakeBump);
152 
153  PndEmcHdrFiller* emcHdrFiller = new PndEmcHdrFiller();
154  fRun->AddTask(emcHdrFiller); // ECM header
155 */
156 // FairParRootFileIo* output=new FairParRootFileIo(kTRUE);
157 // output->open(parOutFile.Data());
158 // rtdb->setOutput(output);
159  rtdb->setOutput(parInput1);
160  rtdb->print();
161  // ===== End of HitProducers =====
162  // =========================================================================
163  //PndMvdGeoPar* geoPar = (PndMvdGeoPar*)(rtdb->getContainer("PndMvdGeoPar"));
164 
165  // ----- Intialise and run --------------------------------------------
166  fRun->Init();
167 
168  fRun->Run(nStart,nEvents);
169 
170  rtdb->saveOutput();
171  rtdb->print();
172 
173  // ----- Finish -------------------------------------------------------
174  timer.Stop();
175  Double_t rtime = timer.RealTime();
176  Double_t ctime = timer.CpuTime();
177  cout << endl << endl;
178  cout << "Macro finished succesfully." << endl;
179  cout << "Output file is " << outFile << endl;
180  cout << "Parameter file is " << parFile << endl;
181  cout << "Real time " << rtime << " s, CPU time " << ctime << " s\a\a" << endl;
182  cout << endl;
183 
184 }
PndMvdPixelClusterTask * mvdClusterizer
Definition: runclust.C:50
Hit Producer Task for strip detectors.
TString outFile
Definition: hit_dirc.C:17
PndMvdHybridHitProducer * mvdPixProd
PndMvdStripHitProducer * mvdStripProd
Double_t chargecut
Definition: runclust.C:44
PndMvdStripClusterTask * mvdmccls
Definition: runclust.C:45
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
TString sysFile
Int_t nStart
A simple class which adds the corresponding file extensions to a given base class.
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
TString MvdDigiparFile
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
PndMvdCreateDefaultApvMap * creator
Int_t iVerbose
PndMvdNoiseProducer * mvdNoiseMaker
Double_t rtime
Definition: hit_dirc.C:113