Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:34:59

0001 // \class JetTracksAssociationDR
0002 // Associate jets with tracks by simple "delta R" criteria
0003 // Fedor Ratnikov (UMd)
0004 
0005 #ifndef RecoJets_JetAssociationAlgorithms_JetTracksAssociationDR_h
0006 #define RecoJets_JetAssociationAlgorithms_JetTracksAssociationDR_h
0007 
0008 #include "DataFormats/JetReco/interface/Jet.h"
0009 #include "DataFormats/JetReco/interface/JetTracksAssociation.h"
0010 #include "DataFormats/TrackReco/interface/Track.h"
0011 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0012 
0013 class MagneticField;
0014 class Propagator;
0015 
0016 class JetTracksAssociationDR {
0017 public:
0018   // ---------- Con(de)structors ----------
0019 
0020   /// Constructor taking dR threshold as argument
0021   explicit JetTracksAssociationDR(double dr_threshold);
0022 
0023   /// Destructor
0024   virtual ~JetTracksAssociationDR();
0025 
0026   // ---------- Typedefs ----------
0027 
0028   /// Container for jet-track associations
0029   typedef reco::JetTracksAssociation::Container Association;
0030 
0031   /// Handle to jet collection
0032   typedef edm::Handle<edm::View<reco::Jet> > Jets;
0033 
0034   /// Handle to track collection
0035   typedef edm::Handle<reco::TrackCollection> Tracks;
0036 
0037   // Jet reference
0038   typedef edm::RefToBase<reco::Jet> JetRef;
0039 
0040   // Collection of jet references
0041   typedef std::vector<JetRef> JetRefs;
0042 
0043   // Collection of track references
0044   typedef std::vector<reco::TrackRef> TrackRefs;
0045 
0046   // Track Quality
0047   typedef reco::TrackBase::TrackQuality TrackQuality;
0048 
0049   // ---------- Public interface ----------
0050 
0051   // Associate tracks to jets
0052   void associateTracksToJets(Association*, const JetRefs&, const TrackRefs&);
0053 
0054   /// Associate tracks to the given jet
0055   virtual void associateTracksToJet(reco::TrackRefVector&, const reco::Jet&, const TrackRefs&) = 0;
0056 
0057   // Takes Handle as input and creates collection of edm::Refs
0058   static void createJetRefs(JetRefs&, const Jets&);
0059 
0060   // Takes Handle as input and creates collection of edm::Refs
0061   static void createTrackRefs(TrackRefs&, const Tracks&, const TrackQuality&);
0062 
0063 protected:
0064   /// Private default constructor
0065   JetTracksAssociationDR() {}
0066 
0067   /// Threshold used to associate tracks to jets
0068   double mDeltaR2Threshold;
0069 };
0070 
0071 #endif  // RecoJets_JetAssociationAlgorithms_JetTracksAssociationDR_h