FairRoot/PandaRoot
run_rectrack_tpcmvd.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 = "points_tpcmvdemc.root";
8 
9 // Parameter file
10 TString parFile = "testparams.root";
11 
12 // Output file
13 TString outFile = "tracks_tpcmvdemc.root";
14 
15 // Number of events to process
16 Int_t nEvents = 0;
17 
18 // ---- Load libraries -------------------------------------------------
19 gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
20 basiclibs();
21 gSystem->Load("libGeoBase");
22 gSystem->Load("libParBase");
23 gSystem->Load("libBase");
24 gSystem->Load("libPndData");
25 gSystem->Load("libField");
26 gSystem->Load("libPassive");
27 gSystem->Load("libGen");
28 gSystem->Load("libEmc");
29 gSystem->Load("libgenfit");
30 gSystem->Load("libtpc");
31 gSystem->Load("libtpcreco");
32 gSystem->Load("libtrackrep");
33 gSystem->Load("librecotasks");
34 gSystem->Load("libMvd");
35 gSystem->Load("libMvdReco");
36 gSystem->Load("libLHETrack");
37 // ------------------------------------------------------------------------
38 
39 // --- Now choose concrete engines for the different tasks -------------
40 // ------------------------------------------------------------------------
41 
42 // In general, the following parts need not be touched
43 // ========================================================================
44 
45 // ----- Timer --------------------------------------------------------
46 TStopwatch timer;
47 timer.Start();
48 // ------------------------------------------------------------------------
49 
50 // ----- Digitization run -------------------------------------------
51 FairRunAna *fRun= new FairRunAna();
52 fRun->SetInputFile(inFile);
53 fRun->SetOutputFile(outFile);
54 // ------------------------------------------------------------------------
55 
56 // ----- Parameter database --------------------------------------------
57 TString allDigiFile = "./all.par";
58 
59 FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
60 FairParRootFileIo* parInput1 = new FairParRootFileIo();
61 parInput1->open(parFile.Data());
62 
63 FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
64 parIo1->open(allDigiFile.Data(),"in");
65 
66 rtdb->setFirstInput(parInput1);
67 rtdb->setSecondInput(parIo1);
68 fRun->LoadGeometry();
69 // ------------------------------------------------------------------------
70 
71 // ----- TPC digi producers ---------------------------------
72 PndTpcClusterizerTask* tpcClusterizer = new PndTpcClusterizerTask();
73 //tpcClusterizer->SetPersistence();
74 fRun->AddTask(tpcClusterizer);
75 
76 PndTpcDriftTask* tpcDrifter = new PndTpcDriftTask();
77 // tpcDrifter->SetPersistence();
78 tpcDrifter->SetDistort(false);
79 fRun->AddTask(tpcDrifter);
80 
81 PndTpcGemTask* tpcGem = new PndTpcGemTask();
82 //tpcGem->SetPersistence();
83 fRun->AddTask(tpcGem);
84 
85 PndTpcPadResponseTask* tpcPadResponse = new PndTpcPadResponseTask();
86 tpcPadResponse->SetPersistence();
87 fRun->AddTask(tpcPadResponse);
88 
89 PndTpcElectronicsTask* tpcElec = new PndTpcElectronicsTask();
90 tpcElec->SetPersistence();
91 fRun->AddTask(tpcElec);
92 
93 PndTpcClusterFinderTask* tpcCF = new PndTpcClusterFinderTask();
94 tpcCF->SetPersistence();
95 tpcCF->timeslice(20); // = 4 sample times = 100ns @ 40MHz
96 fRun->AddTask(tpcCF);
97 
98 //PndTpcRiemannTrackingTask* tpcSPR = new PndTpcRiemannTrackingTask();
99 //tpcSPR->SetTrkFinderParameters(2.,// proxcut
100 // 0.02, // proxcut on rieman sphere
101 // 2.E-3, // planecut
102 // 4.0, // szcut
103 // 4); // minnumhits for fit
104 //tpcSPR->SetPersistence();
105 // fRun->AddTask(tpcSPR);
106 
107 // ----- MDV digi producers ---------------------------------
108 // DIGI
109 double topPitch=0.015,//cm
110  botPitch=0.015,//cm
111  orient=TMath::Pi()*(0.5),
112  skew=TMath::Pi()*(0.5);
113 TVector2 topAnchor(0.,0.);
114 TVector2 botAnchor(0.,0.);
115 int topFE = 10,
116  botFE = 4,
118 double threshold=3000., noise=1000.;
119 
122  orient, skew,
124  topFE, botFE, nrFEChannels,
125  threshold, noise);
126 mvdHitProd->SetVerbose(iVerbose);
127 fRun->AddTask(mvdHitProd);
128 
129 Double_t lx=0.01, ly=0.01, threshold=600, noise=200;
131 mvdPixProd->SetVerbose(iVerbose);
132 fRun->AddTask(mvdPixProd);
133 
134 // CLUST
135 // Cluster finding for strip detectors
136 Double_t noise = 1000.;
139 mvdmccls->SetVerbose(iVerbose);
140 fRun->AddTask(mvdmccls);
141 
142 // Cluster finder for pixel detectors
144 mvdClusterizer->SetVerbose(iVerbose);
145 fRun->AddTask(mvdClusterizer);
146 
147 // TRACKFINDER
148 //PndMvdIdealTrackingTask* mvdmctrk = new PndMvdIdealTrackingTask();
149 //mvdmctrk->SetVerbose(iVerbose);
150 //fRun->AddTask(mvdmctrk);
151 
152 // ----- EMC hit producers ---------------------------------
154 fRun->AddTask(emcHitProd); // hit production
155 
157 //fRun->AddTask(emcMakeDigi); // fast digitization
158 
161 fRun->AddTask(emcHitsToWaveform); // full digitization
162 fRun->AddTask(emcWaveformToDigi); // full digitization
163 
165 fRun->AddTask(emcMakeCluster);
166 
168 fRun->AddTask(emcHdrFiller); // ECM header
169 
171 fRun->AddTask(emcMakeBump);
172 
174 fRun->AddTask(emcMakeRecoHit);
175 
176 // ----- LHETRACK ---------------------------------
177 
178 PndTpcLheHitsMaker* trackMS = new PndTpcLheHitsMaker("Tracking routine");
179 //trackMS->SetSimulation(kFALSE);
180 //trackMS->SetVerbose(kTRUE);
181 trackMS->SetTpcMode(2, -1); // 0 OFF, 1 TpcPoint, 2 TpcCluster // TpcPoint smearing [cm], if negative no smearing
182 trackMS->SetMvdMode(2, -1); // 0 OFF, 1 MVDPoint, 2 MVDHit // MVDPoint smearing [cm], if negative no smearing
183 trackMS->SetEmcMode(0); // 0 OFF, 2 EmcCluster, 3 EmcBump
184 fRun->AddTask(trackMS);
185 
186 PndTpcLheTrackFinder* trackFinder = new PndTpcLheTrackFinder();
187 fRun->AddTask(trackFinder);
188 
189 PndTpcLheTrackFitter* trackFitter = new PndTpcLheTrackFitter("fitting");
190 fRun->AddTask(trackFitter);
191 
192 // ----- Intialise and run --------------------------------------------
193 fRun->Init();
194 fRun->Run(0, nEvents);
195 // ------------------------------------------------------------------------
196 
197 // ----- Finish -------------------------------------------------------
198 
199 timer.Stop();
200 Double_t rtime = timer.RealTime();
201 Double_t ctime = timer.CpuTime();
202 cout << endl << endl;
203 cout << "Macro finished succesfully." << endl;
204 cout << "Output file is " << outFile << endl;
205 cout << "Parameter file is " << parFile << endl;
206 cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
207 cout << endl;
208 // ------------------------------------------------------------------------
209 
210 
211 }
Takes list of PndEmcHits and creates PndEmcWaveform.
PndTpcGemTask * tpcGem
PndMvdStripHitProducer * mvdHitProd
basiclibs()
Create PndEmcRecoHit from PndEmcBump.
PndEmcHitsToWaveform * emcHitsToWaveform
Definition: full_emc.C:60
PndMvdPixelClusterTask * mvdClusterizer
Definition: runclust.C:50
Hit Producer Task for strip detectors.
TString outFile
Definition: hit_dirc.C:17
PndEmcMakeRecoHit * emcMakeRecoHit
PndMvdHybridHitProducer * mvdPixProd
creates PndEmcHits from PndEmcPoints
Double_t chargecut
Definition: runclust.C:44
PndEmcMakeBump * emcMakeBump
Definition: bump_emc.C:63
PndMvdStripClusterTask * mvdmccls
Definition: runclust.C:45
TString allDigiFile
Definition: hit_muo.C:36
TVector2 botAnchor(0., 0.)
PndTpcClusterizerTask * tpcClusterizer
PndEmcHdrFiller * emcHdrFiller
Definition: full_emc.C:68
double skew
FairRunAna * fRun
Definition: hit_dirc.C:58
TString inFile
Definition: hit_dirc.C:8
Double_t lx
Double_t
TString parFile
Definition: hit_dirc.C:14
PndEmcMakeCluster * emcMakeCluster
Definition: full_emc.C:65
Int_t nEvents
Definition: hit_dirc.C:11
TStopwatch timer
Definition: hit_dirc.C:51
PndLheTrackFitter * trackFitter
PndTpcPadResponseTask * tpcPadResponse
FairRuntimeDb * rtdb
Definition: hit_dirc.C:66
double botPitch
int nrFEChannels
PndEmcHitProducer * emcHitProd
Takes clusters and slits them up into bumps.
double threshold
FairParRootFileIo * parInput1
Definition: hit_dirc.C:67
Double_t ctime
Definition: hit_dirc.C:114
PndEmcWaveformToDigi * emcWaveformToDigi
Definition: full_emc.C:61
FairParAsciiFileIo * parIo1
Definition: bump_emc.C:53
Task to cluster PndEmcDigis.
Double_t ly
PndLheHitsMaker * trackMS
PndTpcElectronicsTask * tpcElec
PndLheTrackFinder * trackFinder
PndEmcMakeDigi * emcMakeDigi
PndTpcDriftTask * tpcDrifter
Int_t iVerbose
double orient
double topPitch
Takes list of PndEmcWaveform and creates PndEmcDigi.
PndTpcClusterFinderTask * tpcCF
Double_t rtime
Definition: hit_dirc.C:113
Double_t Pi
Task to create Emc header.
double noise
Task to create PndEmcDigi from PndEmcHit.
TVector2 topAnchor(0., 0.)