File indexing completed on 2024-04-06 12:31:32
0001 #ifndef CommonDet_Chi2MeasurementEstimatorBase_H
0002 #define CommonDet_Chi2MeasurementEstimatorBase_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "TrackingTools/DetLayers/interface/MeasurementEstimator.h"
0012 #include <limits>
0013
0014 class Chi2MeasurementEstimatorBase : public MeasurementEstimator {
0015 public:
0016
0017
0018
0019
0020
0021 explicit Chi2MeasurementEstimatorBase(double maxChi2,
0022 double nSigma = 3.,
0023 float maxDisp = std::numeric_limits<float>::max())
0024 : theMaxChi2(maxChi2), theNSigma(nSigma), theMaxDisplacement(maxDisp) {}
0025
0026 template <typename... Args>
0027 Chi2MeasurementEstimatorBase(double maxChi2, double nSigma, float maxDisp, Args&&... args)
0028 : MeasurementEstimator(args...), theMaxChi2(maxChi2), theNSigma(nSigma), theMaxDisplacement(maxDisp) {}
0029
0030 std::pair<bool, double> estimate(const TrajectoryStateOnSurface& ts, const TrackingRecHit&) const override = 0;
0031
0032 bool estimate(const TrajectoryStateOnSurface& ts, const Plane& plane) const final;
0033
0034 Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface& ts, const Plane& plane) const final;
0035
0036 double chiSquaredCut() const { return theMaxChi2; }
0037 double nSigmaCut() const { return theNSigma; }
0038
0039 protected:
0040 std::pair<bool, double> returnIt(double est) const {
0041 return est > chiSquaredCut() ? HitReturnType(false, est) : HitReturnType(true, est);
0042 }
0043
0044 private:
0045 const double theMaxChi2;
0046 const double theNSigma;
0047 const float theMaxDisplacement;
0048 };
0049
0050 #endif