File indexing completed on 2024-04-06 12:04:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef L1CSCTrackFinder_TrackStub_h
0014 #define L1CSCTrackFinder_TrackStub_h
0015
0016 #include <DataFormats/DetId/interface/DetId.h>
0017 #include <DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h>
0018 #include <DataFormats/L1CSCTrackFinder/interface/CSCTFConstants.h>
0019
0020 namespace csctf {
0021
0022 class TrackStub : public CSCCorrelatedLCTDigi {
0023 public:
0024 TrackStub() {}
0025 TrackStub(const CSCCorrelatedLCTDigi &, const DetId &);
0026 TrackStub(const CSCCorrelatedLCTDigi &, const DetId &, const unsigned &phi, const unsigned &eta);
0027
0028
0029 void setEtaPacked(const unsigned &eta_) { theEta_ = eta_; }
0030 void setPhiPacked(const unsigned &phi_) { thePhi_ = phi_; }
0031
0032
0033 double etaValue() const { return (theEta_ * theEtaBinning + CSCTFConstants::minEta); }
0034
0035 double phiValue() const { return (thePhi_ * thePhiBinning); }
0036
0037
0038 unsigned etaPacked() const { return theEta_; }
0039
0040
0041 unsigned phiPacked() const { return thePhi_; }
0042
0043
0044 const CSCCorrelatedLCTDigi *getDigi() const { return dynamic_cast<const CSCCorrelatedLCTDigi *>(this); }
0045 DetId getDetId() const { return DetId(theDetId_); }
0046
0047
0048
0049 unsigned endcap() const;
0050 unsigned station() const;
0051 unsigned sector() const;
0052 unsigned subsector() const;
0053 unsigned cscid() const;
0054 unsigned cscidSeparateME1a() const;
0055 int BX() const { return getBX(); }
0056
0057
0058 bool operator>(const TrackStub &) const;
0059 bool operator<(const TrackStub &) const;
0060 bool operator>=(const TrackStub &rhs) const { return !(this->operator<(rhs)); }
0061 bool operator<=(const TrackStub &rhs) const { return !(this->operator>(rhs)); }
0062 bool operator==(const TrackStub &rhs) const {
0063 return ((theDetId_ == rhs.theDetId_) && (*(getDigi()) == *(rhs.getDigi())));
0064 }
0065 bool operator!=(const TrackStub &rhs) const { return !(this->operator==(rhs)); }
0066
0067 private:
0068 uint32_t theDetId_;
0069 unsigned thePhi_, theEta_, link_;
0070 static const double theEtaBinning, thePhiBinning;
0071 };
0072 }
0073
0074 #endif