Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:44

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