Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HcalIsolatedTrack_IsolatedPixelTrackCandidate_h
0002 #define HcalIsolatedTrack_IsolatedPixelTrackCandidate_h
0003 /** \class reco::IsolatedPixelTrackCandidate
0004  *
0005  *
0006  */
0007 
0008 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
0009 #include "DataFormats/TrackReco/interface/Track.h"
0010 #include "DataFormats/L1Trigger/interface/L1JetParticle.h"
0011 #include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
0012 #include "DataFormats/L1Trigger/interface/Jet.h"
0013 #include "DataFormats/L1Trigger/interface/Tau.h"
0014 
0015 #include "DataFormats/HcalIsolatedTrack/interface/IsolatedPixelTrackCandidateFwd.h"
0016 
0017 #include <vector>
0018 #include <map>
0019 #include <utility>
0020 
0021 namespace reco {
0022 
0023   class IsolatedPixelTrackCandidate : public RecoCandidate {
0024   public:
0025     // default constructor
0026     IsolatedPixelTrackCandidate() : RecoCandidate() {
0027       enIn_ = -1;
0028       enOut_ = -1;
0029       nhitIn_ = -1;
0030       nhitOut_ = -1;
0031       maxPtPxl_ = -1;
0032       sumPtPxl_ = -1;
0033       etaEcal_ = 0;
0034       phiEcal_ = 0;
0035       etaPhiEcal_ = false;
0036     }
0037     ///constructor from LorentzVector
0038     IsolatedPixelTrackCandidate(const LorentzVector& v) : RecoCandidate(0, v) {
0039       enIn_ = -1;
0040       enOut_ = -1;
0041       nhitIn_ = -1;
0042       nhitOut_ = -1;
0043       maxPtPxl_ = -1;
0044       sumPtPxl_ = -1;
0045       etaEcal_ = 0;
0046       phiEcal_ = 0;
0047       etaPhiEcal_ = false;
0048     }
0049     /// constructor from a track
0050     IsolatedPixelTrackCandidate(const reco::TrackRef& tr,
0051                                 const l1extra::L1JetParticleRef& tauRef,
0052                                 double max,
0053                                 double sum)
0054         : RecoCandidate(0, LorentzVector((tr.get()->px()), (tr.get())->py(), (tr.get())->pz(), (tr.get())->p())),
0055           track_(tr),
0056           l1tauJet_(tauRef),
0057           maxPtPxl_(max),
0058           sumPtPxl_(sum) {
0059       enIn_ = -1;
0060       enOut_ = -1;
0061       nhitIn_ = -1;
0062       nhitOut_ = -1;
0063       etaEcal_ = 0;
0064       phiEcal_ = 0;
0065       etaPhiEcal_ = false;
0066     }
0067     // constructor from a track using l1t
0068     IsolatedPixelTrackCandidate(const reco::TrackRef& tr, const l1t::TauRef& tauRef, double max, double sum)
0069         : RecoCandidate(0, LorentzVector((tr.get()->px()), (tr.get())->py(), (tr.get())->pz(), (tr.get())->p())),
0070           track_(tr),
0071           l1ttauJet_(tauRef),
0072           maxPtPxl_(max),
0073           sumPtPxl_(sum) {
0074       enIn_ = -1;
0075       enOut_ = -1;
0076       nhitIn_ = -1;
0077       nhitOut_ = -1;
0078       etaEcal_ = 0;
0079       phiEcal_ = 0;
0080       etaPhiEcal_ = false;
0081     }
0082 
0083     ///constructor from tau jet
0084     IsolatedPixelTrackCandidate(
0085         const l1extra::L1JetParticleRef& tauRef, double enIn, double enOut, int nhitIn, int nhitOut)
0086         : RecoCandidate(0, LorentzVector(tauRef->px(), tauRef->py(), tauRef->pz(), tauRef->p())),
0087           l1tauJet_(tauRef),
0088           enIn_(enIn),
0089           enOut_(enOut),
0090           nhitIn_(nhitIn),
0091           nhitOut_(nhitOut) {
0092       maxPtPxl_ = -1;
0093       sumPtPxl_ = -1;
0094       etaEcal_ = 0;
0095       phiEcal_ = 0;
0096       etaPhiEcal_ = false;
0097     }
0098     ///constructor from tau jet using l1t
0099     IsolatedPixelTrackCandidate(const l1t::TauRef& tauRef, double enIn, double enOut, int nhitIn, int nhitOut)
0100         : RecoCandidate(0, LorentzVector(tauRef->px(), tauRef->py(), tauRef->pz(), tauRef->p())),
0101           l1ttauJet_(tauRef),
0102           enIn_(enIn),
0103           enOut_(enOut),
0104           nhitIn_(nhitIn),
0105           nhitOut_(nhitOut) {
0106       maxPtPxl_ = -1;
0107       sumPtPxl_ = -1;
0108       etaEcal_ = 0;
0109       phiEcal_ = 0;
0110       etaPhiEcal_ = false;
0111     }
0112     /// Copy constructor
0113     IsolatedPixelTrackCandidate(const IsolatedPixelTrackCandidate&);
0114 
0115     /// destructor
0116     ~IsolatedPixelTrackCandidate() override;
0117 
0118     /// returns a clone of the candidate
0119     IsolatedPixelTrackCandidate* clone() const override;
0120 
0121     /// refrence to a Track
0122     reco::TrackRef track() const override;
0123     void setTrack(const reco::TrackRef& tr) { track_ = tr; }
0124 
0125     /// highest Pt of other pixel tracks in the cone around the candidate
0126     double maxPtPxl() const { return maxPtPxl_; }
0127     void setMaxPtPxl(double mptpxl) { maxPtPxl_ = mptpxl; }
0128 
0129     /// Pt sum of other pixel tracks in the cone around the candidate
0130     double sumPtPxl() const { return sumPtPxl_; }
0131     void setSumPtPxl(double sumptpxl) { sumPtPxl_ = sumptpxl; }
0132 
0133     /// get reference to L1 tau jet
0134     virtual l1extra::L1JetParticleRef l1tau() const;
0135     void setL1TauJet(const l1extra::L1JetParticleRef& tauRef) { l1tauJet_ = tauRef; }
0136 
0137     /// get reference to L1 tau jet from lt1
0138     virtual l1t::TauRef l1ttau() const;
0139     void setL1TTauJet(const l1t::TauRef& tauRef) { l1ttauJet_ = tauRef; }
0140 
0141     /// ECAL energy in the inner cone around tau jet
0142     double energyIn() const { return enIn_; }
0143     void setEnergyIn(double a) { enIn_ = a; }
0144 
0145     /// ECAL energy in the outer cone around tau jet
0146     double energyOut() const { return enOut_; }
0147     void setEnergyOut(double a) { enOut_ = a; }
0148 
0149     /// number of ECAL hits in the inner cone around tau jet
0150     int nHitIn() const { return nhitIn_; }
0151     void setNHitIn(int a) { nhitIn_ = a; }
0152 
0153     /// number of ECAL hits in the outer cone around tau jet
0154     int nHitOut() const { return nhitOut_; }
0155     void setNHitOut(int a) { nhitOut_ = a; }
0156 
0157     ///get index of tower which track is hitting
0158     std::pair<int, int> towerIndex() const;
0159 
0160     ///eta, phi at ECAL surface
0161     void setEtaPhiEcal(double eta, double phi) {
0162       etaEcal_ = eta;
0163       phiEcal_ = phi;
0164       etaPhiEcal_ = true;
0165     }
0166     std::pair<double, double> etaPhiEcal() const {
0167       return ((etaPhiEcal_) ? std::pair<double, double>(etaEcal_, phiEcal_) : std::pair<double, double>(0, 0));
0168     }
0169     bool etaPhiEcalValid() const { return etaPhiEcal_; }
0170 
0171   private:
0172     /// check overlap with another candidate
0173     bool overlap(const Candidate&) const override;
0174     /// reference to a Track
0175     reco::TrackRef track_;
0176     /// reference to a L1 tau jet
0177     l1extra::L1JetParticleRef l1tauJet_;
0178     /// reference to a S2 L1 tau jet
0179     l1t::TauRef l1ttauJet_;
0180     /// highest Pt of other pixel tracks in the cone around the candidate
0181     double maxPtPxl_;
0182     /// Pt sum of other pixel tracks in the cone around the candidate
0183     double sumPtPxl_;
0184     /// energy in inner cone around L1 tau jet
0185     double enIn_;
0186     /// energy in outer cone around L1 tau jet
0187     double enOut_;
0188     /// number of hits in inner cone
0189     int nhitIn_;
0190     /// number of hits in inner cone
0191     int nhitOut_;
0192     /// eta, phi at ECAL
0193     bool etaPhiEcal_;
0194     double etaEcal_, phiEcal_;
0195   };
0196 
0197 }  // namespace reco
0198 
0199 #endif