Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-06-10 01:50:16

0001 #ifndef DataFormats_L1TParticleFlow_PFTrack_h
0002 #define DataFormats_L1TParticleFlow_PFTrack_h
0003 
0004 #include <vector>
0005 #include "DataFormats/L1Trigger/interface/L1Candidate.h"
0006 #include "DataFormats/L1TrackTrigger/interface/TTTrack.h"
0007 #include "DataFormats/L1TrackTrigger/interface/TTTypes.h"
0008 #include "DataFormats/Common/interface/Ref.h"
0009 
0010 namespace l1t {
0011 
0012   class PFTrack : public L1Candidate {
0013   public:
0014     typedef TTTrack<Ref_Phase2TrackerDigi_> L1TTTrackType;
0015     typedef edm::Ref<std::vector<L1TTTrackType>> TrackRef;
0016 
0017     PFTrack() {}
0018     PFTrack(int charge,
0019             const reco::Particle::LorentzVector& p4,
0020             const reco::Particle::Point& vtx,
0021             const TrackRef& tkPtr,
0022             int nPar,
0023             float caloEta,
0024             float caloPhi,
0025             float trkPtError = -1,
0026             float caloPtError = -1,
0027             int quality = 1,
0028             bool isMuon = false,
0029             int hwpt = 0,
0030             int hweta = 0,
0031             int hwphi = 0)
0032         : L1Candidate(p4, hwpt, hweta, hwphi, quality),
0033           trackRef_(tkPtr),
0034           caloEta_(caloEta),
0035           caloPhi_(caloPhi),
0036           trkPtError_(trkPtError),
0037           caloPtError_(caloPtError),
0038           isMuon_(isMuon),
0039           nPar_(nPar),
0040           trackWord_(*tkPtr) {
0041       setCharge(charge);
0042       setVertex(vtx);
0043     }
0044 
0045     const TrackRef& track() const { return trackRef_; }
0046     void setTrack(const TrackRef& ref) { trackRef_ = ref; }
0047 
0048     /// eta coordinate propagated at the calorimeter surface used for track-cluster matching
0049     float caloEta() const { return caloEta_; }
0050     /// phi coordinate propagated at the calorimeter surface used for track-cluster matching
0051     float caloPhi() const { return caloPhi_; }
0052     void setCaloEtaPhi(float eta, float phi) {
0053       caloEta_ = eta;
0054       caloPhi_ = phi;
0055     }
0056 
0057     /// uncertainty on track pt
0058     float trkPtError() const { return trkPtError_; }
0059     void setTrkPtError(float ptErr) { trkPtError_ = ptErr; }
0060 
0061     /// uncertainty on calorimetric response for a hadron with pt equal to this track's pt
0062     float caloPtError() const { return caloPtError_; }
0063     void setCaloPtError(float ptErr) { caloPtError_ = ptErr; }
0064 
0065     bool isMuon() const override { return isMuon_; }
0066     void setIsMuon(bool isMuon) { isMuon_ = isMuon; }
0067 
0068     int quality() const { return hwQual(); }
0069     void setQuality(int quality) { setHwQual(quality); }
0070 
0071     unsigned int nPar() const { return nPar_; }
0072     unsigned int nStubs() const { return track()->getStubRefs().size(); }
0073     float normalizedChi2() const { return track()->chi2Red(); }
0074     float chi2() const { return track()->chi2(); }
0075 
0076     const TTTrack_TrackWord& trackWord() const { return trackWord_; }
0077     TTTrack_TrackWord& trackWord() { return trackWord_; }
0078 
0079   private:
0080     TrackRef trackRef_;
0081     float caloEta_, caloPhi_;
0082     float trkPtError_;
0083     float caloPtError_;
0084     bool isMuon_;
0085     unsigned int nPar_;
0086     TTTrack_TrackWord trackWord_;
0087   };
0088 
0089   typedef std::vector<l1t::PFTrack> PFTrackCollection;
0090   typedef edm::Ref<l1t::PFTrackCollection> PFTrackRef;
0091   typedef edm::RefVector<l1t::PFTrackCollection> PFTrackRefVector;
0092   typedef std::vector<l1t::PFTrackRef> PFTrackVectorRef;
0093 }  // namespace l1t
0094 #endif