MarlinTPC  1.2.0
TrackFinderRectangularProcessor.h
1 #ifndef TRACK_FINDER_RECTANGULAR_PROCESSOR_H
2 #define TRACK_FINDER_RECTANGULAR_PROCESSOR_H
3 
4 // C++
5 #include <string>
6 #include <vector>
7 
8 // LCIO
9 #include <lcio.h>
10 
11 // Marlin
12 #include <marlin/Processor.h>
13 #include <EVENT/LCEvent.h>
14 #include <EVENT/LCRunHeader.h>
15 #include <IMPL/TrackerHitImpl.h>
16 #include <EVENT/Track.h>
17 #include <gear/PadRowLayout2D.h>
18 
19 namespace marlintpc
20 {
21 
53 class TrackFinderRectangularProcessor : public marlin::Processor
54 {
55 
56  public:
57 
58  virtual Processor* newProcessor()
59  {
61  }
62 
63 
65 
69  virtual void init() ;
70 
73  virtual void processRunHeader(lcio::LCRunHeader* run) ;
74 
77  virtual void processEvent(lcio::LCEvent * evt) ;
78 
79 
80  virtual void check(lcio::LCEvent * evt) ;
81 
82 
85  virtual void end() ;
86 
87 
88  protected:
89 
90  std::string _inputColName ;
91  std::string _outputColName ;
92 
97 
99  gear::PadRowLayout2D const * _padLayout;
100 
101 
102  int _rowHeight;
105 
107  float _deltaX, _deltaY, _deltaZ;
108 
114  int _nRun ;
115  int _nEvt ;
116 
128 
129  bool *isInTrack;
131  unsigned int nHits;
132 
134  void zeroFlags(bool *IsIn);
135 
139  void addTrackCandidateFlags();
140 
141 
142  void createNewIsInTrackFlags();
143 
145  IMPL::TrackerHitImpl extrapolateNextHit(double y);
146 
151  struct
152  {
153  float a, b, c, d;
154  } straightLine;
155 
176  void doRegression(EVENT::Track *trackCandidate);
177 } ;
178 
179 } // namespace martintpc
180 
181 #endif//TRACK_FINDER_LINEAR_ROW_BASED_H
182 
183 
184 
int _verbosityLevel
Flag about verbosity of the processor.
Definition: TrackFinderRectangularProcessor.h:127
struct marlintpc::TrackFinderRectangularProcessor::@0 straightLine
Straight line for linear regression.
int _nRun
!!!!! This information should come from the conditions data! Implemented as processor parameter for f...
Definition: TrackFinderRectangularProcessor.h:114
Processor to find linear tracks using linear regression, based on a modified version of the track fol...
Definition: TrackFinderRectangularProcessor.h:53
bool * isInTrack
Array of flags whether a hit is in a track.
Definition: TrackFinderRectangularProcessor.h:129
virtual void init()
Called at the begin of the job before anything is read.
Definition: TrackFinderRectangularProcessor.cc:94
std::string _outputColName
Definition: TrackFinderRectangularProcessor.h:91
virtual void processEvent(lcio::LCEvent *evt)
Called for every event - the working horse.
Definition: TrackFinderRectangularProcessor.cc:142
void zeroFlags(bool *IsIn)
Set flags if hit is in a track to zero.
Definition: TrackFinderRectangularProcessor.cc:122
std::string _inputColName
Definition: TrackFinderRectangularProcessor.h:90
int _minTrackHits
Minimum number of hits on track.
Definition: TrackFinderRectangularProcessor.h:103
float _deltaX
Maximum distances between predicted and measured hit.
Definition: TrackFinderRectangularProcessor.h:107
bool * isInTrackCandidate
Array of flags whether a hit is in the current track candidate.
Definition: TrackFinderRectangularProcessor.h:130
gear::PadRowLayout2D const * _padLayout
The pad layout as defined in GEAR.
Definition: TrackFinderRectangularProcessor.h:99
virtual void end()
Called after data processing for clean up.
Definition: TrackFinderRectangularProcessor.cc:553
int _outputIsTransient
give the status which is set to the transient flag of the output collection it is an int instead of a...
Definition: TrackFinderRectangularProcessor.h:96
unsigned int nHits
Number of hits in the current event.
Definition: TrackFinderRectangularProcessor.h:131
virtual void processRunHeader(lcio::LCRunHeader *run)
Called for every run.
Definition: TrackFinderRectangularProcessor.cc:107
IMPL::TrackerHitImpl extrapolateNextHit(double y)
Extrapolate the next expected hit on the track.
Definition: TrackFinderRectangularProcessor.cc:642
void doRegression(EVENT::Track *trackCandidate)
Calculate the track parameters from the hits.
Definition: TrackFinderRectangularProcessor.cc:563
int _maxSkipRows
Maximum number of missing hits.
Definition: TrackFinderRectangularProcessor.h:104
int _nEvt
The total number of events.
Definition: TrackFinderRectangularProcessor.h:115
void addTrackCandidateFlags()
Add the hits of the track candidate to the isInTrack flag array.
Definition: TrackFinderRectangularProcessor.cc:130