Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:24

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           : mChargedHadronEnergy(0),
0033             mChargedEmEnergy(0),
0034             mResponseOfChargedWithEff(0),
0035             mResponseOfChargedWithoutEff(0),
0036             mSumPtOfChargedWithEff(0),
0037             mSumPtOfChargedWithoutEff(0),
0038             mSumEnergyOfChargedWithEff(0),
0039             mSumEnergyOfChargedWithoutEff(0),
0040             R2momtr(0),
0041             Eta2momtr(0),
0042             Phi2momtr(0),
0043             Pout(0),
0044             Zch(0),
0045             JPTSeed(0) {}
0046       edm::RefToBase<reco::Jet> theCaloJetRef;
0047       reco::TrackRefVector pionsInVertexInCalo;
0048       reco::TrackRefVector pionsInVertexOutCalo;
0049       reco::TrackRefVector pionsOutVertexInCalo;
0050       reco::TrackRefVector muonsInVertexInCalo;
0051       reco::TrackRefVector muonsInVertexOutCalo;
0052       reco::TrackRefVector muonsOutVertexInCalo;
0053       reco::TrackRefVector elecsInVertexInCalo;
0054       reco::TrackRefVector elecsInVertexOutCalo;
0055       reco::TrackRefVector elecsOutVertexInCalo;
0056       float mChargedHadronEnergy;
0057       float mChargedEmEnergy;
0058       float mResponseOfChargedWithEff;
0059       float mResponseOfChargedWithoutEff;
0060       float mSumPtOfChargedWithEff;
0061       float mSumPtOfChargedWithoutEff;
0062       float mSumEnergyOfChargedWithEff;
0063       float mSumEnergyOfChargedWithoutEff;
0064       float R2momtr;
0065       float Eta2momtr;
0066       float Phi2momtr;
0067       float Pout;
0068       float Zch;
0069       int JPTSeed;
0070     };
0071 
0072     /** Default constructor*/
0073     JPTJet() {}
0074 
0075     /** Constructor from values*/
0076     JPTJet(const LorentzVector& fP4,
0077            const Point& fVertex,
0078            const Specific& fSpecific,
0079            const Jet::Constituents& fConstituents);
0080 
0081     /** backward compatible, vertex=(0,0,0) */
0082     JPTJet(const LorentzVector& fP4, const Specific& fSpecific, const Jet::Constituents& fConstituents);
0083 
0084     ~JPTJet() override{};
0085     /// chargedHadronEnergy
0086     float chargedHadronEnergy() const { return mspecific.mChargedHadronEnergy; }
0087     ///  chargedHadronEnergyFraction
0088     float chargedHadronEnergyFraction() const { return chargedHadronEnergy() / energy(); }
0089     /// chargedEmEnergy
0090     float chargedEmEnergy() const { return mspecific.mChargedEmEnergy; }
0091     /// chargedEmEnergyFraction
0092     float chargedEmEnergyFraction() const { return chargedEmEnergy() / energy(); }
0093     /// chargedMultiplicity
0094     int chargedMultiplicity() const {
0095       return mspecific.muonsInVertexInCalo.size() + mspecific.muonsInVertexOutCalo.size() +
0096              mspecific.pionsInVertexInCalo.size() + mspecific.pionsInVertexOutCalo.size() +
0097              mspecific.elecsInVertexInCalo.size() + mspecific.elecsInVertexOutCalo.size();
0098     }
0099     /// muonMultiplicity
0100     int muonMultiplicity() const {
0101       return mspecific.muonsInVertexInCalo.size() + mspecific.muonsInVertexOutCalo.size();
0102     }
0103     /// elecMultiplicity
0104     int elecMultiplicity() const {
0105       return mspecific.elecsInVertexInCalo.size() + mspecific.elecsInVertexOutCalo.size();
0106     }
0107     /// Tracks
0108     const reco::TrackRefVector& getPionsInVertexInCalo() const { return mspecific.pionsInVertexInCalo; }
0109     const reco::TrackRefVector& getPionsInVertexOutCalo() const { return mspecific.pionsInVertexOutCalo; }
0110     const reco::TrackRefVector& getPionsOutVertexInCalo() const { return mspecific.pionsOutVertexInCalo; }
0111     const reco::TrackRefVector& getMuonsInVertexInCalo() const { return mspecific.muonsInVertexInCalo; }
0112     const reco::TrackRefVector& getMuonsInVertexOutCalo() const { return mspecific.muonsInVertexOutCalo; }
0113     const reco::TrackRefVector& getMuonsOutVertexInCalo() const { return mspecific.muonsOutVertexInCalo; }
0114     const reco::TrackRefVector& getElecsInVertexInCalo() const { return mspecific.elecsInVertexInCalo; }
0115     const reco::TrackRefVector& getElecsInVertexOutCalo() const { return mspecific.elecsInVertexOutCalo; }
0116     const reco::TrackRefVector& getElecsOutVertexInCalo() const { return mspecific.elecsOutVertexInCalo; }
0117 
0118     const edm::RefToBase<reco::Jet>& getCaloJetRef() const { return mspecific.theCaloJetRef; }
0119     /// block accessors
0120 
0121     const Specific& getSpecific() const { return mspecific; }
0122 
0123     /// Polymorphic clone
0124     JPTJet* clone() const override;
0125 
0126     /// Print object in details
0127     virtual void printJet() const;
0128 
0129     std::string print() const override;
0130 
0131   private:
0132     /// Polymorphic overlap
0133     bool overlap(const Candidate&) const override;
0134 
0135     //Variables specific to to the JPTJet class
0136 
0137     Specific mspecific;
0138   };
0139 
0140   // streamer
0141   //std::ostream& operator<<(std::ostream& out, const reco::JPTJet& jet);
0142 }  // namespace reco
0143 // temporary fix before include_checcker runs globally
0144 #include "DataFormats/JetReco/interface/JPTJetCollection.h"  //INCLUDECHECKER:SKIP
0145 #endif