Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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