Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-01-10 06:14:23

0001 #ifndef ThresholdPtTrajectoryFilter_H
0002 #define ThresholdPtTrajectoryFilter_H
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0005 #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h"
0006 #include "TrackingTools/PatternTools/interface/Trajectory.h"
0007 #include "TrackingTools/PatternTools/interface/TempTrajectory.h"
0008 #include "TrackingTools/TrajectoryState/interface/FreeTrajectoryState.h"
0009 #include "TrackingTools/TrajectoryParametrization/interface/CurvilinearTrajectoryError.h"
0010 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateAccessor.h"
0011 
0012 /** A TrajectoryFilter that stops reconstruction if P_t goes 
0013  *  above some value at some confidence level.
0014  *  The CkfTrajectoryBuilder uses this class to
0015  *  implement the conditional p_T cut
0016  */
0017 
0018 class ThresholdPtTrajectoryFilter : public TrajectoryFilter {
0019 public:
0020   explicit ThresholdPtTrajectoryFilter(double ptThreshold, float nSigma = 5.F, int nH = 3)
0021       : thePtThreshold(ptThreshold), theNSigma(nSigma), theMinHits(nH) {}
0022 
0023   explicit ThresholdPtTrajectoryFilter(const edm::ParameterSet& pset, edm::ConsumesCollector& iC)
0024       : thePtThreshold(pset.getParameter<double>("thresholdPt")),
0025         theNSigma(pset.getParameter<double>("nSigmaThresholdPt")),
0026         theMinHits(pset.getParameter<int>("minHitsThresholdPt")) {}
0027 
0028   static void fillPSetDescription(edm::ParameterSetDescription& iDesc) {
0029     iDesc.add<double>("thresholdPt", 10.);
0030     iDesc.add<double>("nSigmaThresholdPt", 5.);
0031     iDesc.add<int>("minHitsThresholdPt", 3);
0032   }
0033 
0034   bool qualityFilter(const Trajectory& traj) const override { return !test(traj.lastMeasurement(), traj.foundHits()); }
0035   bool qualityFilter(const TempTrajectory& traj) const override {
0036     return !test(traj.lastMeasurement(), traj.foundHits());
0037   }
0038 
0039   bool toBeContinued(Trajectory& traj) const override { return test(traj.lastMeasurement(), traj.foundHits()); }
0040   bool toBeContinued(TempTrajectory& traj) const override { return test(traj.lastMeasurement(), traj.foundHits()); }
0041 
0042   std::string name() const override { return "ThresholdPtTrajectoryFilter"; }
0043 
0044 protected:
0045   bool test(const TrajectoryMeasurement& tm, int foundHits) const;
0046 
0047   double thePtThreshold;
0048   double theNSigma;
0049   int theMinHits;
0050 };
0051 
0052 #endif