CMS 3D CMS Logo

EcalLiteDTUSample.h
Go to the documentation of this file.
1 #ifndef DataFormats_EcalDigi_EcalLiteDTUSample_h
2 #define DataFormats_EcalDigi_EcalLiteDTUSample_h
3 
4 #include <iosfwd>
5 #include <cstdint>
7 
8 namespace ecalLiteDTU {
9  typedef uint16_t sample_type;
10 
12  constexpr int adc(sample_type sample) { return sample & ecalPh2::kAdcMask; }
15  constexpr sample_type pack(int adc, int gainId) {
17  }
18 } // namespace ecalLiteDTU
19 
26 public:
29  EcalLiteDTUSample(int adc, int gainId);
30 
32  uint16_t raw() const { return theSample; }
34  int adc() const { return theSample & ecalPh2::kAdcMask; }
36  int gainId() const { return (theSample >> ecalPh2::NBITS) & ecalPh2::kGainIdMask; }
38  uint16_t operator()() const { return theSample; }
39  operator uint16_t() const { return theSample; }
40 
41 private:
42  uint16_t theSample;
43 };
44 
45 std::ostream& operator<<(std::ostream&, const EcalLiteDTUSample&);
46 
47 #endif
EcalLiteDTUSample::EcalLiteDTUSample
EcalLiteDTUSample()
Definition: EcalLiteDTUSample.h:27
ecalLiteDTU
Definition: EcalLiteDTUSample.h:8
ecalLiteDTU::gainId
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
Definition: EcalLiteDTUSample.h:14
ecalPh2::kGainIdMask
static constexpr unsigned int kGainIdMask
Definition: EcalConstants.h:19
ecalLiteDTU::sample_type
uint16_t sample_type
Definition: EcalLiteDTUSample.h:9
simplePhotonAnalyzer_cfi.sample
sample
Definition: simplePhotonAnalyzer_cfi.py:12
EcalLiteDTUSample::EcalLiteDTUSample
EcalLiteDTUSample(uint16_t data)
Definition: EcalLiteDTUSample.h:28
EcalLiteDTUSample::adc
int adc() const
get the ADC sample (12 bits)
Definition: EcalLiteDTUSample.h:34
ecalLiteDTU::adc
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
Definition: EcalLiteDTUSample.h:12
EcalLiteDTUSample::raw
uint16_t raw() const
get the raw word
Definition: EcalLiteDTUSample.h:32
ecalLiteDTU::pack
constexpr sample_type pack(int adc, int gainId)
Definition: EcalLiteDTUSample.h:15
EcalLiteDTUSample
Definition: EcalLiteDTUSample.h:25
EcalLiteDTUSample::operator()
uint16_t operator()() const
for streaming
Definition: EcalLiteDTUSample.h:38
EcalConstants.h
EcalLiteDTUSample::theSample
uint16_t theSample
Definition: EcalLiteDTUSample.h:42
EcalLiteDTUSample::gainId
int gainId() const
get the gainId (2 bits)
Definition: EcalLiteDTUSample.h:36
ecalPh2::kAdcMask
static constexpr unsigned int kAdcMask
Definition: EcalConstants.h:18
operator<<
std::ostream & operator<<(std::ostream &, const EcalLiteDTUSample &)
Definition: EcalLiteDTUSample.cc:8
ecalPh2::NBITS
static constexpr unsigned int NBITS
Definition: EcalConstants.h:13
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79