FairRoot/PandaRoot
outdated/dc1/stt/runreco.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_sttmvdemc.root";
8 
9 // Parameter file
10 TString parFile = "testparams.root";
11 
12 // Output file
13 TString outFile = "tracks_sttmvdemc.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("libStt");
29 gSystem->Load("libEmc");
30 gSystem->Load("libgenfit");
31 gSystem->Load("libtpc");
32 gSystem->Load("libtpcreco");
33 gSystem->Load("libtrackrep");
34 gSystem->Load("librecotasks");
35 gSystem->Load("libMvd");
36 gSystem->Load("libMvdReco");
37 gSystem->Load("libLHETrack");
38 // ------------------------------------------------------------------------
39 
40 // --- Now choose concrete engines for the different tasks -------------
41 // ------------------------------------------------------------------------
42 
43 // In general, the following parts need not be touched
44 // ========================================================================
45 
46 // ----- Timer --------------------------------------------------------
47 TStopwatch timer;
48 timer.Start();
49 // ------------------------------------------------------------------------
50 
51 // ----- Digitization run -------------------------------------------
52 FairRunAna *fRun= new FairRunAna();
53 fRun->SetInputFile(inFile);
54 fRun->SetOutputFile(outFile);
55 // ------------------------------------------------------------------------
56 
57 // ----- Parameter database --------------------------------------------
58 TString allDigiFile = "./all.par";
59 
60 FairRuntimeDb* rtdb = fRun->GetRuntimeDb();
61 FairParRootFileIo* parInput1 = new FairParRootFileIo();
62 parInput1->open(parFile.Data());
63 
64 FairParAsciiFileIo* parIo1 = new FairParAsciiFileIo();
65 parIo1->open(allDigiFile.Data(),"in");
66 
67 rtdb->setFirstInput(parInput1);
68 rtdb->setSecondInput(parIo1);
69 fRun->LoadGeometry();
70 // ------------------------------------------------------------------------
71 
72 // ----- STT analysis tasks --------------------------------------------
73 //PndSttHitProducerIdeal* sttHitProducer = new PndSttHitProducerIdeal();
75 fRun->AddTask(sttHitProducer);
76 
77 // trackfinding ....
79 PndSttFindTracks* sttFindTracks = new PndSttFindTracks("Track Finder", "FairTask", sttTrackFinder, iVerbose);
80 sttFindTracks->AddHitCollectionName("STTHit", "STTPoint");
81 fRun->AddTask(sttFindTracks);
82 
83 // trackmatching ....
84 PndSttMatchTracks* sttTrackMatcher = new PndSttMatchTracks("Match tracks", "STT", iVerbose);
85 sttTrackMatcher->AddHitCollectionName("STTHit", "STTPoint");
86 fRun->AddTask(sttTrackMatcher);
87 
88 // trackfitting ....
90 PndSttFitTracks* sttFitTracks = new PndSttFitTracks("STT Track Fitter", "FairTask", sttTrackFitter);
91 sttFitTracks->AddHitCollectionName("STTHit");
92 fRun->AddTask(sttFitTracks);
93 
94 // ----- MDV digi producers ---------------------------------
95 // DIGI
96 double topPitch=0.015,//cm
97  botPitch=0.015,//cm
98  orient=TMath::Pi()*(0.5),
99  skew=TMath::Pi()*(0.5);
100 TVector2 topAnchor(0.,0.);
101 TVector2 botAnchor(0.,0.);
102 int topFE = 10,
103  botFE = 4,
105 double threshold=3000., noise=1000.;
106 
109  orient, skew,
111  topFE, botFE, nrFEChannels,
112  threshold, noise);
113 mvdHitProd->SetVerbose(iVerbose);
114 fRun->AddTask(mvdHitProd);
115 
116 Double_t lx=0.01, ly=0.01, threshold=600, noise=200;
118 mvdPixProd->SetVerbose(iVerbose);
119 fRun->AddTask(mvdPixProd);
120 
121 // CLUST
122 // Cluster finding for strip detectors
123 Double_t noise = 1000.;
126 mvdmccls->SetVerbose(iVerbose);
127 fRun->AddTask(mvdmccls);
128 
129 // Cluster finder for pixel detectors
131 mvdClusterizer->SetVerbose(iVerbose);
132 fRun->AddTask(mvdClusterizer);
133 
134 // TRACKFINDER
135 //PndMvdIdealTrackingTask* mvdmctrk = new PndMvdIdealTrackingTask();
136 //mvdmctrk->SetVerbose(iVerbose);
137 //fRun->AddTask(mvdmctrk);
138 
139 // ----- EMC hit producers ---------------------------------
141 fRun->AddTask(emcHitProd); // hit production
142 
144 //fRun->AddTask(emcMakeDigi); // fast digitization
145 
148 fRun->AddTask(emcHitsToWaveform); // full digitization
149 fRun->AddTask(emcWaveformToDigi); // full digitization
150 
152 fRun->AddTask(emcMakeCluster);
153 
155 fRun->AddTask(emcHdrFiller); // ECM header
156 
158 fRun->AddTask(emcMakeBump);
159 
161 fRun->AddTask(emcMakeRecoHit);
162 
163 // ----- Intialise and run --------------------------------------------
164 fRun->Init();
165 fRun->Run(0, nEvents);
166 // ------------------------------------------------------------------------
167 
168 // ----- Finish -------------------------------------------------------
169 
170 timer.Stop();
171 Double_t rtime = timer.RealTime();
172 Double_t ctime = timer.CpuTime();
173 cout << endl << endl;
174 cout << "Macro finished succesfully." << endl;
175 cout << "Output file is " << outFile << endl;
176 cout << "Parameter file is " << parFile << endl;
177 cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
178 cout << endl;
179 // ------------------------------------------------------------------------
180 
181 
182 }
Takes list of PndEmcHits and creates PndEmcWaveform.
PndSttMatchTracks * sttTrackMatcher
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
PndSttTrackFitter * sttTrackFitter
void AddHitCollectionName(char *hitCollectionName, char *pointCollectionName)
PndSttHitProducerRealFast * sttHitProducer
TString allDigiFile
Definition: hit_muo.C:36
TVector2 botAnchor(0., 0.)
PndSttTrackFinderReal * sttTrackFinder
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
void AddHitCollectionName(char *hitCollectionName)
PndSttFindTracks * sttFindTracks
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
PndEmcMakeDigi * emcMakeDigi
Int_t iVerbose
double orient
double topPitch
Takes list of PndEmcWaveform and creates PndEmcDigi.
Double_t rtime
Definition: hit_dirc.C:113
Double_t Pi
PndSttFitTracks * sttFitTracks
Task to create Emc header.
void AddHitCollectionName(char *hitCollectionName, char *pointCollectionName)
double noise
Task to create PndEmcDigi from PndEmcHit.
TVector2 topAnchor(0., 0.)