Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef HcalIsolatedTrack_HcalIsolatedTrackCandidate_h
0002 #define HcalIsolatedTrack_HcalIsolatedTrackCandidate_h
0003 /** \class reco::HcalIsolatedTrackCandidate
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/Math/interface/LorentzVector.h"
0013 #include "DataFormats/HcalIsolatedTrack/interface/HcalIsolatedTrackCandidateFwd.h"
0014 
0015 #include <vector>
0016 #include <map>
0017 #include <utility>
0018 
0019 namespace reco {
0020 
0021   class HcalIsolatedTrackCandidate : public RecoCandidate {
0022   public:
0023     // default constructor
0024     HcalIsolatedTrackCandidate() : RecoCandidate() {
0025       maxP_ = -1;
0026       enEcal_ = -1;
0027       ptL1_ = etaL1_ = phiL1_ = 0;
0028       etaEcal_ = phiEcal_ = 0;
0029       etaHcal_ = phiHcal_ = ietaHcal_ = iphiHcal_ = 0;
0030       etaPhiEcal_ = etaPhiHcal_ = false;
0031     }
0032     ///constructor from LorentzVector
0033     HcalIsolatedTrackCandidate(const LorentzVector& v) : RecoCandidate(0, v) {
0034       maxP_ = -1;
0035       enEcal_ = -1;
0036       ptL1_ = etaL1_ = phiL1_ = 0;
0037       etaEcal_ = phiEcal_ = 0;
0038       etaHcal_ = phiHcal_ = ietaHcal_ = iphiHcal_ = 0;
0039       etaPhiEcal_ = etaPhiHcal_ = false;
0040     }
0041     /// constructor from a track
0042     HcalIsolatedTrackCandidate(const reco::TrackRef& tr, double max, double ene)
0043         : RecoCandidate(0, LorentzVector((tr.get()->px()), (tr.get())->py(), (tr.get())->pz(), (tr.get())->p())),
0044           track_(tr),
0045           maxP_(max),
0046           enEcal_(ene) {
0047       ptL1_ = etaL1_ = phiL1_ = 0;
0048       etaEcal_ = phiEcal_ = 0;
0049       etaHcal_ = phiHcal_ = ietaHcal_ = iphiHcal_ = 0;
0050       etaPhiEcal_ = etaPhiHcal_ = false;
0051     }
0052     /// Copy constructor
0053     HcalIsolatedTrackCandidate(const HcalIsolatedTrackCandidate&);
0054 
0055     /// destructor
0056     ~HcalIsolatedTrackCandidate() override;
0057 
0058     /// returns a clone of the candidate
0059     HcalIsolatedTrackCandidate* clone() const override;
0060 
0061     /// refrence to a Track
0062     reco::TrackRef track() const override;
0063     void setTrack(const reco::TrackRef& tr) { track_ = tr; }
0064 
0065     /// highest energy of other tracks in the cone around the candidate
0066     double maxP() const { return maxP_; }
0067     void SetMaxP(double mp) { maxP_ = mp; }
0068 
0069     /// get reference to L1 jet
0070     virtual l1extra::L1JetParticleRef l1jet() const;
0071     void setL1Jet(const l1extra::L1JetParticleRef& jetRef) { l1Jet_ = jetRef; }
0072     std::pair<double, double> EtaPhiL1() const { return std::pair<double, double>(etaL1_, phiL1_); }
0073     math::XYZTLorentzVector l1jetp() const;
0074     void setL1(double pt, double eta, double phi) {
0075       ptL1_ = pt;
0076       etaL1_ = eta;
0077       phiL1_ = phi;
0078     }
0079 
0080     /// ECAL energy in the inner cone around tau jet
0081     double energyEcal() const { return enEcal_; }
0082     void SetEnergyEcal(double a) { enEcal_ = a; }
0083 
0084     ///eta, phi at ECAL surface
0085     void SetEtaPhiEcal(double eta, double phi) {
0086       etaEcal_ = eta;
0087       phiEcal_ = phi;
0088       etaPhiEcal_ = true;
0089     }
0090     std::pair<double, double> EtaPhiEcal() const {
0091       return ((etaPhiEcal_) ? std::pair<double, double>(etaEcal_, phiEcal_) : std::pair<double, double>(0, 0));
0092     }
0093     bool etaPhiEcal() const { return etaPhiEcal_; }
0094 
0095     ///eta, phi at HCAL surface
0096     void SetEtaPhiHcal(double eta, double phi, int ieta, int iphi) {
0097       etaHcal_ = eta;
0098       phiHcal_ = phi;
0099       ietaHcal_ = ieta;
0100       iphiHcal_ = iphi;
0101       etaPhiHcal_ = true;
0102     }
0103     std::pair<double, double> EtaPhiHcal() const {
0104       return ((etaPhiHcal_) ? std::pair<double, double>(etaHcal_, phiHcal_) : std::pair<double, double>(0, 0));
0105     }
0106     std::pair<int, int> towerIndex() const {
0107       return ((etaPhiHcal_) ? std::pair<int, int>(ietaHcal_, iphiHcal_) : std::pair<int, int>(0, 0));
0108     }
0109     bool etaPhiHcal() const { return etaPhiHcal_; }
0110 
0111   private:
0112     /// check overlap with another candidate
0113     bool overlap(const Candidate&) const override;
0114     /// reference to a Track
0115     reco::TrackRef track_;
0116     /// reference to a L1 tau jet
0117     l1extra::L1JetParticleRef l1Jet_;
0118     /// highest P of other tracks in the cone around the candidate
0119     double maxP_;
0120     /// energy in ECAL around a cone around the track
0121     double enEcal_;
0122     /// pt, eta, phi of L1 object
0123     double ptL1_, etaL1_, phiL1_;
0124     /// eta, phi at ECAL
0125     bool etaPhiEcal_;
0126     double etaEcal_, phiEcal_;
0127     /// eta, phi at HCAL
0128     bool etaPhiHcal_;
0129     double etaHcal_, phiHcal_;
0130     int ietaHcal_, iphiHcal_;
0131   };
0132 
0133 }  // namespace reco
0134 
0135 #endif