File indexing completed on 2023-03-17 10:50:13
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 TrackStub(const TrackStub &);
0028
0029
0030 void setEtaPacked(const unsigned &eta_) { theEta_ = eta_; }
0031 void setPhiPacked(const unsigned &phi_) { thePhi_ = phi_; }
0032
0033
0034 double etaValue() const { return (theEta_ * theEtaBinning + CSCTFConstants::minEta); }
0035
0036 double phiValue() const { return (thePhi_ * thePhiBinning); }
0037
0038
0039 unsigned etaPacked() const { return theEta_; }
0040
0041
0042 unsigned phiPacked() const { return thePhi_; }
0043
0044
0045 const CSCCorrelatedLCTDigi *getDigi() const { return dynamic_cast<const CSCCorrelatedLCTDigi *>(this); }
0046 DetId getDetId() const { return DetId(theDetId_); }
0047
0048
0049
0050 unsigned endcap() const;
0051 unsigned station() const;
0052 unsigned sector() const;
0053 unsigned subsector() const;
0054 unsigned cscid() const;
0055 unsigned cscidSeparateME1a() const;
0056 int BX() const { return getBX(); }
0057
0058
0059 bool operator>(const TrackStub &) const;
0060 bool operator<(const TrackStub &) const;
0061 bool operator>=(const TrackStub &rhs) const { return !(this->operator<(rhs)); }
0062 bool operator<=(const TrackStub &rhs) const { return !(this->operator>(rhs)); }
0063 bool operator==(const TrackStub &rhs) const {
0064 return ((theDetId_ == rhs.theDetId_) && (*(getDigi()) == *(rhs.getDigi())));
0065 }
0066 bool operator!=(const TrackStub &rhs) const { return !(this->operator==(rhs)); }
0067
0068 private:
0069 uint32_t theDetId_;
0070 unsigned thePhi_, theEta_, link_;
0071 static const double theEtaBinning, thePhiBinning;
0072 };
0073 }
0074
0075 #endif