Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:25

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 
0028     /// set Eta and Phi from integer values.
0029     void setEtaPacked(const unsigned &eta_) { theEta_ = eta_; }
0030     void setPhiPacked(const unsigned &phi_) { thePhi_ = phi_; }
0031 
0032     /// return the Eta Value of this stub's position.
0033     double etaValue() const { return (theEta_ * theEtaBinning + CSCTFConstants::minEta); }
0034     /// return the Phi Value of this stub's position in local coordinates.
0035     double phiValue() const { return (thePhi_ * thePhiBinning); }
0036 
0037     /// Return the binned eta for this stub.
0038     unsigned etaPacked() const { return theEta_; }
0039     /// Return the binned phi for this stub.
0040 
0041     unsigned phiPacked() const { return thePhi_; }
0042 
0043     /// Get the digi this stub was made from.
0044     const CSCCorrelatedLCTDigi *getDigi() const { return dynamic_cast<const CSCCorrelatedLCTDigi *>(this); }
0045     DetId getDetId() const { return DetId(theDetId_); }
0046 
0047     /// Time / Space identifiers
0048     /// See CSCTransientDataType.h for more details.
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     /// Comparision Operators, used for MPC sorting
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 }  // namespace csctf
0073 
0074 #endif