Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-05-11 03:34:03

0001 #ifndef DataFormats_SiStripDigi_SiStripRawDigi_H
0002 #define DataFormats_SiStripDigi_SiStripRawDigi_H
0003 
0004 #include <cstdint>
0005 #include "DataFormats/Common/interface/traits.h"
0006 
0007 /** 
0008     @brief A Digi for the silicon strip detector, containing only adc
0009     information, and suitable for storing raw hit information. NOTA
0010     BENE: these digis use the DetSetVector, but the public inheritence
0011     from edm::DoNotSortUponInsertion ensures that the digis are NOT
0012     sorted by the DetSetVector::post_insert() method. The strip
0013     position is therefore inferred from the position of the digi
0014     within its container (the DetSet private vector).
0015 */
0016 class SiStripRawDigi : public edm::DoNotSortUponInsertion {
0017 public:
0018   explicit SiStripRawDigi(uint16_t adc) : adc_(adc) {}
0019 
0020   SiStripRawDigi() : adc_(0) {}
0021   ~SiStripRawDigi() = default;
0022 
0023   inline uint16_t adc() const { return adc_; }
0024 
0025   /** Not used! (even if implementation is required). */
0026   inline bool operator<(const SiStripRawDigi& other) const;
0027 
0028 private:
0029   uint16_t adc_;
0030 };
0031 
0032 #include <iostream>
0033 inline std::ostream& operator<<(std::ostream& o, const SiStripRawDigi& digi) { return o << " " << digi.adc(); }
0034 
0035 // inline methods
0036 bool SiStripRawDigi::operator<(const SiStripRawDigi& other) const { return (adc() < other.adc()); }
0037 
0038 #endif  // DataFormats_SiStripDigi_SiStripRawDigi_H