MarlinTPC  1.2.0
RowBasedFastHoughTransformationProcessor.h
1 #ifndef ROWBASEDFASTHOUGHTRANSFORMATIONPROCESSOR_H
2 #define ROWBASEDFASTHOUGHTRANSFORMATIONPROCESSOR_H
3 
4 #include "RowTripletBasedTrackFinderProcessor.h"
5 
6 #include <marlin/Processor.h>
7 #include <marlin/Global.h>
8 #include <lcio.h>
9 #include <string>
10 
11 #include <gear/TPCModule.h>
12 
13 // LCIO:
14 #include "EVENT/TrackerHit.h"
15 
16 #include "TFile.h"
17 #include "TTree.h"
18 #include "TMath.h"
19 #include "TVectorD.h"
20 #include "TMatrixD.h"
21 #include "TMatrixDSym.h"
22 
23 namespace marlintpc {
25 
89 class RowBasedFastHoughTransformationProcessor: public marlin::Processor {
90  public:
91 
92  virtual Processor* newProcessor() {
94  }
95 
97 
98  virtual void init();
99 
100  virtual void processRunHeader(EVENT::LCRunHeader* run);
101 
102  virtual void processEvent(EVENT::LCEvent* evt);
103 
104  virtual void check(EVENT::LCEvent* evt);
105 
106  virtual void end();
107 
108  protected:
109  /* the place for protected and private member data and functions */
110  std::string _inputColName;
111  std::string _outputColName;
113  bool _useXY;
114  bool _useXZ;
115  double _centerXY;
116  double _rangeXY;
117  double _centerXZ;
118  double _rangeXZ;
119  int _minRow;
120  float _fracRow;
122  int _maxCube;
123  int _minLevel;
124  int _maxLevel;
125  float _effCut;
126  float _purCut;
128  double _unusedCut;
129  int _maxGap;
131  bool _refAtPCA;
133 
134  private:
135  int _scaleBits;
136  double _Bzc;
137  double _Xcenter;
138  double _Ycenter;
139 };
140 
141 typedef std::vector<int> intListType;
142 typedef std::vector<double> doubleListType;
143 typedef std::vector<doubleListType> directionsType;
145 
152  public:
153  rb_HyperPlane(int, rb_Hit*, directionsType&, double = 0.75);
154  void print() const;
155  int getScaleBits() const;
156  int getRow() const;
157  rb_Hit* getHit() const;
158  intListType getCut() const;
159  int getCut(int) const;
160  std::vector<intListType> getSteps() const;
161  int getStep(int, int) const;
162 
163  private:
164  int _scaleBits;
165  rb_Hit* _hit;
166  intListType _cut;
167  std::vector<intListType> _steps;
168 };
169 
170 typedef std::vector<rb_HyperPlane*> hyperPlaneListType;
171 
172 int nCube;
173 
175 
181  public:
182  rb_HyperCube(unsigned int*, hyperPlaneListType&, intListType&, unsigned int = 0);
183  void print() const;
184  hitListType divide(int, int, int, int, float, float);
185 
186  private:
187  unsigned int _setup[2];
188  std::vector<rb_HyperPlane*> _planes;
189  intListType _distances;
190  int _level;
191  int _numChild;
192  unsigned int _dimension;
193 };
194 
195 } // namespace marlintpc
196 #endif // ROWBASEDFASTHOUGHTRANSFORMATIONPROCESSOR_H
std::string _outputColName
Name of the output collection.
Definition: RowBasedFastHoughTransformationProcessor.h:111
bool _encodedModuleID
Module ID is encoded in CellID0.
Definition: RowBasedFastHoughTransformationProcessor.h:130
rb_Hit * getHit() const
Get hit (pointer).
Definition: RowBasedFastHoughTransformationProcessor.cc:461
int _maxLevel
Maximum number of (hyper) cubes splittings.
Definition: RowBasedFastHoughTransformationProcessor.h:124
int _minLevel
Minimum number of (hyper) cubes splittings.
Definition: RowBasedFastHoughTransformationProcessor.h:123
RowBasedFastHoughTransformationProcessor()
Construct processor.
Definition: RowBasedFastHoughTransformationProcessor.cc:42
int _maxCube
Maximum number of (hyper) cubes to check.
Definition: RowBasedFastHoughTransformationProcessor.h:122
intListType getCut() const
Get distance cut(s).
Definition: RowBasedFastHoughTransformationProcessor.cc:466
float _fracRow
Relative minimum cube content.
Definition: RowBasedFastHoughTransformationProcessor.h:120
void print() const
Print hypercube.
Definition: RowBasedFastHoughTransformationProcessor.cc:503
virtual void init()
Initialize processor.
Definition: RowBasedFastHoughTransformationProcessor.cc:97
Row based hypercubes.
Definition: RowBasedFastHoughTransformationProcessor.h:180
int _maxHitsPerRow
Maximum number hits per row.
Definition: RowBasedFastHoughTransformationProcessor.h:127
virtual void processEvent(EVENT::LCEvent *evt)
Process event.
Definition: RowBasedFastHoughTransformationProcessor.cc:107
int _minRow
Minimal number of (correlated) rows.
Definition: RowBasedFastHoughTransformationProcessor.h:119
int nCube
cube counter
Definition: RowBasedFastHoughTransformationProcessor.h:172
void print() const
Print hyperplane.
Definition: RowBasedFastHoughTransformationProcessor.cc:445
std::vector< intListType > getSteps() const
Get steps (distances of child to mother hypercube center).
Definition: RowBasedFastHoughTransformationProcessor.cc:476
float _purCut
Maximum hit density (hits/tracklength)
Definition: RowBasedFastHoughTransformationProcessor.h:126
double _bfieldScaleFactor
scale factor for magnetic field (default: 1.0)
Definition: RowBasedFastHoughTransformationProcessor.h:112
int getRow() const
Get row number.
Definition: RowBasedFastHoughTransformationProcessor.cc:451
Row based hit.
Definition: RowTripletBasedTrackFinderProcessor.h:122
bool _useXY
Use XY (anode plane) measurement.
Definition: RowBasedFastHoughTransformationProcessor.h:113
Row based hyperplane.
Definition: RowBasedFastHoughTransformationProcessor.h:151
double _rangeXY
Range of XY (anode plane) measurement.
Definition: RowBasedFastHoughTransformationProcessor.h:116
int _maxRowDiff
Row correation parameter.
Definition: RowBasedFastHoughTransformationProcessor.h:121
std::string _inputColName
Name of the input collection.
Definition: RowBasedFastHoughTransformationProcessor.h:110
double _centerXY
Center of XY (anode plane) measurement.
Definition: RowBasedFastHoughTransformationProcessor.h:115
hitListType divide(int, int, int, int, float, float)
Divide hypercube (recursively).
Definition: RowBasedFastHoughTransformationProcessor.cc:518
int getScaleBits() const
Get scale bits.
Definition: RowBasedFastHoughTransformationProcessor.cc:456
rb_HyperPlane(int, rb_Hit *, directionsType &, double=0.75)
Construct row based hyperplane.
Definition: RowBasedFastHoughTransformationProcessor.cc:424
bool _refAtPCA
Use Pca as reference point (else 1. hit)
Definition: RowBasedFastHoughTransformationProcessor.h:131
double _unusedCut
Chi2 cut for matching unused hits in XY and Z.
Definition: RowBasedFastHoughTransformationProcessor.h:128
int _maxGap
Cut for (row) distance to segment for matching unused hits in XY and Z.
Definition: RowBasedFastHoughTransformationProcessor.h:129
rb_HyperCube(unsigned int *, hyperPlaneListType &, intListType &, unsigned int=0)
Construct row based hypercube.
Definition: RowBasedFastHoughTransformationProcessor.cc:492
int getStep(int, int) const
Get step (distances of child to mother hypercube center projected on normal).
Definition: RowBasedFastHoughTransformationProcessor.cc:481
bool _timePixFlag
Is timepix data.
Definition: RowBasedFastHoughTransformationProcessor.h:132
double _centerXZ
Center of XZ (drift time) measurement.
Definition: RowBasedFastHoughTransformationProcessor.h:117
float _effCut
Minimum hit density (hits/tracklength)
Definition: RowBasedFastHoughTransformationProcessor.h:125
Track finder based on Fast Hough Transformation.
Definition: RowBasedFastHoughTransformationProcessor.h:89
bool _useXZ
Use XZ (drift time) measurement.
Definition: RowBasedFastHoughTransformationProcessor.h:114
double _rangeXZ
Range of XZ (drift time) measurement.
Definition: RowBasedFastHoughTransformationProcessor.h:118