CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
HcalUHTRData::const_iterator Class Reference

#include <HcalUHTRData.h>

Public Member Functions

uint8_t adc () const
 
uint8_t capid () const
 
int capid0 () const
 
int channelid () const
 
 const_iterator (const uint16_t *ptr, const uint16_t *limit=nullptr)
 
bool dataValid () const
 
int errFlags () const
 
int flavor () const
 
bool isHeader () const
 
uint8_t le_tdc () const
 
bool ok () const
 
bool operator!= (const const_iterator &i)
 
uint16_t operator* () const
 
const_iteratoroperator++ ()
 
bool operator== (const const_iterator &i)
 
const uint16_t * raw () const
 
bool soi () const
 
uint8_t te_tdc () const
 
int technicalDataType () const
 
uint16_t value () const
 

Private Member Functions

void determineMode ()
 

Private Attributes

const uint16_t * m_0th_data_ptr
 
int m_flavor
 
const uint16_t * m_header_ptr
 
const uint16_t * m_limit
 
int m_microstep
 
const uint16_t * m_ptr
 
int m_stepclass
 
int m_technicalDataType
 

Detailed Description

Definition at line 43 of file HcalUHTRData.h.

Constructor & Destructor Documentation

HcalUHTRData::const_iterator::const_iterator ( const uint16_t *  ptr,
const uint16_t *  limit = nullptr 
)

Member Function Documentation

uint8_t HcalUHTRData::const_iterator::adc ( ) const

Definition at line 77 of file HcalUHTRData.cc.

References m_flavor, m_microstep, m_ptr, and m_technicalDataType.

Referenced by HcalUnpacker_impl::unpack_compact(), and value().

77  {
78  if (m_flavor == 5 && m_microstep == 0)
79  return ((*m_ptr) >> 8) & 0x7F;
80  else if (m_flavor == 7 && m_technicalDataType == 15)
81  return (*m_ptr) & 0x7F;
82  else
83  return (*m_ptr) & 0xFF;
84 }
uint8_t HcalUHTRData::const_iterator::capid ( ) const

Definition at line 111 of file HcalUHTRData.cc.

References m_flavor, m_ptr, and m_technicalDataType.

Referenced by HcalUnpacker_impl::unpack_compact(), and value().

111  {
112  if (m_flavor == 2)
113  return (m_ptr[1] >> 12) & 0x3;
114  else if (m_flavor == 7 && m_technicalDataType == 15) {
115  return ((*m_ptr) >> 8) & 0x3;
116  } else if (m_flavor == 1 || m_flavor == 0) {
117  // For flavor 0,1 we only get the first capid in the header, and so we need
118  // to count the number of data rows and figure out which cap we want,
119  // knowing that they go 0->1->2->3->0
120  return 0;
121  } else {
122  return 0;
123  }
124 }
int HcalUHTRData::const_iterator::capid0 ( ) const
inline

Definition at line 51 of file HcalUHTRData.h.

References m_ptr.

Referenced by HcalUnpacker_impl::unpack_compact().

51 { return ((*m_ptr) >> 8) & 0x3; }
int HcalUHTRData::const_iterator::channelid ( ) const
inline

Definition at line 52 of file HcalUHTRData.h.

References m_ptr, and technicalDataType().

Referenced by HcalUnpacker_impl::unpack_compact(), and HcalUnpacker::unpackUTCA().

52 { return ((*m_ptr)) & 0xFF; }
bool HcalUHTRData::const_iterator::dataValid ( ) const

Definition at line 63 of file HcalUHTRData.cc.

References errFlags(), isHeader(), m_flavor, m_ptr, and m_technicalDataType.

Referenced by flavor(), and HcalUnpacker_impl::unpack_compact().

63  {
64  if ((m_flavor == 7 && m_technicalDataType == 15) && !isHeader())
65  return ((*m_ptr) >> 10) & 0x1;
66  else
67  return !(errFlags() & 0x2);
68 }
void HcalUHTRData::const_iterator::determineMode ( )
private

Definition at line 40 of file HcalUHTRData.cc.

References flavor(), isHeader(), m_flavor, m_microstep, m_stepclass, m_technicalDataType, and technicalDataType().

Referenced by const_iterator(), operator++(), and raw().

40  {
41  if (!isHeader())
42  return;
43  m_flavor = flavor();
44  m_stepclass = 0;
45  if (m_flavor == 5) {
46  m_stepclass = 1;
47  m_microstep = 0;
48  } else if (m_flavor == 2) {
49  m_stepclass = 2;
50  }
51  if (m_flavor == 7) {
53  }
54 }
int HcalUHTRData::const_iterator::errFlags ( ) const

Definition at line 56 of file HcalUHTRData.cc.

References isHeader(), m_flavor, m_ptr, and m_technicalDataType.

Referenced by dataValid(), flavor(), and HcalUnpacker_impl::unpack_compact().

56  {
57  if ((m_flavor == 7 && m_technicalDataType == 15) && !isHeader())
58  return ((*m_ptr) >> 11) & 0x1;
59  else
60  return ((*m_ptr) >> 10) & 0x3;
61 }
int HcalUHTRData::const_iterator::flavor ( ) const
inline

Definition at line 48 of file HcalUHTRData.h.

References dataValid(), errFlags(), and m_ptr.

Referenced by determineMode(), HcalUnpacker_impl::unpack_compact(), and HcalUnpacker::unpackUTCA().

48 { return ((*m_ptr) >> 12) & 0x7; }
bool HcalUHTRData::const_iterator::isHeader ( ) const
inline

Definition at line 47 of file HcalUHTRData.h.

References m_ptr.

Referenced by const_iterator(), dataValid(), determineMode(), errFlags(), operator++(), HcalUnpacker_impl::unpack_compact(), and HcalUnpacker::unpackUTCA().

47 { return ((*m_ptr) & 0x8000) != 0; }
uint8_t HcalUHTRData::const_iterator::le_tdc ( ) const

Definition at line 86 of file HcalUHTRData.cc.

References m_flavor, m_ptr, and m_technicalDataType.

Referenced by value().

86  {
87  if (m_flavor == 5 || (m_flavor == 7 && m_technicalDataType == 15))
88  return 0x80;
89  else if (m_flavor == 2)
90  return (m_ptr[1] & 0x3F);
91  else
92  return (((*m_ptr) & 0x3F00) >> 8);
93 }
bool HcalUHTRData::const_iterator::ok ( ) const

Definition at line 126 of file HcalUHTRData.cc.

References m_flavor, and m_ptr.

Referenced by value().

126  {
127  if (m_flavor == 2) {
128  return (m_ptr[0] >> 12) & 0x1;
129  } else if (m_flavor == 4) {
130  return (m_ptr[0] >> 13) & 0x1;
131  } else {
132  return false;
133  }
134 }
bool HcalUHTRData::const_iterator::operator!= ( const const_iterator i)
inline

Definition at line 70 of file HcalUHTRData.h.

References m_ptr.

70 { return m_ptr != i.m_ptr; }
uint16_t HcalUHTRData::const_iterator::operator* ( void  ) const
inline

Definition at line 64 of file HcalUHTRData.h.

References m_ptr, and operator++().

64 { return *m_ptr; }
HcalUHTRData::const_iterator & HcalUHTRData::const_iterator::operator++ ( void  )

Increment operator is "magic" and adjusts steps to match channel requirements.

Definition at line 12 of file HcalUHTRData.cc.

References determineMode(), isHeader(), m_0th_data_ptr, m_header_ptr, m_limit, m_microstep, m_ptr, and m_stepclass.

Referenced by operator*().

12  {
13  if (m_ptr == m_limit)
14  return *this;
15  if (m_stepclass == 0)
16  m_ptr++;
17  else if (m_stepclass == 1) {
18  if (m_microstep == 0) {
19  m_ptr++;
20  m_microstep++;
21  } else {
22  m_microstep--;
23  }
24  } else if (m_stepclass == 2) {
25  if (isHeader()) {
26  m_ptr++;
27  } else {
28  m_ptr += 2;
29  }
30  }
31 
32  if (isHeader()) {
33  determineMode();
36  }
37  return *this;
38 }
const uint16_t * m_limit
Definition: HcalUHTRData.h:75
const uint16_t * m_0th_data_ptr
Definition: HcalUHTRData.h:76
const uint16_t * m_header_ptr
Definition: HcalUHTRData.h:76
bool HcalUHTRData::const_iterator::operator== ( const const_iterator i)
inline

Definition at line 69 of file HcalUHTRData.h.

References m_ptr.

69 { return m_ptr == i.m_ptr; }
const uint16_t* HcalUHTRData::const_iterator::raw ( ) const
inline

Definition at line 71 of file HcalUHTRData.h.

References determineMode(), and m_ptr.

Referenced by HcalUnpacker::unpackUTCA().

71 { return m_ptr; }
bool HcalUHTRData::const_iterator::soi ( ) const

Definition at line 95 of file HcalUHTRData.cc.

References m_flavor, m_ptr, and m_technicalDataType.

Referenced by HcalUnpacker::unpackUTCA(), and value().

95  {
96  if (m_flavor == 5 || (m_flavor == 7 && m_technicalDataType == 15))
97  return false;
98  else if (m_flavor == 2)
99  return (m_ptr[0] & 0x2000);
100  else
101  return (((*m_ptr) & 0x4000));
102 }
uint8_t HcalUHTRData::const_iterator::te_tdc ( ) const

Definition at line 104 of file HcalUHTRData.cc.

References m_flavor, and m_ptr.

Referenced by value().

104  {
105  if (m_flavor == 2)
106  return (m_ptr[1] >> 6) & 0x1F;
107  else
108  return 0x80;
109 }
int HcalUHTRData::const_iterator::technicalDataType ( ) const

Definition at line 70 of file HcalUHTRData.cc.

References m_flavor, and m_ptr.

Referenced by channelid(), determineMode(), and HcalUnpacker::unpackUTCA().

70  {
71  if (m_flavor == 7)
72  return ((*m_ptr) >> 8) & 0xF;
73  else
74  return 0;
75 }
uint16_t HcalUHTRData::const_iterator::value ( ) const
inline

Member Data Documentation

const uint16_t * HcalUHTRData::const_iterator::m_0th_data_ptr
private

Definition at line 76 of file HcalUHTRData.h.

Referenced by operator++().

int HcalUHTRData::const_iterator::m_flavor
private
const uint16_t* HcalUHTRData::const_iterator::m_header_ptr
private

Definition at line 76 of file HcalUHTRData.h.

Referenced by operator++().

const uint16_t * HcalUHTRData::const_iterator::m_limit
private

Definition at line 75 of file HcalUHTRData.h.

Referenced by operator++().

int HcalUHTRData::const_iterator::m_microstep
private

Definition at line 77 of file HcalUHTRData.h.

Referenced by adc(), determineMode(), and operator++().

const uint16_t* HcalUHTRData::const_iterator::m_ptr
private
int HcalUHTRData::const_iterator::m_stepclass
private

Definition at line 78 of file HcalUHTRData.h.

Referenced by determineMode(), and operator++().

int HcalUHTRData::const_iterator::m_technicalDataType
private

Definition at line 80 of file HcalUHTRData.h.

Referenced by adc(), capid(), dataValid(), determineMode(), errFlags(), le_tdc(), and soi().