11 if (m_ptr==m_limit)
return *
this;
12 if (m_stepclass==0) m_ptr++;
13 else if (m_stepclass==1) {
14 if (m_microstep==0) { m_ptr++; m_microstep++; }
15 else { m_microstep--; }
17 else if (m_stepclass==2) {
18 if (isHeader()) { m_ptr++; }
25 m_0th_data_ptr = m_header_ptr + 1;
31 if (!isHeader())
return;
34 if (m_flavor==5) { m_stepclass=1; m_microstep=0; }
35 else if (m_flavor == 2) { m_stepclass=2; }
39 if (m_flavor==0x5 && m_microstep==0)
return ((*m_ptr)>>8)&0x7F;
40 else return (*m_ptr)&0xFF;
44 if (m_flavor==0x5)
return 0x80;
45 else if (m_flavor == 2)
return (m_ptr[1]&0x3F);
46 else return (((*m_ptr)&0x3F00)>>8);
50 if (m_flavor==0x5)
return false;
51 else if (m_flavor == 2)
return (m_ptr[0]&0x2000);
52 else return (((*m_ptr)&0x4000));
56 if (m_flavor==2)
return(m_ptr[1]>>6)&0x1F;
61 if (m_flavor==2)
return(m_ptr[1]>>12)&0x3;
62 else if (m_flavor == 1 || m_flavor == 0) {
72 if (m_flavor == 2) {
return (m_ptr[0]>>12)&0x1; }
73 else if (m_flavor == 4) {
return (m_ptr[0]>>13)&0x1; }
74 else {
return false; }
89 m_baseptr[m_ptr]=0x8000 |
101 if (m_ministep==0) m_baseptr[m_ptr]=adc&0x7F;
102 else m_baseptr[m_ptr]|=((adc&0x7f)<<8);
103 if (m_ministep==1) m_ptr++;
104 m_ministep=(m_ministep+1)%2;
105 }
else if ((m_flavor&0x6)==0x0) {
106 m_baseptr[m_ptr]=(adc&0xFF) | ((retdc&0x3F)<<8);
107 if (soi) m_baseptr[m_ptr]|=0x4000;
109 }
else if ((m_flavor&0x6)==0x1) {
110 m_baseptr[m_ptr]=(adc&0xFF);
111 m_baseptr[m_ptr+1]=0x4000| ((tdcstat&0x3)<<10) | ((fetdc&0xF)<<6) | ((retdc)<<8);
112 if (soi) m_baseptr[m_ptr]|=0x2000;
119 m_baseptr[m_ptr]=tpword&0xFFF;
120 if (soi) m_baseptr[m_ptr]|=0x4000;
int adc(sample_type sample)
get the ADC sample (12 bits)
void addTP(int tpword, bool soi=false)
static const int CHANNELS_PER_FIBER_MAX
void addHeader(int flavor, int errf, int cap0, int channelid)
packer(uint16_t *baseptr)
const_iterator & operator++()
static const int HEADER_LENGTH_16BIT
void addSample(int adc, bool soi=false, int retdc=0, int fetdc=0, int tdcstat=0)
const_iterator begin() const
static const int FIBERS_PER_UHTR
const_iterator(const uint16_t *ptr, const uint16_t *limit=0)
HcalUHTRData & operator=(const HcalUHTRData &)
unsigned long long uint64_t
const_iterator end() const