Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2025-02-05 23:50:57

0001 #ifndef Alignment_CommonAlignmentAlgorithm_AlignmentGlobalTrackSelector_h
0002 #define Alignment_CommonAlignmentAlgorithm_AlignmentGlobalTrackSelector_h
0003 
0004 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
0005 #include "DataFormats/MuonReco/interface/MuonFwd.h"
0006 
0007 //Framework
0008 #include "FWCore/Framework/interface/ConsumesCollector.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0011 #include "FWCore/Utilities/interface/EDGetToken.h"
0012 //STL
0013 #include <vector>
0014 
0015 namespace reco {
0016   class Track;
0017 }
0018 namespace edm {
0019   class Event;
0020   class EventSetup;
0021 }  // namespace edm
0022 
0023 class AlignmentGlobalTrackSelector {
0024 public:
0025   typedef std::vector<const reco::Track*> Tracks;
0026 
0027   /// constructor
0028   AlignmentGlobalTrackSelector(const edm::ParameterSet& cfg, edm::ConsumesCollector& iC);
0029 
0030   /// destructor
0031   ~AlignmentGlobalTrackSelector();
0032 
0033   /// select tracks
0034   Tracks select(const Tracks& tracks, const edm::Event& iEvent, const edm::EventSetup& eSetup);
0035   ///returns if any of the Filters is used.
0036   bool useThisFilter();
0037 
0038   static void fillPSetDescription(edm::ParameterSetDescription& desc);
0039 
0040 private:
0041   ///returns [tracks] if there are less than theMaxCount Jets with theMinJetPt and an empty set if not
0042   Tracks checkJetCount(const Tracks& cands, const edm::Event& iEvent) const;
0043   ///returns only isolated tracks in [cands]
0044   Tracks checkIsolation(const Tracks& cands, const edm::Event& iEvent) const;
0045   ///filter for Tracks that match the Track of a global Muon
0046   Tracks findMuons(const Tracks& tracks, const edm::Event& iEvent) const;
0047 
0048   /// private data members
0049   edm::ParameterSet theConf;
0050 
0051   //settings from conigfile
0052   bool theGMFilterSwitch;
0053   bool theIsoFilterSwitch;
0054   bool theJetCountFilterSwitch;
0055 
0056   //global Muon Filter
0057   edm::EDGetTokenT<reco::MuonCollection> theMuonToken;
0058   double theMaxTrackDeltaR;
0059   int theMinGlobalMuonCount;
0060 
0061   //isolation Cut
0062   edm::EDGetTokenT<reco::CaloJetCollection> theJetIsoToken;
0063   double theMaxJetPt;
0064   double theMinJetDeltaR;
0065   int theMinIsolatedCount;
0066 
0067   //jet count Filter
0068   edm::EDGetTokenT<reco::CaloJetCollection> theJetCountToken;
0069   double theMinJetPt;
0070   int theMaxJetCount;
0071 
0072   //helpers
0073 
0074   ///print Information on Track-Collection
0075   void printTracks(const Tracks& col) const;
0076 
0077   ///matches [src] with [comp] returns collection with matching Tracks coming from [src]
0078   Tracks matchTracks(const Tracks& src, const Tracks& comp) const;
0079 };
0080 
0081 #endif