1 #ifndef DIGIECAL_ECALMGPASAMPLE_H 2 #define DIGIECAL_ECALMGPASAMPLE_H 5 #include <boost/cstdint.hpp> 15 return (adc&0xFFF) | ((gainId&0x3)<<12);
32 uint16_t
raw()
const {
return theSample; }
34 int adc()
const {
return theSample&0xFFF; }
36 int gainId()
const {
return (theSample>>12)&0x3; }
39 operator uint16_t ()
const {
return theSample; }
constexpr sample_type pack(int adc, int gainId)
uint16_t raw() const
get the raw word
int gainId() const
get the gainId (2 bits)
std::ostream & operator<<(std::ostream &, const EcalMGPASample &)
EcalMGPASample(uint16_t data)
uint16_t operator()() const
for streaming
constexpr int adc(sample_type sample)
get the ADC sample (12 bits)
constexpr int gainId(sample_type sample)
get the gainId (2 bits)
char data[epos_bytes_allocation]
int adc() const
get the ADC sample (12 bits)