FairRoot/PandaRoot
hit_muo.C
Go to the documentation of this file.
1 {
2  // ========================================================================
3  // Verbosity level (0=quiet, 1=event level, 2=track level, 3=debug)
4  Int_t iVerbose = 0;
5 
6  // Input file (MC events)
7  TString inFile = "test.root";
8 
9  // Parameter file
10  TString parFile = "params.root";
11 
12  // Output file
13  TString outFile = "tracks_combi.root";
14 
15  // Number of events to process
16  Int_t nEvents = 0;
17 
18  // --- Now choose concrete engines for the different tasks -------------
19  // ------------------------------------------------------------------------
20 
21  // In general, the following parts need not be touched
22  // ========================================================================
23 
24  // ----- Timer --------------------------------------------------------
25  TStopwatch timer;
26  timer.Start();
27  // ------------------------------------------------------------------------
28 
29  // ----- Digitization run -------------------------------------------
30  FairRunAna *fRun= new FairRunAna();
31  fRun->SetInputFile(inFile);
32  fRun->SetOutputFile(outFile);
33  // ------------------------------------------------------------------------
34 
35  // ----- Parameter database --------------------------------------------
36  TString allDigiFile = "./all.par";
37 
38  FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
39  FairParRootFileIo* parInput1 = new FairParRootFileIo();
40  parInput1->open(parFile.Data());
41 
42  FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
43  parIo1->open(allDigiFile.Data(),"in");
44 
45  rtdb->setFirstInput(parInput1);
46  rtdb->setSecondInput(parIo1);
47  // ------------------------------------------------------------------------
48 /*
49  // ----- TPC digi producers ---------------------------------
50  PndTpcClusterizerTask* tpcClusterizer = new PndTpcClusterizerTask();
51  //tpcClusterizer->SetPersistence();
52  fRun->AddTask(tpcClusterizer);
53 
54  PndTpcDriftTask* tpcDrifter = new PndTpcDriftTask();
55  // tpcDrifter->SetPersistence();
56  tpcDrifter->SetDistort(false);
57  fRun->AddTask(tpcDrifter);
58 
59  PndTpcGemTask* tpcGem = new PndTpcGemTask();
60  //tpcGem->SetPersistence();
61  fRun->AddTask(tpcGem);
62 
63  PndTpcPadResponseTask* tpcPadResponse = new PndTpcPadResponseTask();
64  tpcPadResponse->SetPersistence();
65  fRun->AddTask(tpcPadResponse);
66 
67  PndTpcElectronicsTask* tpcElec = new PndTpcElectronicsTask();
68  tpcElec->SetPersistence();
69  fRun->AddTask(tpcElec);
70 
71  PndTpcClusterFinderTask* tpcCF = new PndTpcClusterFinderTask();
72  tpcCF->SetPersistence();
73  tpcCF->timeslice(20); // = 4 sample times = 100ns @ 40MHz
74  fRun->AddTask(tpcCF);
75 
76  //PndTpcRiemannTrackingTask* tpcSPR = new PndTpcRiemannTrackingTask();
77  //tpcSPR->SetTrkFinderParameters(2.,// proxcut
78  // 0.02, // proxcut on rieman sphere
79  // 2.E-3, // planecut
80  // 4.0, // szcut
81  // 4); // minnumhits for fit
82  //tpcSPR->SetPersistence();
83  // fRun->AddTask(tpcSPR);
84 
85  // ----- MDV digi producers ---------------------------------
86  // DIGI
87  // double topPitch=0.015,//cm
88  // botPitch=0.015,//cm
89  // orient=TMath::Pi()*(0.5),
90  // skew=TMath::Pi()*(0.5);
91  // TVector2 topAnchor(0.,0.);
92  // TVector2 botAnchor(0.,0.);
93  // int topFE = 10,
94  // botFE = 4,
95  // nrFEChannels = 128;
96  // double threshold=3000., noise=1000.;
97 
98  // PndMvdStripHitProducer* mvdHitProd
99  // = new PndMvdStripHitProducer(topPitch, botPitch,
100  // orient, skew,
101  // topAnchor,botAnchor,
102  // topFE, botFE, nrFEChannels,
103  // threshold, noise);
104  PndMvdStripHitProducer* mvdHitProd = new PndMvdStripHitProducer();
105  mvdHitProd->SetVerbose(iVerbose);
106  fRun->AddTask(mvdHitProd);
107 
108  Double_t lx=0.01, ly=0.01, threshold=600, noise=200;
109  PndMvdHybridHitProducer* mvdPixProd = new PndMvdHybridHitProducer(lx,ly,threshold,noise);
110  mvdPixProd->SetVerbose(iVerbose);
111  fRun->AddTask(mvdPixProd);
112 
113  // CLUST
114  // Cluster finding for strip detectors
115  Double_t noise = 1000.; // put such stuff inside the task
116  Double_t chargecut = 3. * noise;
117  PndMvdStripClusterTask* mvdmccls = new PndMvdStripClusterTask(chargecut, inFile);
118  mvdmccls->SetVerbose(iVerbose);
119  fRun->AddTask(mvdmccls);
120 
121  // Cluster finder for pixel detectors
122  PndMvdPixelClusterTask* mvdClusterizer = new PndMvdPixelClusterTask(1.8,76,84, inFile);
123  mvdClusterizer->SetVerbose(iVerbose);
124  fRun->AddTask(mvdClusterizer);
125 
126  // TRACKFINDER
127  //PndMvdIdealTrackingTask* mvdmctrk = new PndMvdIdealTrackingTask();
128  //mvdmctrk->SetVerbose(iVerbose);
129  //fRun->AddTask(mvdmctrk);
130 
131  // ----- EMC hit producers ---------------------------------
132  PndEmcHitProducer* emcHitProd = new PndEmcHitProducer();
133  fRun->AddTask(emcHitProd); // hit production
134 
135  PndEmcMakeDigi* emcMakeDigi=new PndEmcMakeDigi();
136  //fRun->AddTask(emcMakeDigi); // fast digitization
137 
138  PndEmcHitsToWaveform* emcHitsToWaveform= new PndEmcHitsToWaveform(iVerbose);
139  PndEmcWaveformToDigi* emcWaveformToDigi=new PndEmcWaveformToDigi(iVerbose);
140  fRun->AddTask(emcHitsToWaveform); // full digitization
141  fRun->AddTask(emcWaveformToDigi); // full digitization
142 
143  PndEmcMakeCluster* emcMakeCluster= new PndEmcMakeCluster(iVerbose);
144  fRun->AddTask(emcMakeCluster);
145 
146  PndEmcHdrFiller* emcHdrFiller = new PndEmcHdrFiller();
147  fRun->AddTask(emcHdrFiller); // ECM header
148 
149  PndEmcMakeBump* emcMakeBump= new PndEmcMakeBump();
150  fRun->AddTask(emcMakeBump);
151 
152  PndEmcMakeRecoHit* emcMakeRecoHit= new PndEmcMakeRecoHit();
153  fRun->AddTask(emcMakeRecoHit);
154 
155  // ----- TOF hit producers ---------------------------------
156 
157  PndTofHitProducerIdeal* tofhit = new PndTofHitProducerIdeal();
158  tofhit->SetVerbose(iVerbose);
159  fRun->AddTask(tofhit);
160 */
161  // ----- MDT hit producers ---------------------------------
163  mdtHitProd->SetPositionSmearing(0.3); // position smearing [cm]
164  fRun->AddTask(mdtHitProd);
165 
167  fRun->AddTask(mdtTrkProd);
168 
169  // ----- LHETRACK ---------------------------------
170 /*
171  PndTpcLheHitsMaker* trackMS = new PndTpcLheHitsMaker("Tracking routine");
172  trackMS->SetTpcMode(2); // 0 OFF, 1 TpcPoint, 2 TpcCluster // TpcPoint smearing [cm], if negative no smearing
173  trackMS->SetMvdMode(2); // 0 OFF, 1 MVDPoint, 2 MVDHit // MVDPoint smearing [cm], if negative no smearing
174  fRun->AddTask(trackMS);
175 
176  PndTpcLheTrackFinder* trackFinder = new PndTpcLheTrackFinder();
177  fRun->AddTask(trackFinder);
178 
179  PndTpcLheTrackFitter* trackFitter = new PndTpcLheTrackFitter("fitting");
180  fRun->AddTask(trackFitter);
181 
182  PndLhePidMaker* pidMaker = new PndLhePidMaker("pid");
183  //pidMaker->SetDebugMode(kTRUE);
184  fRun->AddTask(pidMaker);
185 */
186  // ----- Intialise and run --------------------------------------------
187  fRun->Init();
188  fRun->Run(0, nEvents);
189 
190  rtdb->saveOutput();
191  rtdb->print();
192 
193  // ------------------------------------------------------------------------
194 
195  // ----- Finish -------------------------------------------------------
196 
197  timer.Stop();
198  Double_t rtime = timer.RealTime();
199  Double_t ctime = timer.CpuTime();
200  cout << endl << endl;
201  cout << "Macro finished succesfully." << endl;
202  cout << "Output file is " << outFile << endl;
203  cout << "Parameter file is " << parFile << endl;
204  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
205  cout << endl;
206  // ------------------------------------------------------------------------
207 
208 
209 }
TString outFile
Definition: hit_dirc.C:17
TString allDigiFile
Definition: hit_muo.C:36
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
PndMdtHitProducerIdeal * mdtHitProd
Definition: hit_muo.C:162
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
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
Int_t iVerbose
PndMdtTrkProducer * mdtTrkProd
Definition: hit_muo.C:166
Double_t rtime
Definition: hit_dirc.C:113
void SetPositionSmearing(Float_t res)
Set the smearing of the PndMdtHit position.