00001 #ifndef JetMatchingTools_h 00002 #define JetMatchingTools_h 00003 00004 #include <vector> 00005 00006 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h" 00007 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" 00008 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h" 00009 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h" 00010 #include "SimDataFormats/Track/interface/SimTrackContainer.h" 00011 #include "DataFormats/HepMCCandidate/interface/GenParticle.h" 00012 00013 namespace edm { 00014 class Event; 00015 } 00016 namespace reco { 00017 class CaloJet; 00018 class GenJet; 00019 } 00020 class CaloTower; 00021 class CaloRecHit; 00022 class DetId; 00023 class PCaloHit; 00024 00025 class JetMatchingTools { 00026 public: 00027 JetMatchingTools (const edm::Event& fEvent); 00028 ~JetMatchingTools (); 00029 00031 std::vector <const CaloTower*> getConstituents (const reco::CaloJet& fJet ) ; 00033 std::vector <const CaloRecHit*> getConstituents (const CaloTower& fTower) ; 00035 std::vector <DetId> getConstituentIds (const CaloTower& fTower) ; 00037 std::vector <const PCaloHit*> getPCaloHits (DetId fId) ; 00039 int getTrackId (const PCaloHit& fHit) ; 00041 const SimTrack* getTrack (unsigned fSimTrackId); 00043 int generatorId (unsigned fSimTrackId) ; 00045 const reco::GenParticle* getGenParticle (int fGeneratorId); 00047 std::vector <const reco::GenParticle*> getGenParticles (const reco::CaloJet& fJet, bool fVerbose = true); 00049 std::vector <const reco::GenParticle*> getGenParticles (const reco::GenJet& fJet); 00050 00051 // reverse propagation 00053 std::vector <const PCaloHit*> getPCaloHits (int fGeneratorId); 00055 std::vector <const CaloRecHit*> getCaloRecHits (int fGeneratorId); 00057 std::vector <const CaloTower*> getCaloTowers (int fGeneratorId); 00058 00060 double lostEnergyFraction (const reco::CaloJet& fJet ); 00061 00063 double overlapEnergyFraction (const std::vector <const reco::GenParticle*>& fObject, 00064 const std::vector <const reco::GenParticle*>& fReference) const; 00065 00066 00067 const EBRecHitCollection* getEBRecHitCollection (); 00068 const EERecHitCollection* getEERecHitCollection (); 00069 const HBHERecHitCollection* getHBHERecHitCollection (); 00070 const HORecHitCollection* getHORecHitCollection (); 00071 const HFRecHitCollection* getHFRecHitCollection (); 00072 const edm::PCaloHitContainer* getEBSimHitCollection (); 00073 const edm::PCaloHitContainer* getEESimHitCollection (); 00074 const edm::PCaloHitContainer* getHcalSimHitCollection (); 00075 const edm::SimTrackContainer* getSimTrackCollection (); 00076 const edm::SimVertexContainer* getSimVertexCollection (); 00077 const reco::CandidateCollection* getGenParticlesCollection (); 00078 00079 00080 00081 private: 00082 const edm::Event* mEvent; 00083 const EBRecHitCollection* mEBRecHitCollection; 00084 const EERecHitCollection* mEERecHitCollection; 00085 const HBHERecHitCollection* mHBHERecHitCollection; 00086 const HORecHitCollection* mHORecHitCollection; 00087 const HFRecHitCollection* mHFRecHitCollection; 00088 const edm::PCaloHitContainer* mEBSimHitCollection; 00089 const edm::PCaloHitContainer* mEESimHitCollection; 00090 const edm::PCaloHitContainer* mHcalSimHitCollection; 00091 const edm::SimTrackContainer* mSimTrackCollection; 00092 const edm::SimVertexContainer* mSimVertexCollection; 00093 const reco::CandidateCollection* mGenParticleCollection; 00094 }; 00095 00096 #endif