CMS 3D CMS Logo

MeasurementEstimator.h
Go to the documentation of this file.
1 #ifndef Tracker_MeasurementEstimator_H
2 #define Tracker_MeasurementEstimator_H
3 
6 #include <limits>
7 
8 class Plane;
10 class Surface;
11 class TrackingRecHit;
12 
20 public:
21  struct OpaquePayload {
22  virtual ~OpaquePayload() {}
23  int tag = 0;
24  };
25 
27 
29  MeasurementEstimator(float maxSag, float minToll, float mpt)
30  : m_maxSagitta(maxSag), m_minTolerance2(minToll * minToll), m_minPt2ForHitRecoveryInGluedDet(mpt * mpt) {}
31 
32  virtual ~MeasurementEstimator() {}
33 
34  using HitReturnType = std::pair<bool, double>;
36 
43  virtual HitReturnType estimate(const TrajectoryStateOnSurface& ts, const TrackingRecHit& hit) const = 0;
44 
45  /* verify the compatibility of the Hit with the Trajectory based
46  * on hit properties other than those used in estimate
47  * (that usually computes the compatibility of the Trajectory with the Hit)
48  *
49  */
50  virtual bool preFilter(const TrajectoryStateOnSurface&, OpaquePayload const&) const { return true; }
51 
56  virtual SurfaceReturnType estimate(const TrajectoryStateOnSurface& ts, const Plane& plane) const = 0;
57 
58  virtual MeasurementEstimator* clone() const = 0;
59 
68  virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface& ts, const Plane& plane) const = 0;
69 
70  float maxSagitta() const { return m_maxSagitta; }
71  float minTolerance2() const { return m_minTolerance2; }
73 
74 private:
75  /*
76  * why here?
77  * MeasurementEstimator is the only configurable item that percolates down to geometry event by event (actually hit by hit) and not at initialization time
78  * It is therefore the natural candidate to collect all parameters that affect pattern-recongnition
79  * and require to be controlled with higher granularity than job level (such as iteration by iteration)
80  */
81  float m_maxSagitta = -1.; // maximal sagitta for linear approximation
82  float m_minTolerance2 = 100.; // square of minimum tolerance ot be considered inside a detector
83  float m_minPt2ForHitRecoveryInGluedDet = std::numeric_limits<float>::max(); // 0.81 to mitigate wrong preAmpl setting
84 };
85 
86 #endif // Tracker_MeasurementEstimator_H
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
virtual bool preFilter(const TrajectoryStateOnSurface &, OpaquePayload const &) const
Definition: Plane.h:16
MeasurementEstimator(float maxSag, float minToll, float mpt)
virtual MeasurementEstimator * clone() const =0
float minPt2ForHitRecoveryInGluedDet() const
virtual HitReturnType estimate(const TrajectoryStateOnSurface &ts, const TrackingRecHit &hit) const =0
std::pair< bool, double > HitReturnType