Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:32

0001 #ifndef CommonDet_Chi2MeasurementEstimatorBase_H
0002 #define CommonDet_Chi2MeasurementEstimatorBase_H
0003 
0004 /** \class Chi2MeasurementEstimatorBase
0005  *  A base class for  Chi2 -- type of Measurement Estimators. 
0006  *  Implements common functionality. Ported from ORCA.
0007  *
0008  *  \author todorov, cerati
0009  */
0010 
0011 #include "TrackingTools/DetLayers/interface/MeasurementEstimator.h"
0012 #include <limits>
0013 
0014 class Chi2MeasurementEstimatorBase : public MeasurementEstimator {
0015 public:
0016   /** Construct with cuts on chi2 and nSigma.
0017    *  The cut on Chi2 is used to define the acceptance of RecHits.
0018    *  The errors of the trajectory state are multiplied by nSigma 
0019    *  to define acceptance of Plane and maximalLocalDisplacement.
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