Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-16 03:23:10

0001 #ifndef Alignment_CommonAlignmentAlgorithm_AlignmentTrackSelector_h
0002 #define Alignment_CommonAlignmentAlgorithm_AlignmentTrackSelector_h
0003 
0004 #include "DataFormats/Alignment/interface/AliClusterValueMapFwd.h"
0005 #include "DataFormats/TrackReco/interface/Track.h"
0006 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0007 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
0008 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
0009 #include "FWCore/Framework/interface/ConsumesCollector.h"
0010 #include "FWCore/Utilities/interface/EDGetToken.h"
0011 #include "FWCore/Utilities/interface/InputTag.h"
0012 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0013 #include <vector>
0014 
0015 namespace edm {
0016   class Event;
0017   class EventSetup;
0018   class ParameterSet;
0019 }  // namespace edm
0020 
0021 class TrackingRecHit;
0022 class SiStripRecHit1D;
0023 class SiStripRecHit2D;
0024 
0025 class AlignmentTrackSelector {
0026 public:
0027   typedef std::vector<const reco::Track*> Tracks;
0028 
0029   /// constructor
0030   AlignmentTrackSelector(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC);
0031 
0032   /// destructor
0033   ~AlignmentTrackSelector();
0034 
0035   /// select tracks
0036   Tracks select(const Tracks& tracks, const edm::Event& evt, const edm::EventSetup& eSetup) const;
0037   ///returns if any of the Filters is used.
0038   bool useThisFilter();
0039 
0040 private:
0041   /// apply basic cuts on pt,eta,phi,nhit
0042   Tracks basicCuts(const Tracks& tracks, const edm::Event& evt, const edm::EventSetup& eSetup) const;
0043   /// checking hit requirements beyond simple number of valid hits
0044   bool detailedHitsCheck(const reco::Track* track, const edm::Event& evt, const edm::EventSetup& eSetup) const;
0045   bool isHit2D(const TrackingRecHit& hit) const;
0046   /// if valid, check for minimum charge (currently only in strip), if invalid give true
0047   bool isOkCharge(const TrackingRecHit* therechit) const;
0048   bool isOkChargeStripHit(const SiStripRecHit1D& siStripRecHit1D) const;
0049   bool isOkChargeStripHit(const SiStripRecHit2D& siStripRecHit2D) const;
0050   bool isIsolated(const TrackingRecHit* therechit, const edm::Event& evt) const;
0051   bool isOkTrkQuality(const reco::Track* track) const;
0052 
0053   /// filter the n highest pt tracks
0054   Tracks theNHighestPtTracks(const Tracks& tracks) const;
0055 
0056   //filter tracks that do not have a min # of hits taken by the Skim&Prescale workflow
0057   Tracks checkPrescaledHits(const Tracks& tracks, const edm::Event& evt) const;
0058 
0059   /// compare two tracks in pt (used by theNHighestPtTracks)
0060   struct ComparePt {
0061     bool operator()(const reco::Track* t1, const reco::Track* t2) const { return t1->pt() > t2->pt(); }
0062   };
0063   ComparePt ptComparator;
0064 
0065   edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0066 
0067   const bool applyBasicCuts_, applyNHighestPt_, applyMultiplicityFilter_;
0068   const int seedOnlyFromAbove_;
0069   const bool applyIsolation_, chargeCheck_;
0070   const int nHighestPt_, minMultiplicity_, maxMultiplicity_;
0071   const bool multiplicityOnInput_;  /// if true, cut min/maxMultiplicity on input instead of on final result
0072   const double ptMin_, ptMax_, pMin_, pMax_, etaMin_, etaMax_, phiMin_, phiMax_;
0073   const double nHitMin_, nHitMax_, chi2nMax_, d0Min_, d0Max_, dzMin_, dzMax_;
0074   const int theCharge_;
0075   const double minHitChargeStrip_, minHitIsolation_;
0076   edm::EDGetTokenT<SiStripRecHit2DCollection> rphirecHitsToken_;
0077   edm::EDGetTokenT<SiStripMatchedRecHit2DCollection> matchedrecHitsToken_;
0078   const bool countStereoHitAs2D_;  // count hits on stereo components of GluedDet for nHitMin2D_?
0079   const unsigned int nHitMin2D_;
0080   const int minHitsinTIB_, minHitsinTOB_, minHitsinTID_, minHitsinTEC_;
0081   const int minHitsinBPIX_, minHitsinFPIX_, minHitsinPIX_;
0082   const int minHitsinTIDplus_, minHitsinTIDminus_, minHitsinTECplus_, minHitsinTECminus_;
0083   const int minHitsinFPIXplus_, minHitsinFPIXminus_;
0084   const int minHitsinENDCAP_, minHitsinENDCAPplus_, minHitsinENDCAPminus_;
0085   const double maxHitDiffEndcaps_;
0086   const double nLostHitMax_;
0087   std::vector<double> RorZofFirstHitMin_;
0088   std::vector<double> RorZofFirstHitMax_;
0089   std::vector<double> RorZofLastHitMin_;
0090   std::vector<double> RorZofLastHitMax_;
0091 
0092   const edm::InputTag clusterValueMapTag_;                     // ValueMap containing association cluster - flag
0093   edm::EDGetTokenT<AliClusterValueMap> clusterValueMapToken_;  // ValueMap containing association cluster - flag
0094   const int minPrescaledHits_;
0095   const bool applyPrescaledHitsFilter_;
0096 
0097   std::vector<reco::TrackBase::TrackQuality> trkQualities_;
0098 
0099   std::vector<reco::TrackBase::TrackAlgorithm> trkSteps_;
0100   bool applyTrkQualityCheck_;
0101   bool applyIterStepCheck_;
0102 };
0103 
0104 #endif