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=0)
 
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 40 of file HcalUHTRData.h.

Constructor & Destructor Documentation

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

Member Function Documentation

uint8_t HcalUHTRData::const_iterator::adc ( ) const

Definition at line 56 of file HcalUHTRData.cc.

References m_flavor, m_microstep, m_ptr, and m_technicalDataType.

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

56  {
57  if (m_flavor==5 && m_microstep==0) return ((*m_ptr)>>8)&0x7F;
58  else if (m_flavor==7 && m_technicalDataType==15) return (*m_ptr)&0x7F;
59  else return (*m_ptr)&0xFF;
60 }
uint8_t HcalUHTRData::const_iterator::capid ( ) const

Definition at line 79 of file HcalUHTRData.cc.

References m_flavor, m_ptr, and m_technicalDataType.

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

79  {
80  if (m_flavor==2) return(m_ptr[1]>>12)&0x3;
81  else if (m_flavor==7 && m_technicalDataType==15) {
82  return ((*m_ptr)>>8)&0x3;
83  }
84  else if (m_flavor == 1 || m_flavor == 0) {
85  // For flavor 0,1 we only get the first capid in the header, and so we need
86  // to count the number of data rows and figure out which cap we want,
87  // knowing that they go 0->1->2->3->0
88  return 0;
89  }
90  else { return 0; }
91 }
int HcalUHTRData::const_iterator::capid0 ( ) const
inline

Definition at line 48 of file HcalUHTRData.h.

References m_ptr.

Referenced by HcalUnpacker_impl::unpack_compact().

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

Definition at line 49 of file HcalUHTRData.h.

References m_ptr, and technicalDataType().

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

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

Definition at line 46 of file HcalUHTRData.cc.

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

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

46  {
47  if ((m_flavor==7 && m_technicalDataType==15) && !isHeader()) return ((*m_ptr)>>10)&0x1;
48  else return !(errFlags()&0x2);
49 }
void HcalUHTRData::const_iterator::determineMode ( )
private
int HcalUHTRData::const_iterator::errFlags ( ) const

Definition at line 41 of file HcalUHTRData.cc.

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

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

41  {
42  if ((m_flavor==7 && m_technicalDataType==15) && !isHeader()) return ((*m_ptr)>>11)&0x1;
43  else return ((*m_ptr)>>10)&0x3;
44 }
int HcalUHTRData::const_iterator::flavor ( ) const
inline

Definition at line 45 of file HcalUHTRData.h.

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

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

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

Definition at line 44 of file HcalUHTRData.h.

References m_ptr.

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

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

Definition at line 62 of file HcalUHTRData.cc.

References m_flavor, m_ptr, and m_technicalDataType.

Referenced by value().

62  {
63  if (m_flavor==5 || (m_flavor==7 && m_technicalDataType==15)) return 0x80;
64  else if (m_flavor == 2) return (m_ptr[1]&0x3F);
65  else return (((*m_ptr)&0x3F00)>>8);
66 }
bool HcalUHTRData::const_iterator::ok ( ) const

Definition at line 93 of file HcalUHTRData.cc.

References m_flavor, and m_ptr.

Referenced by value().

93  {
94  if (m_flavor == 2) { return (m_ptr[0]>>12)&0x1; }
95  else if (m_flavor == 4) { return (m_ptr[0]>>13)&0x1; }
96  else { return false; }
97 }
bool HcalUHTRData::const_iterator::operator!= ( const const_iterator i)
inline

Definition at line 67 of file HcalUHTRData.h.

References m_ptr.

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

Definition at line 61 of file HcalUHTRData.h.

References m_ptr, and operator++().

61 { 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) return *this;
14  if (m_stepclass==0) m_ptr++;
15  else if (m_stepclass==1) {
16  if (m_microstep==0) { m_ptr++; m_microstep++; }
17  else { m_microstep--; }
18  }
19  else if (m_stepclass==2) {
20  if (isHeader()) { m_ptr++; }
21  else { m_ptr+=2; }
22  }
23 
24  if (isHeader()) {
25  determineMode();
28  }
29  return *this;
30 }
const uint16_t * m_limit
Definition: HcalUHTRData.h:72
const uint16_t * m_0th_data_ptr
Definition: HcalUHTRData.h:73
const uint16_t * m_header_ptr
Definition: HcalUHTRData.h:73
bool HcalUHTRData::const_iterator::operator== ( const const_iterator i)
inline

Definition at line 66 of file HcalUHTRData.h.

References m_ptr.

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

Definition at line 68 of file HcalUHTRData.h.

References determineMode(), and m_ptr.

Referenced by HcalUnpacker::unpackUTCA().

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

Definition at line 68 of file HcalUHTRData.cc.

References m_flavor, m_ptr, and m_technicalDataType.

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

68  {
69  if (m_flavor==5 || (m_flavor==7 && m_technicalDataType==15)) return false;
70  else if (m_flavor == 2) return (m_ptr[0]&0x2000);
71  else return (((*m_ptr)&0x4000));
72 }
uint8_t HcalUHTRData::const_iterator::te_tdc ( ) const

Definition at line 74 of file HcalUHTRData.cc.

References m_flavor, and m_ptr.

Referenced by value().

74  {
75  if (m_flavor==2) return(m_ptr[1]>>6)&0x1F;
76  else return 0x80;
77 }
int HcalUHTRData::const_iterator::technicalDataType ( ) const

Definition at line 51 of file HcalUHTRData.cc.

References m_flavor, and m_ptr.

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

51  {
52  if (m_flavor==7) return ((*m_ptr)>>8)&0xF;
53  else return 0;
54 }
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 73 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 73 of file HcalUHTRData.h.

Referenced by operator++().

const uint16_t * HcalUHTRData::const_iterator::m_limit
private

Definition at line 72 of file HcalUHTRData.h.

Referenced by operator++().

int HcalUHTRData::const_iterator::m_microstep
private

Definition at line 74 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 75 of file HcalUHTRData.h.

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

int HcalUHTRData::const_iterator::m_technicalDataType
private

Definition at line 77 of file HcalUHTRData.h.

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