1 #ifndef DataFormats_HGCalDigis_HGCROCChannelDataFrame_h 2 #define DataFormats_HGCalDigis_HGCROCChannelDataFrame_h 54 uint16_t word3(charMode ?
adc :
adcm1);
81 return (0x200 | (totraw >> 3));
82 return (totraw & 0x1ff);
90 uint16_t totout(totraw & 0x1ff);
92 totout = ((totraw & 0x1ff) << 3);
105 uint16_t
tctp()
const {
return (
tc() << 1) |
tp(); }
107 uint16_t
adcm1(
bool charMode =
false)
const {
return charMode ? 0 :
packet3(); }
108 uint16_t
tot(
bool charMode =
false)
const {
110 return charMode ||
tc() ? tot12b : 0;
112 uint16_t
rawtot(
bool charMode =
false)
const {
return charMode ||
tc() ?
packet2() : 0; }
123 <<
" p1: " <<
packet1() << std::endl
124 <<
"\ttc: " <<
tc() <<
" tp: " <<
tp() <<
" adcm1: " <<
adcm1() <<
" (" <<
adcm1(
false) <<
") " 125 <<
" adc: " <<
adc() <<
" (" <<
adc(
false) <<
") " 126 <<
" tot: " <<
tot() <<
" (" <<
tot(
false) <<
") " 127 <<
" toa: " <<
toa() << std::endl;
void print(std::ostream &out=std::cout) const
void fillPacket1(int word)
HGCROCChannelDataFrame(const D &id)
HGCROCChannelDataFrame(const D &id, uint32_t value)
const D & id() const
det id
uint32_t readPacket(HGCROCChannelDataFrameMask mask, HGCROCChannelDataFrameShift shift) const
wrapper to get packet at a given position
void fill(bool charMode, bool tc, bool tp, uint16_t adcm1, uint16_t adc, uint16_t tot, uint16_t toa)
fills the 32b word characterization mode : tc|tp|adc|tot|toa normal mode: tc|tp|adcm1|*|toa with *=to...
uint16_t rawtot(bool charMode=false) const
void fillFlag1(bool flag)
HGCROCChannelDataFrame(uint32_t value)
HGCROCChannelDataFrame()
CTOR.
void fillFlag2(bool flag)
setters
uint16_t adcm1(bool charMode=false) const
HGCROCChannelDataFrameShift
DecomposeProduct< arg, typename Div::arg > D
uint16_t adc(bool charMode=false) const
void fillPacket(uint16_t word, HGCROCChannelDataFrameMask mask, HGCROCChannelDataFrameShift shift)
wrapper to reset words at a given position
HGCROCChannelDataFrameMask
uint32_t operator()() const
getters
static unsigned int const shift
wrapper for a 32b data word from a single channel and its detid The format is always the same: |1b|1b...
uint16_t compressToT(uint16_t totraw)
the 12-bit TOT is compressed to a 10bit word truncating the first two bits when the value is above 0x...
uint16_t decompressToT(uint16_t totraw) const
the 10-bit TOT word is decompressed back to 12 bit word In case truncation occurred the word is shift...
void fillPacket3(int word)
void fillPacket2(int word)
HGCROCChannelDataFrame & operator=(const HGCROCChannelDataFrame &)=default
HGCROCChannelDataFrame(const HGCROCChannelDataFrame &o)
void fillRaw(bool flag2, bool flag1, uint16_t word3, uint16_t word2, uint16_t word1)
uint16_t tot(bool charMode=false) const