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

◆ const_iterator()

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

Definition at line 6 of file HcalUHTRData.cc.

8  if (isHeader())
10 }

References determineMode(), and isHeader().

Member Function Documentation

◆ adc()

uint8_t HcalUHTRData::const_iterator::adc ( ) const

Definition at line 77 of file HcalUHTRData.cc.

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 }

◆ capid()

uint8_t HcalUHTRData::const_iterator::capid ( ) const

Definition at line 111 of file HcalUHTRData.cc.

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 }

◆ capid0()

int HcalUHTRData::const_iterator::capid0 ( ) const
inline

Definition at line 51 of file HcalUHTRData.h.

51 { return ((*m_ptr) >> 8) & 0x3; }

References m_ptr.

◆ channelid()

int HcalUHTRData::const_iterator::channelid ( ) const
inline

Definition at line 52 of file HcalUHTRData.h.

52 { return ((*m_ptr)) & 0xFF; }

References m_ptr.

◆ dataValid()

bool HcalUHTRData::const_iterator::dataValid ( ) const

Definition at line 63 of file HcalUHTRData.cc.

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

◆ determineMode()

void HcalUHTRData::const_iterator::determineMode ( )
private

Definition at line 40 of file HcalUHTRData.cc.

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 }

Referenced by const_iterator().

◆ errFlags()

int HcalUHTRData::const_iterator::errFlags ( ) const

Definition at line 56 of file HcalUHTRData.cc.

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 }

◆ flavor()

int HcalUHTRData::const_iterator::flavor ( ) const
inline

Definition at line 48 of file HcalUHTRData.h.

48 { return ((*m_ptr) >> 12) & 0x7; }

References m_ptr.

◆ isHeader()

bool HcalUHTRData::const_iterator::isHeader ( ) const
inline

Definition at line 47 of file HcalUHTRData.h.

47 { return ((*m_ptr) & 0x8000) != 0; }

References m_ptr.

Referenced by const_iterator().

◆ le_tdc()

uint8_t HcalUHTRData::const_iterator::le_tdc ( ) const

Definition at line 86 of file HcalUHTRData.cc.

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 }

◆ ok()

bool HcalUHTRData::const_iterator::ok ( ) const

Definition at line 126 of file HcalUHTRData.cc.

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 }

◆ operator!=()

bool HcalUHTRData::const_iterator::operator!= ( const const_iterator i)
inline

Definition at line 70 of file HcalUHTRData.h.

70 { return m_ptr != i.m_ptr; }

References mps_fire::i, and m_ptr.

◆ operator*()

uint16_t HcalUHTRData::const_iterator::operator* ( void  ) const
inline

Definition at line 64 of file HcalUHTRData.h.

64 { return *m_ptr; }

References m_ptr.

◆ operator++()

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.

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 }

◆ operator==()

bool HcalUHTRData::const_iterator::operator== ( const const_iterator i)
inline

Definition at line 69 of file HcalUHTRData.h.

69 { return m_ptr == i.m_ptr; }

References mps_fire::i, and m_ptr.

◆ raw()

const uint16_t* HcalUHTRData::const_iterator::raw ( ) const
inline

Definition at line 71 of file HcalUHTRData.h.

71 { return m_ptr; }

References m_ptr.

◆ soi()

bool HcalUHTRData::const_iterator::soi ( ) const

Definition at line 95 of file HcalUHTRData.cc.

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 }

◆ te_tdc()

uint8_t HcalUHTRData::const_iterator::te_tdc ( ) const

Definition at line 104 of file HcalUHTRData.cc.

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

◆ technicalDataType()

int HcalUHTRData::const_iterator::technicalDataType ( ) const

Definition at line 70 of file HcalUHTRData.cc.

70  {
71  if (m_flavor == 7)
72  return ((*m_ptr) >> 8) & 0xF;
73  else
74  return 0;
75 }

◆ value()

uint16_t HcalUHTRData::const_iterator::value ( ) const
inline

Member Data Documentation

◆ m_0th_data_ptr

const uint16_t * HcalUHTRData::const_iterator::m_0th_data_ptr
private

Definition at line 76 of file HcalUHTRData.h.

◆ m_flavor

int HcalUHTRData::const_iterator::m_flavor
private

Definition at line 79 of file HcalUHTRData.h.

◆ m_header_ptr

const uint16_t* HcalUHTRData::const_iterator::m_header_ptr
private

Definition at line 76 of file HcalUHTRData.h.

◆ m_limit

const uint16_t * HcalUHTRData::const_iterator::m_limit
private

Definition at line 75 of file HcalUHTRData.h.

◆ m_microstep

int HcalUHTRData::const_iterator::m_microstep
private

Definition at line 77 of file HcalUHTRData.h.

◆ m_ptr

const uint16_t* HcalUHTRData::const_iterator::m_ptr
private

Definition at line 75 of file HcalUHTRData.h.

Referenced by capid0(), channelid(), flavor(), isHeader(), operator!=(), operator*(), operator==(), raw(), and value().

◆ m_stepclass

int HcalUHTRData::const_iterator::m_stepclass
private

Definition at line 78 of file HcalUHTRData.h.

◆ m_technicalDataType

int HcalUHTRData::const_iterator::m_technicalDataType
private

Definition at line 80 of file HcalUHTRData.h.

HcalUHTRData::const_iterator::m_0th_data_ptr
const uint16_t * m_0th_data_ptr
Definition: HcalUHTRData.h:76
mps_fire.i
i
Definition: mps_fire.py:355
HcalUHTRData::const_iterator::determineMode
void determineMode()
Definition: HcalUHTRData.cc:40
HcalUHTRData::const_iterator::isHeader
bool isHeader() const
Definition: HcalUHTRData.h:47
HcalUHTRData::const_iterator::m_limit
const uint16_t * m_limit
Definition: HcalUHTRData.h:75
HcalUHTRData::const_iterator::m_ptr
const uint16_t * m_ptr
Definition: HcalUHTRData.h:75
HcalUHTRData::const_iterator::flavor
int flavor() const
Definition: HcalUHTRData.h:48
remoteMonitoring_LED_IterMethod_cfg.limit
limit
Definition: remoteMonitoring_LED_IterMethod_cfg.py:427
HcalUHTRData::const_iterator::errFlags
int errFlags() const
Definition: HcalUHTRData.cc:56
HcalUHTRData::const_iterator::m_microstep
int m_microstep
Definition: HcalUHTRData.h:77
HcalUHTRData::const_iterator::m_technicalDataType
int m_technicalDataType
Definition: HcalUHTRData.h:80
HcalUHTRData::const_iterator::m_stepclass
int m_stepclass
Definition: HcalUHTRData.h:78
HcalUHTRData::const_iterator::technicalDataType
int technicalDataType() const
Definition: HcalUHTRData.cc:70
HcalUHTRData::const_iterator::m_flavor
int m_flavor
Definition: HcalUHTRData.h:79
HcalUHTRData::const_iterator::m_header_ptr
const uint16_t * m_header_ptr
Definition: HcalUHTRData.h:76