Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef DataFormats_SiStripDigi_SiStripDigi_H
0002 #define DataFormats_SiStripDigi_SiStripDigi_H
0003 
0004 #include <iosfwd>
0005 #include <cstdint>
0006 
0007 /**  
0008      @brief A Digi for the silicon strip detector, containing both
0009      strip and adc information, and suitable for storing
0010      zero-suppresed hit information.
0011 */
0012 class SiStripDigi {
0013 public:
0014   SiStripDigi(const uint16_t& strip, const uint16_t& adc) : strip_(strip), adc_(adc) { ; }
0015 
0016   SiStripDigi() : strip_(0), adc_(0) { ; }
0017   ~SiStripDigi() = default;
0018 
0019   inline const uint16_t& strip() const;
0020   inline const uint16_t& adc() const;
0021   inline const uint16_t& channel() const;
0022 
0023   inline bool operator<(const SiStripDigi& other) const;
0024 
0025 private:
0026   uint16_t strip_;
0027   uint16_t adc_;
0028 };
0029 
0030 std::ostream& operator<<(std::ostream& o, const SiStripDigi& digi);
0031 
0032 // inline methods
0033 const uint16_t& SiStripDigi::strip() const { return strip_; }
0034 const uint16_t& SiStripDigi::adc() const { return adc_; }
0035 const uint16_t& SiStripDigi::channel() const { return strip(); }
0036 bool SiStripDigi::operator<(const SiStripDigi& other) const { return strip() < other.strip(); }
0037 
0038 #endif  // DataFormats_SiStripDigi_SiStripDigi_H