Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef JetReco_JPTJet_h
0002 #define JetReco_JPTJet_h
0003 
0004 /** \class reco::JPTJet
0005  *
0006  * \short Jets made from CaloJets corrected for ZSP and tracks
0007  *
0008  * JPTJet represents Jets made from CaloTowers
0009  * and corrected for tracks
0010  * in addition to generic Jet parameters it gives
0011  * reference to the original jet, ZSP scale, associated tracks  
0012  *
0013  * \author Olga Kodolova
0014  *
0015  ************************************************************/
0016 
0017 #include "DataFormats/JetReco/interface/Jet.h"
0018 #include "DataFormats/JetReco/interface/JetCollection.h"
0019 #include "DataFormats/JetReco/interface/CaloJet.h"
0020 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
0021 #include "DataFormats/TrackReco/interface/Track.h"
0022 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0023 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
0024 #include "DataFormats/Common/interface/Ref.h"
0025 #include "DataFormats/Common/interface/RefVector.h"
0026 
0027 namespace reco {
0028   class JPTJet : public Jet {
0029   public:
0030     struct Specific {
0031       Specific()
0032           : mZSPCor(0),
0033             mChargedHadronEnergy(0),
0034             mNeutralHadronEnergy(0),
0035             mChargedEmEnergy(0),
0036             mNeutralEmEnergy(0),
0037             mResponseOfChargedWithEff(0),
0038             mResponseOfChargedWithoutEff(0),
0039             mSumPtOfChargedWithEff(0),
0040             mSumPtOfChargedWithoutEff(0),
0041             mSumEnergyOfChargedWithEff(0),
0042             mSumEnergyOfChargedWithoutEff(0),
0043             R2momtr(0),
0044             Eta2momtr(0),
0045             Phi2momtr(0),
0046             Pout(0),
0047             Zch(0) {}
0048       float mZSPCor;
0049       edm::RefToBase<reco::Jet> theCaloJetRef;
0050       reco::TrackRefVector pionsInVertexInCalo;
0051       reco::TrackRefVector pionsInVertexOutCalo;
0052       reco::TrackRefVector pionsOutVertexInCalo;
0053       reco::TrackRefVector muonsInVertexInCalo;
0054       reco::TrackRefVector muonsInVertexOutCalo;
0055       reco::TrackRefVector muonsOutVertexInCalo;
0056       reco::TrackRefVector elecsInVertexInCalo;
0057       reco::TrackRefVector elecsInVertexOutCalo;
0058       reco::TrackRefVector elecsOutVertexInCalo;
0059       float mChargedHadronEnergy;
0060       float mNeutralHadronEnergy;
0061       float mChargedEmEnergy;
0062       float mNeutralEmEnergy;
0063       float mResponseOfChargedWithEff;
0064       float mResponseOfChargedWithoutEff;
0065       float mSumPtOfChargedWithEff;
0066       float mSumPtOfChargedWithoutEff;
0067       float mSumEnergyOfChargedWithEff;
0068       float mSumEnergyOfChargedWithoutEff;
0069       float R2momtr;
0070       float Eta2momtr;
0071       float Phi2momtr;
0072       float Pout;
0073       float Zch;
0074     };
0075 
0076     /** Default constructor*/
0077     JPTJet() {}
0078 
0079     /** Constructor from values*/
0080     JPTJet(const LorentzVector& fP4,
0081            const Point& fVertex,
0082            const Specific& fSpecific,
0083            const Jet::Constituents& fConstituents);
0084 
0085     /** backward compatible, vertex=(0,0,0) */
0086     JPTJet(const LorentzVector& fP4, const Specific& fSpecific, const Jet::Constituents& fConstituents);
0087 
0088     ~JPTJet() override{};
0089 
0090     /// chargedHadronEnergy
0091     float chargedHadronEnergy() const { return mspecific.mChargedHadronEnergy; }
0092     ///  chargedHadronEnergyFraction
0093     float chargedHadronEnergyFraction() const { return chargedHadronEnergy() / energy(); }
0094     /// neutralHadronEnergy
0095     float neutralHadronEnergy() const { return mspecific.mNeutralHadronEnergy; }
0096     /// neutralHadronEnergyFraction
0097     float neutralHadronEnergyFraction() const { return neutralHadronEnergy() / energy(); }
0098     /// chargedEmEnergy
0099     float chargedEmEnergy() const { return mspecific.mChargedEmEnergy; }
0100     /// chargedEmEnergyFraction
0101     float chargedEmEnergyFraction() const { return chargedEmEnergy() / energy(); }
0102     /// neutralEmEnergy
0103     float neutralEmEnergy() const { return mspecific.mNeutralEmEnergy; }
0104     /// neutralEmEnergyFraction
0105     float neutralEmEnergyFraction() const { return neutralEmEnergy() / energy(); }
0106     /// chargedMultiplicity
0107     int chargedMultiplicity() const {
0108       return mspecific.muonsInVertexInCalo.size() + mspecific.muonsInVertexOutCalo.size() +
0109              mspecific.pionsInVertexInCalo.size() + mspecific.pionsInVertexOutCalo.size() +
0110              mspecific.elecsInVertexInCalo.size() + mspecific.elecsInVertexOutCalo.size();
0111     }
0112     /// muonMultiplicity
0113     int muonMultiplicity() const {
0114       return mspecific.muonsInVertexInCalo.size() + mspecific.muonsInVertexOutCalo.size();
0115     }
0116     /// elecMultiplicity
0117     int elecMultiplicity() const {
0118       return mspecific.elecsInVertexInCalo.size() + mspecific.elecsInVertexOutCalo.size();
0119     }
0120     /// Tracks
0121     const reco::TrackRefVector& getPionsInVertexInCalo() const { return mspecific.pionsInVertexInCalo; }
0122     const reco::TrackRefVector& getPionsInVertexOutCalo() const { return mspecific.pionsInVertexOutCalo; }
0123     const reco::TrackRefVector& getPionsOutVertexInCalo() const { return mspecific.pionsOutVertexInCalo; }
0124     const reco::TrackRefVector& getMuonsInVertexInCalo() const { return mspecific.muonsInVertexInCalo; }
0125     const reco::TrackRefVector& getMuonsInVertexOutCalo() const { return mspecific.muonsInVertexOutCalo; }
0126     const reco::TrackRefVector& getMuonsOutVertexInCalo() const { return mspecific.muonsOutVertexInCalo; }
0127     const reco::TrackRefVector& getElecsInVertexInCalo() const { return mspecific.elecsInVertexInCalo; }
0128     const reco::TrackRefVector& getElecsInVertexOutCalo() const { return mspecific.elecsInVertexOutCalo; }
0129     const reco::TrackRefVector& getElecsOutVertexInCalo() const { return mspecific.elecsOutVertexInCalo; }
0130 
0131     const float& getZSPCor() const { return mspecific.mZSPCor; }
0132 
0133     const edm::RefToBase<reco::Jet>& getCaloJetRef() const { return mspecific.theCaloJetRef; }
0134     /// block accessors
0135 
0136     const Specific& getSpecific() const { return mspecific; }
0137 
0138     /// Polymorphic clone
0139     JPTJet* clone() const override;
0140 
0141     /// Print object in details
0142     virtual void printJet() const;
0143 
0144     std::string print() const override;
0145 
0146   private:
0147     /// Polymorphic overlap
0148     bool overlap(const Candidate&) const override;
0149 
0150     //Variables specific to to the JPTJet class
0151 
0152     Specific mspecific;
0153     //reco::CaloJetRef theCaloJetRef;
0154   };
0155 
0156   // streamer
0157   //std::ostream& operator<<(std::ostream& out, const reco::JPTJet& jet);
0158 }  // namespace reco
0159 // temporary fix before include_checcker runs globally
0160 #include "DataFormats/JetReco/interface/JPTJetCollection.h"  //INCLUDECHECKER:SKIP
0161 #endif