Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-24 02:13:05

0001 #ifndef MaxCCCLostHitsTrajectoryFilter_H
0002 #define MaxCCCLostHitsTrajectoryFilter_H
0003 
0004 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0005 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
0006 #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h"
0007 #include "RecoLocalTracker/SiStripClusterizer/interface/ClusterChargeCut.h"
0008 
0009 class MaxCCCLostHitsTrajectoryFilter final : public TrajectoryFilter {
0010 public:
0011   explicit MaxCCCLostHitsTrajectoryFilter(int maxCCCHits = 0, float CCC_value = 0)
0012       : theMaxCCCLostHits_(maxCCCHits), minGoodStripCharge_(CCC_value) {}
0013 
0014   explicit MaxCCCLostHitsTrajectoryFilter(const edm::ParameterSet& pset, edm::ConsumesCollector& iC)
0015       : theMaxCCCLostHits_(pset.getParameter<int>("maxCCCLostHits")),
0016         minGoodStripCharge_(clusterChargeCut(pset, "minGoodStripCharge")) {}
0017 
0018   static void fillPSetDescription(edm::ParameterSetDescription& iDesc) {
0019     iDesc.add<int>("maxCCCLostHits", 9999);
0020     iDesc.add<edm::ParameterSetDescription>("minGoodStripCharge", getConfigurationDescription4CCC(CCC::kLoose));
0021   }
0022 
0023   bool qualityFilter(const Trajectory& traj) const override { return TrajectoryFilter::qualityFilterIfNotContributing; }
0024   bool qualityFilter(const TempTrajectory& traj) const override {
0025     return TrajectoryFilter::qualityFilterIfNotContributing;
0026   }
0027 
0028   bool toBeContinued(TempTrajectory& traj) const override { return TBC<TempTrajectory>(traj); }
0029   bool toBeContinued(Trajectory& traj) const override { return TBC<Trajectory>(traj); }
0030 
0031   std::string name() const override { return "MaxCCCLostHitsTrajectoryFilter"; }
0032 
0033 protected:
0034   template <class T>
0035   bool TBC(T& traj) const {
0036     bool ret = (traj.numberOfCCCBadHits(minGoodStripCharge_) <= theMaxCCCLostHits_);
0037     if (!ret)
0038       traj.setStopReason(StopReason::MAX_CCC_LOST_HITS);
0039     return ret;
0040   }
0041 
0042   int theMaxCCCLostHits_;
0043   float minGoodStripCharge_;
0044 };
0045 
0046 #endif