MarlinTPC  1.2.0
HitCandidate.h
1 #ifndef HIT_CANDIDATE_H
2 #define HIT_CANDIDATE_H
3 
4 //LCIO
5 #include <lcio.h>
6 #include <EVENT/TrackerPulse.h>
7 #include <IMPL/TrackerHitImpl.h>
8 
9 //GEAR
10 #include <gear/TPCParameters.h>
11 
12 //stl
13 #include <vector>
14 
15 namespace marlintpc
16 {
25 {
26  public:
29  HitCandidate(const gear::TPCParameters & tpcParams, double vDrift,
30  EVENT::TrackerPulse * pulse = 0);
31 
33  void addPulse(EVENT::TrackerPulse*);
34  void addDeadPad();
35 
37  void setBoundaryFlag();
38 
39 
41  const EVENT::TrackerPulse* getMaximumPulse() const
42  {
43  return _maxPulse;
44  };
45 
47  double getCharge();
48 
50  double getMaxPulseHeight() const;
51 
53  const std::vector<EVENT::TrackerPulse*>& getPulses() const
54  {
55  return _thePulses;
56  };
57 
60  unsigned int getWidth() const;
61 
65  bool isAtBoundary() const
66  {
67  return _isAtBoundary;
68  };
69 
71  double getLocalFixedCoordinate();
72 
74  double getLocalFreeCoordinate();
75 
77  double getZCoordinate();
78 
80  double getLocalFixedVariance();
81 
83  double getLocalFreeVariance();
84 
86  double getLocalSkewness();
87 
89  double getZVariance();
90 
93  lcio::DoubleVec getLocalCoordinates();
94 
97  lcio::DoubleVec getGlobalCoordinates();
98 
101  lcio::DoubleVec getGlobalCartesianCoordinates();
102 
105  lcio::FloatVec getGlobalCovarianceMatrix();
106 
109  lcio::FloatVec getGlobalCartecianCovarianceMatrix();
110 
113  IMPL::TrackerHitImpl * createTrackerHit();
114 
115  protected:
116  std::vector<EVENT::TrackerPulse*> _thePulses;
117  EVENT::TrackerPulse* _maxPulse;
118  double _maxPulseCharge;
119  int _numberOfDeadPads;
120  bool _isAtBoundary;
121  double _vDrift;
122  double _zAnode;
123 
124  const gear::TPCParameters & _tpcParameters;
125  const gear::TPCModule * _tpcModule;
126 
127  // the parameters calculated by calculateHitProperties
128 
129  lcio::DoubleVec _localCoordinates;
130  lcio::DoubleVec _globalCoordinates;
131  lcio::FloatVec _globalCovariance;
132 
133  double _charge;
134  double _localFixedVariance;
135  double _localFreeVariance;
136  double _localSkewness;
137  double _zVariance;
138 
140  void calculateHitProperties();
141 
142  bool _hitParametersAreValid;
143 };
145 
146 }
147 
148 #endif //HIT_CANDIDATE_H
double getMaxPulseHeight() const
Get the maximal pulse heigt in this hit.
Definition: HitCandidate.cc:72
double getCharge()
Get the overall charge in the hit.
Definition: HitCandidate.cc:63
lcio::DoubleVec getGlobalCartesianCoordinates()
Get the global coordinates in cartesian format (in lcio it is always cartesian).
A helper class for hit parameter calculation.
Definition: HitCandidate.h:24
double getLocalFixedVariance()
Get the variance (estimated error) perpendicular to the pad row (y or r)
Definition: HitCandidate.cc:115
double _localSkewness
The skewness in local coordinates.
Definition: HitCandidate.h:136
HitCandidate(const gear::TPCParameters &tpcParams, double vDrift, EVENT::TrackerPulse *pulse=0)
The constructor needs a reference to TPCParameters and the dirft velocity Optionally the first pulse ...
lcio::FloatVec getGlobalCovarianceMatrix()
Get the covariance matrix in global coordinates (polar or cartesian, depending on the coordinate syst...
Definition: HitCandidate.cc:150
void addPulse(EVENT::TrackerPulse *)
Add a pulse to the hit.
lcio::DoubleVec getGlobalCoordinates()
Get the global coordinates (polar or cartesian, depending on the coordinate system).
Definition: HitCandidate.cc:143
IMPL::TrackerHitImpl * createTrackerHit()
Convenience function that allocates a new TrackerHitImpl in memory, sets all parameters and adds the ...
Definition: HitCandidate.cc:291
double getLocalSkewness()
Get the skewness along the pad row.
const EVENT::TrackerPulse * getMaximumPulse() const
Return the highest pulse in this hit.
Definition: HitCandidate.h:41
bool isAtBoundary() const
Return whether the hit contains pulses on the boundary pads of a module.
Definition: HitCandidate.h:65
double getLocalFixedCoordinate()
Get the middle of the pad row (y or r)
Definition: HitCandidate.cc:82
lcio::FloatVec getGlobalCartecianCovarianceMatrix()
Get the global covariance matrix in cartesian coordinates.
void setBoundaryFlag()
Manually turn on the boundary flag.
Definition: HitCandidate.cc:58
double getZVariance()
Get the variance (estimated error) in z.
Definition: HitCandidate.cc:129
const std::vector< EVENT::TrackerPulse * > & getPulses() const
Get a vector with the pulses contributing to this hits candidate.
Definition: HitCandidate.h:53
double getZCoordinate()
Get the z coordinate.
Definition: HitCandidate.cc:108
unsigned int getWidth() const
Return the number of pulses contributing to this hits candidate.
Definition: HitCandidate.cc:77
lcio::DoubleVec getLocalCoordinates()
Get the local coordinates (polar or cartesian, depending on the pad plane).
Definition: HitCandidate.cc:136
double getLocalFreeVariance()
Get the variance (estimated error) along the pad row (in x or phi)
Definition: HitCandidate.cc:122
void calculateHitProperties()
(re)calculate the properties of this hit candidate
Definition: HitCandidate.cc:157
double getLocalFreeCoordinate()
Get the coordinate along the pad row (x or phi)
Definition: HitCandidate.cc:95