CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/DataFormats/L1CSCTrackFinder/interface/TrackStub.h

Go to the documentation of this file.
00001 
00013 #ifndef L1CSCTrackFinder_TrackStub_h
00014 #define L1CSCTrackFinder_TrackStub_h
00015 
00016 #include <DataFormats/DetId/interface/DetId.h>
00017 #include <DataFormats/CSCDigi/interface/CSCCorrelatedLCTDigi.h>
00018 #include <DataFormats/L1CSCTrackFinder/interface/CSCTFConstants.h>
00019 
00020 namespace csctf
00021 {
00022   
00023   class TrackStub : public CSCCorrelatedLCTDigi
00024     {
00025     public:
00026       TrackStub() {}
00027       TrackStub(const CSCCorrelatedLCTDigi&, const DetId&);
00028       TrackStub(const CSCCorrelatedLCTDigi&, const DetId&, const unsigned& phi, const unsigned& eta);
00029       TrackStub(const TrackStub&);
00030       
00032       void setEtaPacked(const unsigned& eta_) {theEta_ = eta_;}
00033       void setPhiPacked(const unsigned& phi_) {thePhi_ = phi_;}
00034       
00036       double etaValue() const {return (theEta_*theEtaBinning + CSCTFConstants::minEta);}
00038       double phiValue() const {return (thePhi_*thePhiBinning);}
00039       
00041       unsigned etaPacked() const {return theEta_;}
00043       
00044       unsigned phiPacked() const {return thePhi_;}
00045       
00047       const CSCCorrelatedLCTDigi* getDigi() const {return dynamic_cast<const CSCCorrelatedLCTDigi*>(this);}
00048       DetId getDetId() const {return DetId(theDetId_);}
00049       
00052       unsigned endcap() const;
00053       unsigned station() const;
00054       unsigned sector() const;
00055       unsigned subsector() const;
00056       unsigned cscid() const;
00057       unsigned cscidSeparateME1a() const;
00058       int BX() const {return getBX();}
00059       
00060       
00062       bool operator >  (const TrackStub &) const;
00063       bool operator <  (const TrackStub &) const;
00064       bool operator >= (const TrackStub &rhs) const { return !(this->operator<(rhs)); }
00065       bool operator <= (const TrackStub &rhs) const { return !(this->operator>(rhs)); }
00066       bool operator == (const TrackStub &rhs) const { return ((theDetId_ == rhs.theDetId_) && ( *(getDigi()) == *(rhs.getDigi()))); }
00067       bool operator != (const TrackStub &rhs) const { return !(this->operator==(rhs)); }
00068       
00069     private:
00070       uint32_t theDetId_;
00071       unsigned thePhi_, theEta_, link_;
00072       static const double theEtaBinning, thePhiBinning;
00073     };
00074 }
00075 
00076 #endif