CMS 3D CMS Logo

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

#include <HcalUHTRData.h>

Public Member Functions

void addHeader (int flavor, int errf, int cap0, int channelid)
 
void addSample (int adc, bool soi=false, int retdc=0, int fetdc=0, int tdcstat=0)
 
void addTP (int tpword, bool soi=false)
 
 packer (uint16_t *baseptr)
 

Private Attributes

uint16_t * m_baseptr
 
int m_flavor
 
int m_ministep
 
int m_ptr
 

Detailed Description

Definition at line 80 of file HcalUHTRData.h.

Constructor & Destructor Documentation

HcalUHTRData::packer::packer ( uint16_t *  baseptr)

Definition at line 85 of file HcalUHTRData.cc.

Member Function Documentation

void HcalUHTRData::packer::addHeader ( int  flavor,
int  errf,
int  cap0,
int  channelid 
)

Definition at line 88 of file HcalUHTRData.cc.

References m_baseptr, m_flavor, m_ministep, and m_ptr.

88  {
89  m_baseptr[m_ptr]=0x8000 |
90  ((flavor&0x7)<<12) |
91  ((errf&0x3)<<10) |
92  ((cap0&0x3)<<8) |
93  (channelid&0xFF);
94  m_flavor=flavor;
95  m_ministep=0;
96  m_ptr++;
97 }
uint16_t * m_baseptr
Definition: HcalUHTRData.h:87
void HcalUHTRData::packer::addSample ( int  adc,
bool  soi = false,
int  retdc = 0,
int  fetdc = 0,
int  tdcstat = 0 
)

Definition at line 99 of file HcalUHTRData.cc.

References m_baseptr, m_flavor, m_ministep, and m_ptr.

99  {
100  if (m_flavor==0x5) {
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;
108  m_ptr++;
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;
113  m_ptr+=2;
114  }
115 }
int adc(sample_type sample)
get the ADC sample (12 bits)
uint16_t * m_baseptr
Definition: HcalUHTRData.h:87
void HcalUHTRData::packer::addTP ( int  tpword,
bool  soi = false 
)

Definition at line 117 of file HcalUHTRData.cc.

References m_baseptr, m_flavor, and m_ptr.

117  {
118  if (m_flavor==0x4) {
119  m_baseptr[m_ptr]=tpword&0xFFF;
120  if (soi) m_baseptr[m_ptr]|=0x4000;
121  m_ptr++;
122  }
123 }
uint16_t * m_baseptr
Definition: HcalUHTRData.h:87

Member Data Documentation

uint16_t* HcalUHTRData::packer::m_baseptr
private

Definition at line 87 of file HcalUHTRData.h.

Referenced by addHeader(), addSample(), and addTP().

int HcalUHTRData::packer::m_flavor
private

Definition at line 89 of file HcalUHTRData.h.

Referenced by addHeader(), addSample(), and addTP().

int HcalUHTRData::packer::m_ministep
private

Definition at line 90 of file HcalUHTRData.h.

Referenced by addHeader(), and addSample().

int HcalUHTRData::packer::m_ptr
private

Definition at line 88 of file HcalUHTRData.h.

Referenced by addHeader(), addSample(), and addTP().