test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
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
 
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
 

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 
)

Definition at line 6 of file HcalUHTRData.cc.

References determineMode(), and isHeader().

Member Function Documentation

uint8_t HcalUHTRData::const_iterator::adc ( ) const

Definition at line 38 of file HcalUHTRData.cc.

Referenced by HcalUnpacker_impl::unpack_compact().

38  {
39  if (m_flavor==0x5 && m_microstep==0) return ((*m_ptr)>>8)&0x7F;
40  else return (*m_ptr)&0xFF;
41 }
uint8_t HcalUHTRData::const_iterator::capid ( ) const

Definition at line 60 of file HcalUHTRData.cc.

60  {
61  if (m_flavor==2) return(m_ptr[1]>>12)&0x3;
62  else if (m_flavor == 1 || m_flavor == 0) {
63  // For flavor 0,1 we only get the first capid in the header, and so we need
64  // to count the number of data rows and figure out which cap we want,
65  // knowing that they go 0->1->2->3->0
66  return 0;
67  }
68  else { return 0; }
69 }
int HcalUHTRData::const_iterator::capid0 ( ) const
inline

Definition at line 47 of file HcalUHTRData.h.

References m_ptr.

Referenced by HcalUnpacker_impl::unpack_compact().

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

Definition at line 48 of file HcalUHTRData.h.

References m_ptr.

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

48 { return ((*m_ptr))&0xFF; }
void HcalUHTRData::const_iterator::determineMode ( )
private

Definition at line 30 of file HcalUHTRData.cc.

Referenced by const_iterator().

30  {
31  if (!isHeader()) return;
32  m_flavor=flavor();
33  m_stepclass=0;
34  if (m_flavor==5) { m_stepclass=1; m_microstep=0; }
35  else if (m_flavor == 2) { m_stepclass=2; }
36 }
int HcalUHTRData::const_iterator::errFlags ( ) const
inline

Definition at line 46 of file HcalUHTRData.h.

References m_ptr.

Referenced by HcalUnpacker_impl::unpack_compact().

46 { return ((*m_ptr)>>10)&0x3; }
int HcalUHTRData::const_iterator::flavor ( ) const
inline

Definition at line 45 of file HcalUHTRData.h.

References m_ptr.

Referenced by 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(), HcalUnpacker_impl::unpack_compact(), and HcalUnpacker::unpackUTCA().

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

Definition at line 43 of file HcalUHTRData.cc.

43  {
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);
47 }
bool HcalUHTRData::const_iterator::ok ( ) const

Definition at line 71 of file HcalUHTRData.cc.

71  {
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; }
75 }
bool HcalUHTRData::const_iterator::operator!= ( const const_iterator i)
inline

Definition at line 65 of file HcalUHTRData.h.

References m_ptr.

65 { return m_ptr!=i.m_ptr; }
int i
Definition: DBlmapReader.cc:9
uint16_t HcalUHTRData::const_iterator::operator* ( void  ) const
inline

Definition at line 59 of file HcalUHTRData.h.

References m_ptr.

59 { 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 10 of file HcalUHTRData.cc.

10  {
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--; }
16  }
17  else if (m_stepclass==2) {
18  if (isHeader()) { m_ptr++; }
19  else { m_ptr+=2; }
20  }
21 
22  if (isHeader()) {
23  determineMode();
26  }
27  return *this;
28 }
const uint16_t * m_limit
Definition: HcalUHTRData.h:70
const uint16_t * m_0th_data_ptr
Definition: HcalUHTRData.h:71
const uint16_t * m_header_ptr
Definition: HcalUHTRData.h:71
bool HcalUHTRData::const_iterator::operator== ( const const_iterator i)
inline

Definition at line 64 of file HcalUHTRData.h.

References m_ptr.

64 { return m_ptr==i.m_ptr; }
int i
Definition: DBlmapReader.cc:9
const uint16_t* HcalUHTRData::const_iterator::raw ( ) const
inline

Definition at line 66 of file HcalUHTRData.h.

References m_ptr.

Referenced by HcalUnpacker::unpackUTCA().

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

Definition at line 49 of file HcalUHTRData.cc.

Referenced by HcalUnpacker::unpackUTCA().

49  {
50  if (m_flavor==0x5) return false;
51  else if (m_flavor == 2) return (m_ptr[0]&0x2000);
52  else return (((*m_ptr)&0x4000));
53 }
uint8_t HcalUHTRData::const_iterator::te_tdc ( ) const

Definition at line 55 of file HcalUHTRData.cc.

55  {
56  if (m_flavor==2) return(m_ptr[1]>>6)&0x1F;
57  else return 0x80;
58 }
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 71 of file HcalUHTRData.h.

int HcalUHTRData::const_iterator::m_flavor
private

Definition at line 74 of file HcalUHTRData.h.

const uint16_t* HcalUHTRData::const_iterator::m_header_ptr
private

Definition at line 71 of file HcalUHTRData.h.

const uint16_t * HcalUHTRData::const_iterator::m_limit
private

Definition at line 70 of file HcalUHTRData.h.

int HcalUHTRData::const_iterator::m_microstep
private

Definition at line 72 of file HcalUHTRData.h.

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

Definition at line 73 of file HcalUHTRData.h.