Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:45

0001 /**
0002  * \class TrackStub
0003  * \author L. Gray
0004  *
0005  * A transient data class used to wrap a Correlated LCT
0006  * and give access to its eta and phi coordinates.
0007  * This is essentially the merging of a CSCDetId and a CorrelatedLCT
0008  * into one class.
0009  *
0010  * \remark Takes the place of both L1MuCSCCorrelatedLCT and L1MuTrackStub
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     /// set Eta and Phi from integer values.
0030     void setEtaPacked(const unsigned &eta_) { theEta_ = eta_; }
0031     void setPhiPacked(const unsigned &phi_) { thePhi_ = phi_; }
0032 
0033     /// return the Eta Value of this stub's position.
0034     double etaValue() const { return (theEta_ * theEtaBinning + CSCTFConstants::minEta); }
0035     /// return the Phi Value of this stub's position in local coordinates.
0036     double phiValue() const { return (thePhi_ * thePhiBinning); }
0037 
0038     /// Return the binned eta for this stub.
0039     unsigned etaPacked() const { return theEta_; }
0040     /// Return the binned phi for this stub.
0041 
0042     unsigned phiPacked() const { return thePhi_; }
0043 
0044     /// Get the digi this stub was made from.
0045     const CSCCorrelatedLCTDigi *getDigi() const { return dynamic_cast<const CSCCorrelatedLCTDigi *>(this); }
0046     DetId getDetId() const { return DetId(theDetId_); }
0047 
0048     /// Time / Space identifiers
0049     /// See CSCTransientDataType.h for more details.
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     /// Comparision Operators, used for MPC sorting
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 }  // namespace csctf
0074 
0075 #endif