MarlinTPC  1.2.0
TrackFinderHoughTrafoProcessor.h
1 #ifndef TrackFinderHoughTrafoProcessor_h
2 #define TrackFinderHoughTrafoProcessor_h 1
3 
4 // C++
5 #include <string>
6 #include <map>
7 #include <vector>
8 
9 // LCIO
10 #include "lcio.h"
11 
12 // Marlin
13 #include "marlin/Processor.h"
14 #include "lccd/ConditionsMap.hh"
15 
16 namespace AIDA
17 {
18 
19 class IHistogram1D;
20 class IHistogram2D;
21 
22 
23 }
24 
25 namespace marlintpc
26 {
27 
28 /* the following comment is tranfered to doxygen documentation
29  * which begins with a second asterix, or in case of on line comment an extra third slash
30  */
50 class TrackFinderHoughTrafoProcessor : public marlin::Processor
51 {
52 
53  public:
54 
55  /* This method will be called by the marlin package
56  * It returns a processor of the currend type (here TrackFinderHoughTrafoProcessor)
57  */
58  virtual Processor* newProcessor()
59  {
61  }
62 
63  /* the default constructor
64  * here the processor parameters are registered to the marlin package
65  * other initialisation should be placed in the init method
66  */
68 
69  /* Called at the beginning of the job before anything is read.
70  * Use to initialize the processor, e.g. book histograms
71  */
72  virtual void init() ;
73 
74  /* Called for every run.
75  * in this processor it is not used
76  */
77  virtual void processRunHeader(lcio::LCRunHeader* run) ;
78 
79  /* Called for every event - the working horse.
80  * Here the real conversion take place
81  */
82  virtual void processEvent(lcio::LCEvent * evt) ;
83 
84  /* This method is only called if the check flag is set (default) in the main processor
85  * (where the input files are given)
86  * It should be used to create check plots which are not needed in a complete analysis
87  * (where normaly the check flag is deactivated)
88  */
89  virtual void check(lcio::LCEvent * evt) ;
90 
91 
92  /* Called after data processing for clean up.
93  * e.g. saving control histogramms, delete created objects
94  * (which are not stored in a collection/event), etc.
95  */
96  virtual void end() ;
97 
98 
99 
100  virtual double distanceToTrackFinder(const double *pos,
101  DoubleVec par,
102  std::string _trackType);
106  {
107 
108  double a;
109  double b;
112 
113  TrackProperties(double avalue = 0, double bvalue = 0,
114  int hitsontrackvalue = 0, int orientationvalue = 0)
115  {
116 
117  a = avalue;
118  b = bvalue;
119  hitsontrack = hitsontrackvalue;
120  orientation = orientationvalue;
121 
122  };
123 
124  bool operator<(TrackProperties const trackproperties) const
125  {
126  return (hitsontrack < trackproperties.hitsontrack);
127  }
128 
129  bool operator>(TrackProperties const trackproperties) const
130  {
131  return (hitsontrack > trackproperties.hitsontrack);
132  }
133 
134  bool operator==(TrackProperties const trackproperties) const
135  {
136  return(a == trackproperties.a &&
137  b == trackproperties.b &&
138  hitsontrack == trackproperties.hitsontrack);
139  }
140 
141 
142 
143 
144  };
145 
146  static bool sortPredicate(const TrackProperties& lhs, const TrackProperties& rhs)
147  {
148 
149  return lhs.hitsontrack > rhs.hitsontrack;
150 
151  }
152 
153  virtual TrackProperties maxBinFinder(AIDA::IHistogram2D * histo);
154 
155  typedef std::vector<TrackProperties> TPVec;
156 
157 
158 
159  protected:
160 
161  /* normally the doxygen documentation is palced before the method/variable
162  * but for one line comments in case of variables it may be more convenied for you
163  * to place it after the variable. In this case you use an arrow to tell doxygen
164  * to which variable the commet belongs to.
165  */
166 
167  std::string _inputColName ;
168  std::string _outputColName ;
169  std::string _trackType;
170 // double _pitch; ///<- the pitch of the chip in mm
173  int _chipID;
174 
179 
180  int _nRun ;
181 
182  double a;
183  double b;
184 
189 
190  private:
191  AIDA::IHistogram1D * histod;
192  AIDA::IHistogram2D * HistoEvent;
193  std::vector<AIDA::IHistogram2D *> HistoLineVec;
194  std::vector<AIDA::IHistogram2D *> HistoTrackVec;
195  std::vector<AIDA::IHistogram2D *> HistoHoughVec;
196 
197 
198 } ;
199 
200 }
201 
202 #endif
203 
204 
205 
nested helper class that stores the properties of a straight track.
Definition: TrackFinderHoughTrafoProcessor.h:105
double _maxDistanceToTrack
Definition: TrackFinderHoughTrafoProcessor.h:171
int _nRun
Definition: TrackFinderHoughTrafoProcessor.h:180
int _nHitsOnTrack
Definition: TrackFinderHoughTrafoProcessor.h:172
std::string _outputColName
Definition: TrackFinderHoughTrafoProcessor.h:168
float _houghSpaceMaxB
The half range (-max–max) of the hough space histogram in 'b' direction.
Definition: TrackFinderHoughTrafoProcessor.h:188
int _houghSpaceNBinsB
The number of bins in the hough space histogram in 'b' direction.
Definition: TrackFinderHoughTrafoProcessor.h:186
std::string _inputColName
Definition: TrackFinderHoughTrafoProcessor.h:167
int _houghSpaceNBinsA
The number of bins in the hough space histogram in 'a' direction.
Definition: TrackFinderHoughTrafoProcessor.h:185
float _houghSpaceMaxA
The half range (-max..max) of the hough space histogram in 'a' direction.
Definition: TrackFinderHoughTrafoProcessor.h:187
std::string _trackType
Definition: TrackFinderHoughTrafoProcessor.h:169
double a
Definition: TrackFinderHoughTrafoProcessor.h:182
double a
slope of track
Definition: TrackFinderHoughTrafoProcessor.h:108
int orientation
orientation of the track: 0: y = ax + b 1: x = ya + b
Definition: TrackFinderHoughTrafoProcessor.h:111
int _chipID
Definition: TrackFinderHoughTrafoProcessor.h:173
int hitsontrack
number of hits on the track
Definition: TrackFinderHoughTrafoProcessor.h:110
double b
intersection of track on axis set by orientation
Definition: TrackFinderHoughTrafoProcessor.h:109
int _outputIsTransient
give the status which is set to the transient flag of the output collection it is an int instead of a...
Definition: TrackFinderHoughTrafoProcessor.h:178
double b
Definition: TrackFinderHoughTrafoProcessor.h:183
uses the hough transformation to find hits on straight tracks.
Definition: TrackFinderHoughTrafoProcessor.h:50