Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef JetReco_CaloJet_h
0002 #define JetReco_CaloJet_h
0003 
0004 /** \class reco::CaloJet
0005  *
0006  * \short Jets made from CaloTowers
0007  *
0008  * CaloJet represents Jets made from CaloTowers
0009  * Provide energy contributions from different subdetectors
0010  * in addition to generic Jet parameters
0011  *
0012  * \author Fedor Ratnikov, UMd
0013  *
0014  * \version   Original: April 22, 2005 by Fernando Varela Rodriguez.
0015  * 
0016  * \version   Oct 19, 2005, R. Harris, modified to work 
0017  *            with real CaloTowers. No energy fractions yet.
0018  *
0019  * \version   May 3, 2006, F.Ratnikov, include all different
0020  *            energy components separately
0021  ************************************************************/
0022 
0023 #include "DataFormats/JetReco/interface/Jet.h"
0024 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
0025 
0026 namespace reco {
0027   class CaloJet : public Jet {
0028   public:
0029     typedef CaloTowerPtr ConstituentTypePtr;
0030     typedef CaloTowerFwdPtr ConstituentTypeFwdPtr;
0031 
0032     struct Specific {
0033       Specific()
0034           : mMaxEInEmTowers(0),
0035             mMaxEInHadTowers(0),
0036             mHadEnergyInHO(0),
0037             mHadEnergyInHB(0),
0038             mHadEnergyInHF(0),
0039             mHadEnergyInHE(0),
0040             mEmEnergyInEB(0),
0041             mEmEnergyInEE(0),
0042             mEmEnergyInHF(0),
0043             mEnergyFractionHadronic(0),
0044             mEnergyFractionEm(0),
0045             mTowersArea(0) {}
0046 
0047       /// Maximum energy in EM towers
0048       float mMaxEInEmTowers;
0049       /// Maximum energy in HCAL towers
0050       float mMaxEInHadTowers;
0051       /// Hadronic nergy fraction in HO
0052       float mHadEnergyInHO;
0053       /// Hadronic energy in HB
0054       float mHadEnergyInHB;
0055       /// Hadronic energy in HF
0056       float mHadEnergyInHF;
0057       /// Hadronic energy in HE
0058       float mHadEnergyInHE;
0059       /// Em energy in EB
0060       float mEmEnergyInEB;
0061       /// Em energy in EE
0062       float mEmEnergyInEE;
0063       /// Em energy in HF
0064       float mEmEnergyInHF;
0065       /// Hadronic energy fraction
0066       float mEnergyFractionHadronic;
0067       /// Em energy fraction
0068       float mEnergyFractionEm;
0069       /// Area of contributing CaloTowers
0070       float mTowersArea;
0071     };
0072 
0073     /** Default constructor*/
0074     CaloJet() {}
0075 
0076     /** Constructor from values*/
0077     CaloJet(const LorentzVector& fP4,
0078             const Point& fVertex,
0079             const Specific& fSpecific,
0080             const Jet::Constituents& fConstituents);
0081 
0082     /** Constructor from values*/
0083     CaloJet(const LorentzVector& fP4, const Point& fVertex, const Specific& fSpecific);
0084 
0085     /** backward compatible, vertex=(0,0,0) */
0086     CaloJet(const LorentzVector& fP4, const Specific& fSpecific, const Jet::Constituents& fConstituents);
0087 
0088     ~CaloJet() override{};
0089 
0090     /** Returns the maximum energy deposited in ECAL towers*/
0091     float maxEInEmTowers() const { return m_specific.mMaxEInEmTowers; }
0092     /** Returns the maximum energy deposited in HCAL towers*/
0093     float maxEInHadTowers() const { return m_specific.mMaxEInHadTowers; }
0094     /** Returns the jet hadronic energy fraction*/
0095     float energyFractionHadronic() const { return m_specific.mEnergyFractionHadronic; }
0096     /** Returns the jet electromagnetic energy fraction*/
0097     float emEnergyFraction() const { return m_specific.mEnergyFractionEm; }
0098     /** Returns the jet hadronic energy in HB*/
0099     float hadEnergyInHB() const { return m_specific.mHadEnergyInHB; }
0100     /** Returns the jet hadronic energy in HO*/
0101     float hadEnergyInHO() const { return m_specific.mHadEnergyInHO; }
0102     /** Returns the jet hadronic energy in HE*/
0103     float hadEnergyInHE() const { return m_specific.mHadEnergyInHE; }
0104     /** Returns the jet hadronic energy in HF*/
0105     float hadEnergyInHF() const { return m_specific.mHadEnergyInHF; }
0106     /** Returns the jet electromagnetic energy in EB*/
0107     float emEnergyInEB() const { return m_specific.mEmEnergyInEB; }
0108     /** Returns the jet electromagnetic energy in EE*/
0109     float emEnergyInEE() const { return m_specific.mEmEnergyInEE; }
0110     /** Returns the jet electromagnetic energy extracted from HF*/
0111     float emEnergyInHF() const { return m_specific.mEmEnergyInHF; }
0112     /** Returns area of contributing towers */
0113     float towersArea() const { return m_specific.mTowersArea; }
0114     /** Returns the number of constituents carrying a 90% of the total Jet energy*/
0115     int n90() const { return nCarrying(0.9); }
0116     /** Returns the number of constituents carrying a 60% of the total Jet energy*/
0117     int n60() const { return nCarrying(0.6); }
0118 
0119     /// Physics Eta (use jet Z and kinematics only)
0120     //  float physicsEtaQuick (float fZVertex) const;
0121     /// Physics Eta (use jet Z and kinematics only)
0122     //float physicsEta (float fZVertex) const {return physicsEtaQuick (fZVertex);}
0123     /// Physics p4 (use jet Z and kinematics only)
0124     //LorentzVector physicsP4 (float fZVertex) const;
0125     /// Physics p4 for full 3d vertex corretion
0126     LorentzVector physicsP4(const Particle::Point& vertex) const;
0127     /// detector p4 for full 3d vertex correction.
0128     LorentzVector detectorP4() const;
0129 
0130     /// Physics Eta (loop over constituents)
0131     //float physicsEtaDetailed (float fZVertex) const;
0132 
0133     /// Detector Eta (default for CaloJets)
0134     //float detectorEta () const {return eta();}
0135 
0136     /// get specific constituent
0137     virtual CaloTowerPtr getCaloConstituent(unsigned fIndex) const;
0138     /// get all constituents
0139     virtual std::vector<CaloTowerPtr> getCaloConstituents() const;
0140 
0141     // block accessors
0142 
0143     const Specific& getSpecific() const { return m_specific; }
0144 
0145     /// Polymorphic clone
0146     CaloJet* clone() const override;
0147 
0148     /// Print object
0149     std::string print() const override;
0150 
0151     /// CaloTowers indexes
0152     std::vector<CaloTowerDetId> getTowerIndices() const;
0153 
0154   private:
0155     /// Polymorphic overlap
0156     bool overlap(const Candidate&) const override;
0157 
0158     //Variables specific to to the CaloJet class
0159     Specific m_specific;
0160   };
0161 }  // namespace reco
0162 // temporary fix before include_checcker runs globally
0163 #include "DataFormats/JetReco/interface/CaloJetCollection.h"  //INCLUDECHECKER:SKIP
0164 #endif