Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef JetReco_GenJet_h
0002 #define JetReco_GenJet_h
0003 
0004 /** \class reco::GenJet
0005  *
0006  * \short Jets made from MC generator particles
0007  *
0008  * GenJet represents Jets made from MC candidates
0009  * Provide energy contributions from different particle types
0010  * in addition to generic Jet parameters
0011  *
0012  * \author Fedor Ratnikov, UMd
0013  *
0014  * \version   Original March 31, 2006 by F.R. 
0015  *            Added GenJet specifics, 2019 by Salvatore Rappoccio
0016  ************************************************************/
0017 
0018 #include "DataFormats/JetReco/interface/Jet.h"
0019 
0020 namespace reco {
0021   class GenParticle;
0022 
0023   class GenJet : public Jet {
0024   public:
0025     struct Specific {
0026       Specific()
0027           : m_EmEnergy(0),
0028             m_HadEnergy(0),
0029             m_InvisibleEnergy(0),
0030             m_AuxiliaryEnergy(0),
0031             m_ChargedHadronEnergy(0),
0032             m_NeutralHadronEnergy(0),
0033             m_ChargedEmEnergy(0),
0034             m_NeutralEmEnergy(0),
0035             m_MuonEnergy(0),
0036             m_ChargedHadronMultiplicity(0),
0037             m_NeutralHadronMultiplicity(0),
0038             m_ChargedEmMultiplicity(0),
0039             m_NeutralEmMultiplicity(0),
0040             m_MuonMultiplicity(0) {}
0041 
0042       /// Calo-like definitions:
0043       /// Energy of EM particles
0044       float m_EmEnergy;
0045       /// Energy of Hadrons
0046       float m_HadEnergy;
0047       /// Invisible energy (mu, nu, ...)
0048       float m_InvisibleEnergy;
0049       /// Anything else (undecayed Sigmas etc.)
0050       float m_AuxiliaryEnergy;
0051 
0052       /// PF-like definitions:
0053       /// pi+, K+, etc
0054       float m_ChargedHadronEnergy;
0055       /// K0, etc
0056       float m_NeutralHadronEnergy;
0057       /// Electrons
0058       float m_ChargedEmEnergy;
0059       /// Photons
0060       float m_NeutralEmEnergy;
0061       /// Muons
0062       float m_MuonEnergy;
0063       /// Corresponding multiplicities:
0064       int m_ChargedHadronMultiplicity;
0065       int m_NeutralHadronMultiplicity;
0066       int m_ChargedEmMultiplicity;
0067       int m_NeutralEmMultiplicity;
0068       int m_MuonMultiplicity;
0069     };
0070 
0071     /** Default constructor*/
0072     GenJet() {}
0073 
0074     /** Constructor from values*/
0075     GenJet(const LorentzVector& fP4,
0076            const Point& fVertex,
0077            const Specific& fSpecific,
0078            const Jet::Constituents& fConstituents);
0079     GenJet(const LorentzVector& fP4, const Point& fVertex, const Specific& fSpecific);
0080 
0081     /** backward compatible, vertex=(0,0,0) */
0082     GenJet(const LorentzVector& fP4, const Specific& fSpecific, const Jet::Constituents& fConstituents);
0083 
0084     ~GenJet() override{};
0085     /** Returns energy of electromagnetic particles*/
0086     float emEnergy() const { return m_specific.m_EmEnergy; };
0087     /** Returns energy of hadronic particles*/
0088     float hadEnergy() const { return m_specific.m_HadEnergy; };
0089     /** Returns invisible energy*/
0090     float invisibleEnergy() const { return m_specific.m_InvisibleEnergy; };
0091     /** Returns other energy (undecayed Sigmas etc.)*/
0092     float auxiliaryEnergy() const { return m_specific.m_AuxiliaryEnergy; };
0093 
0094     // PF-like definitions
0095     float chargedHadronEnergy() const { return m_specific.m_ChargedHadronEnergy; }
0096     float neutralHadronEnergy() const { return m_specific.m_NeutralHadronEnergy; }
0097     float chargedEmEnergy() const { return m_specific.m_ChargedEmEnergy; }
0098     float neutralEmEnergy() const { return m_specific.m_NeutralEmEnergy; }
0099     float muonEnergy() const { return m_specific.m_MuonEnergy; }
0100     int chargedHadronMultiplicity() const { return m_specific.m_ChargedHadronMultiplicity; }
0101     int neutralHadronMultiplicity() const { return m_specific.m_NeutralHadronMultiplicity; }
0102     int chargedEmMultiplicity() const { return m_specific.m_ChargedEmMultiplicity; }
0103     int neutralEmMultiplicity() const { return m_specific.m_NeutralEmMultiplicity; }
0104     int muonMultiplicity() const { return m_specific.m_MuonMultiplicity; }
0105 
0106     /// Detector Eta (use reference Z and jet kinematics only)
0107     float detectorEta(float fZVertex) const;
0108 
0109     /// convert generic constituent to specific type
0110     static const GenParticle* genParticle(const reco::Candidate* fConstituent);
0111     /// get specific constituent
0112     virtual const GenParticle* getGenConstituent(unsigned fIndex) const;
0113     /// get all constituents
0114     virtual std::vector<const GenParticle*> getGenConstituents() const;
0115 
0116     // block accessors
0117 
0118     const Specific& getSpecific() const { return m_specific; }
0119 
0120     /// set the specific (note: responsibility of keeping it consistent with the jet daughers belongs to the caller)
0121     void setSpecific(const Specific& spec) { m_specific = spec; }
0122 
0123     /// Polymorphic clone
0124     GenJet* clone() const override;
0125 
0126     /// Print object
0127     std::string print() const override;
0128 
0129   private:
0130     /// Polymorphic overlap
0131     bool overlap(const Candidate&) const override;
0132 
0133     // Data members
0134     //Variables specific to to the GenJet class
0135     Specific m_specific;
0136   };
0137 }  // namespace reco
0138 // temporary fix before include_checcker runs globally
0139 #include "DataFormats/JetReco/interface/GenJetCollection.h"  //INCLUDECHECKER:SKIP
0140 #endif