Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:43

0001 #ifndef JetReco_PFJet_h
0002 #define JetReco_PFJet_h
0003 
0004 /** \class reco::PFJet
0005  *
0006  * \short Jets made from PFObjects
0007  *
0008  * PFJet represents Jets made from Particle Flow objects
0009  * Provide energy contributions from different PF types
0010  * in addition to generic Jet parameters
0011  *
0012  * \author Fedor Ratnikov, UMd, Apr 24, 2007
0013  ************************************************************/
0014 
0015 #include "DataFormats/JetReco/interface/Jet.h"
0016 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
0017 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0018 
0019 namespace reco {
0020   class PFJet : public Jet {
0021   public:
0022     typedef reco::PFCandidatePtr ConstituentTypePtr;
0023     typedef reco::PFCandidateFwdPtr ConstituentTypeFwdPtr;
0024 
0025     struct Specific {
0026       Specific()
0027           : mChargedHadronEnergy(0),
0028             mNeutralHadronEnergy(0),
0029             mPhotonEnergy(0),
0030             mElectronEnergy(0),
0031             mMuonEnergy(0),
0032             mHFHadronEnergy(0),
0033             mHFEMEnergy(0),
0034 
0035             mChargedHadronMultiplicity(0),
0036             mNeutralHadronMultiplicity(0),
0037             mPhotonMultiplicity(0),
0038             mElectronMultiplicity(0),
0039             mMuonMultiplicity(0),
0040             mHFHadronMultiplicity(0),
0041             mHFEMMultiplicity(0),
0042 
0043             mChargedEmEnergy(0),
0044             mChargedMuEnergy(0),
0045             mNeutralEmEnergy(0),
0046 
0047             mChargedMultiplicity(0),
0048             mNeutralMultiplicity(0),
0049 
0050             mHOEnergy(0) {}
0051       float mChargedHadronEnergy;
0052       float mNeutralHadronEnergy;
0053       float mPhotonEnergy;
0054       float mElectronEnergy;
0055       float mMuonEnergy;
0056       float mHFHadronEnergy;
0057       float mHFEMEnergy;
0058 
0059       int mChargedHadronMultiplicity;
0060       int mNeutralHadronMultiplicity;
0061       int mPhotonMultiplicity;
0062       int mElectronMultiplicity;
0063       int mMuonMultiplicity;
0064       int mHFHadronMultiplicity;
0065       int mHFEMMultiplicity;
0066 
0067       //old (deprecated) data members
0068       //kept only for backwards compatibility:
0069       float mChargedEmEnergy;
0070       float mChargedMuEnergy;
0071       float mNeutralEmEnergy;
0072       int mChargedMultiplicity;
0073       int mNeutralMultiplicity;
0074 
0075       float mHOEnergy;
0076     };
0077 
0078     /** Default constructor*/
0079     PFJet() {}
0080 
0081     /** Constructor from values*/
0082     PFJet(const LorentzVector& fP4,
0083           const Point& fVertex,
0084           const Specific& fSpecific,
0085           const Jet::Constituents& fConstituents);
0086 
0087     PFJet(const LorentzVector& fP4, const Point& fVertex, const Specific& fSpecific);
0088 
0089     /** backward compatible, vertex=(0,0,0) */
0090     PFJet(const LorentzVector& fP4, const Specific& fSpecific, const Jet::Constituents& fConstituents);
0091 
0092     ~PFJet() override{};
0093 
0094     /// chargedHadronEnergy
0095     float chargedHadronEnergy() const { return m_specific.mChargedHadronEnergy; }
0096     ///  chargedHadronEnergyFraction
0097     float chargedHadronEnergyFraction() const { return chargedHadronEnergy() / energy(); }
0098     /// neutralHadronEnergy
0099     float neutralHadronEnergy() const { return m_specific.mNeutralHadronEnergy; }
0100     /// neutralHadronEnergyFraction
0101     float neutralHadronEnergyFraction() const { return neutralHadronEnergy() / energy(); }
0102     /// photonEnergy
0103     float photonEnergy() const { return m_specific.mPhotonEnergy; }
0104     /// photonEnergyFraction
0105     float photonEnergyFraction() const { return photonEnergy() / energy(); }
0106     /// electronEnergy
0107     float electronEnergy() const { return m_specific.mElectronEnergy; }
0108     /// electronEnergyFraction
0109     float electronEnergyFraction() const { return electronEnergy() / energy(); }
0110     /// muonEnergy
0111     float muonEnergy() const { return m_specific.mMuonEnergy; }
0112     /// muonEnergyFraction
0113     float muonEnergyFraction() const { return muonEnergy() / energy(); }
0114     /// HFHadronEnergy
0115     float HFHadronEnergy() const { return m_specific.mHFHadronEnergy; }
0116     /// HFHadronEnergyFraction
0117     float HFHadronEnergyFraction() const { return HFHadronEnergy() / energy(); }
0118     /// HFEMEnergy
0119     float HFEMEnergy() const { return m_specific.mHFEMEnergy; }
0120     /// HFEMEnergyFraction
0121     float HFEMEnergyFraction() const { return HFEMEnergy() / energy(); }
0122 
0123     /// chargedHadronMultiplicity
0124     int chargedHadronMultiplicity() const { return m_specific.mChargedHadronMultiplicity; }
0125     /// neutralHadronMultiplicity
0126     int neutralHadronMultiplicity() const { return m_specific.mNeutralHadronMultiplicity; }
0127     /// photonMultiplicity
0128     int photonMultiplicity() const { return m_specific.mPhotonMultiplicity; }
0129     /// electronMultiplicity
0130     int electronMultiplicity() const { return m_specific.mElectronMultiplicity; }
0131     /// muonMultiplicity
0132     int muonMultiplicity() const { return m_specific.mMuonMultiplicity; }
0133     /// HFHadronMultiplicity
0134     int HFHadronMultiplicity() const { return m_specific.mHFHadronMultiplicity; }
0135     /// HFEMMultiplicity
0136     int HFEMMultiplicity() const { return m_specific.mHFEMMultiplicity; }
0137 
0138     /// chargedEmEnergy
0139     float chargedEmEnergy() const { return m_specific.mChargedEmEnergy; }
0140     /// chargedEmEnergyFraction
0141     float chargedEmEnergyFraction() const { return chargedEmEnergy() / energy(); }
0142     /// chargedMuEnergy
0143     float chargedMuEnergy() const { return m_specific.mChargedMuEnergy; }
0144     /// chargedMuEnergyFraction
0145     float chargedMuEnergyFraction() const { return chargedMuEnergy() / energy(); }
0146     /// neutralEmEnergy
0147     float neutralEmEnergy() const { return m_specific.mNeutralEmEnergy; }
0148     /// neutralEmEnergyFraction
0149     float neutralEmEnergyFraction() const { return neutralEmEnergy() / energy(); }
0150 
0151     /// chargedMultiplicity
0152     int chargedMultiplicity() const { return m_specific.mChargedMultiplicity; }
0153     /// neutralMultiplicity
0154     int neutralMultiplicity() const { return m_specific.mNeutralMultiplicity; }
0155 
0156     /// hoEnergy
0157     float hoEnergy() const { return m_specific.mHOEnergy; }
0158     /// hoEnergyFraction
0159     float hoEnergyFraction() const { return hoEnergy() / energy(); }
0160 
0161     /// get specific constituent
0162     virtual reco::PFCandidatePtr getPFConstituent(unsigned fIndex) const;
0163 
0164     /// get all constituents
0165     virtual std::vector<reco::PFCandidatePtr> getPFConstituents() const;
0166 
0167     /// \ brief get all tracks in the jets
0168     /// All PFCandidates hold a reference to a track. All the non-null
0169     /// references are added to the returned TrackRefVector
0170     reco::TrackRefVector getTrackRefs() const;
0171 
0172     // block accessors
0173 
0174     const Specific& getSpecific() const { return m_specific; }
0175 
0176     /// Polymorphic clone
0177     PFJet* clone() const override;
0178 
0179     /// Print object in details
0180     std::string print() const override;
0181 
0182   private:
0183     /// Polymorphic overlap
0184     bool overlap(const Candidate&) const override;
0185 
0186     //Variables specific to to the PFJet class
0187     Specific m_specific;
0188   };
0189 
0190   // streamer
0191   std::ostream& operator<<(std::ostream& out, const reco::PFJet& jet);
0192 }  // namespace reco
0193 // temporary fix before include_checcker runs globally
0194 #include "DataFormats/JetReco/interface/PFJetCollection.h"  //INCLUDECHECKER:SKIP
0195 #endif