FairRoot/PandaRoot
PndFtsHoughTrackerTaskQA.cxx
Go to the documentation of this file.
3 
4 #include <iostream>
5 #include <math.h>
6 
7 // FTS
8 #include "PndGeoFtsPar.h"
9 #include "PndFtsTube.h"
10 #include "PndFtsMapCreator.h"
11 #include "PndFtsHit.h"
12 #include "FairHit.h"
13 
14 
15 // magnetic field
16 #include "FairField.h"
17 
18 
19 // (Hough) tracking
20 #include "PndFtsHoughTrackFinder.h"
22 #include "PndFtsHoughSpace.h"
23 #include "PndTrackCand.h"
24 #include "PndTrack.h"
25 #include "FairTrackParP.h"
26 #include "PndFtsHoughTrackCand.h"
27 
28 // histogramming / plotting
29 #include "TH1.h"
30 #include "TH2.h"
31 #include "TGraph.h"
32 
33 // peak finder
34 #include "TSpectrum2.h"
35 
36 // root IO
37 
38 #include "FairRunAna.h"
39 #include "FairRootManager.h"
40 #include "FairRuntimeDb.h"
41 #include "FairTask.h"
42 
43 
44 
45 #include "TString.h"
46 
47 
48 // TODO this list can probably be shorter
49 //#include "PndDetectorList.h"
50 
51 // Root includes
52 #include "TROOT.h"
53 #include "TString.h"
54 #include "TClonesArray.h"
55 #include "TParticlePDG.h"
56 
57 // framework includes
58 #include "FairRootManager.h"
59 #include "FairRun.h"
60 #include "FairRuntimeDb.h"
61 #include "FairRunAna.h"
62 
63 
64 #include "TObjectTable.h"
65 
66 #include "PndFtsMapCreator.h"
67 
68 
69 using std::cout;
70 using std::endl;
71 
72 
73 
74 
75 
76 
77 // ---- Default constructor -------------------------------------------
79 : PndFtsHoughTrackerTask(verbose, kTRUE),
80  fTrackFinderParams(),
81  fNParabolasToFind(1),
82  fNEvtsWithEnoughParabolas(0)
83 {
84  if(3<fVerbose) std::cout << "PndFtsHoughTrackerTaskQA is the tracker ptr " << this << '\n';
85 }
86 
87 // ---- Destructor ----------------------------------------------------
89 {
90  if(fVerbose>3) fLogger->Info(MESSAGE_ORIGIN,"Destructor of PndFtsHoughTrackerTaskQA");
91 }
92 
93 
94 
95 
96 // ---- Init ----------------------------------------------------------
98 {
99  if(fVerbose>3) Info("Init","Initilization of PndFtsHoughTrackerTaskQA");
100 
102 }
103 
104 
105 // ---- ReInit -------------------------------------------------------
107 {
108  InitStatus stat=kSUCCESS;
109  if(3<fVerbose) fLogger->Info(MESSAGE_ORIGIN,"Re- Initilization of PndFtsHoughTrackerTaskQA");
111  return stat;
112 }
113 
114 
115 
116 
117 // ---- Exec ----------------------------------------------------------
119 {
120  if(1<fVerbose) Info("Exec","Exec of PndFtsHoughTrackerTaskQA on event %i", fEventNr);
121 
122  if(3<fVerbose) std::cout << "PndFtsHoughTrackFinder::Exec tracker ptr " << this << '\n';
123 
124 
125  // determine how many parabolas should be found (by performing ideal track finding)
126 
127 
128 
129  // run track finder
132  trackFinder.FindTracks();
133 
134 
135 
136 
137  // check if we found correct number of parabolas
139 
140 
141 
142 
143 
144 
145 
146  if(3<fVerbose) Info("Exec","End eventloop.");
147  ++fEventNr;
148 }
149 
150 
151 
153 {
154 }
155 
156 
157 // ---- Finish --------------------------------------------------------
159 {
160  if(3<fVerbose) Info("Finish","Found %i tracks.",fTrackCands->GetEntriesFast());
161 
162  // print parameters to screen if we have found enough parabolas
163  std::cout << fNEvtsWithEnoughParabolas << " events have >= " << fNParabolasToFind << " parabola.\n";
164  std::cout << " \n";
165 }
166 
167 
168 
169 
170 
virtual void FindTracks()
Performs the track finding.
virtual InitStatus ReInit()
ReInitiliazation of task when the runID changes.
int fVerbose
Definition: poormantracks.C:24
PndFtsHoughTrackerTaskQA(Int_t verbose=0)
Constructor with flags. Can also be used as standard constructor.
UInt_t fEventNr
Event number for debugging purposes.
Interface between PandaRoot (data input and output) and PndFtsHoughTrackFinder (implementation of PR ...
#define verbose
virtual void Exec(Option_t *opt)
Executed for each event.
virtual void FinishEvent()
When is this executed? After each event?
PndFtsHoughTrackFinderParams fTrackFinderParams
virtual InitStatus Init()
Initialization of task at the beginning of a run.
virtual void Finish()
Writes output to root file, I guess. Called at the end of the run.
For automatic parameter optimization. This class tries numerous parameters and prints out good combin...
Implementation of the Hough transform based FTS PR. Creates Hough spaces, finds peaks (=tracklets) an...
FairLogger * fLogger
Returns pointer to the B field.
void OverwriteTrackFinderParams(PndFtsHoughTrackFinderParams newParams)
virtual InitStatus Init()
Initialization of task at the beginning of a run.
PndLheTrackFinder * trackFinder
ClassImp(PndAnaContFact)
TClonesArray * fTrackCands
Array of found track candidates in PndTrackCand (for output)
virtual InitStatus ReInit()
ReInitiliazation of task when the runID changes.