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 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 76 of file HcalUHTRData.h.

Constructor & Destructor Documentation

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

Definition at line 62 of file HcalUHTRData.cc.

Member Function Documentation

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

Definition at line 65 of file HcalUHTRData.cc.

65  {
66  m_baseptr[m_ptr]=0x8000 |
67  ((flavor&0x7)<<12) |
68  ((errf&0x3)<<10) |
69  ((cap0&0x3)<<8) |
70  (channelid&0xFF);
71  m_flavor=flavor;
72  m_ministep=0;
73  m_ptr++;
74 }
uint16_t * m_baseptr
Definition: HcalUHTRData.h:83
void HcalUHTRData::packer::addSample ( int  adc,
bool  soi = false,
int  retdc = 0,
int  fetdc = 0,
int  tdcstat = 0 
)

Definition at line 76 of file HcalUHTRData.cc.

76  {
77  if (m_flavor==0x5) {
78  if (m_ministep==0) m_baseptr[m_ptr]=adc&0x7F;
79  else m_baseptr[m_ptr]|=((adc&0x7f)<<8);
80  if (m_ministep==1) m_ptr++;
81  m_ministep=(m_ministep+1)%2;
82  } else if ((m_flavor&0x6)==0x0) {
83  m_baseptr[m_ptr]=(adc&0xFF) | ((retdc&0x3F)<<8);
84  if (soi) m_baseptr[m_ptr]|=0x4000;
85  m_ptr++;
86  } else if ((m_flavor&0x6)==0x1) {
87  m_baseptr[m_ptr]=(adc&0xFF);
88  m_baseptr[m_ptr+1]=0x4000| ((tdcstat&0x3)<<10) | ((fetdc&0xF)<<6) | ((retdc)<<8);
89  if (soi) m_baseptr[m_ptr]|=0x2000;
90  m_ptr+=2;
91  }
92 }
int adc(sample_type sample)
get the ADC sample (12 bits)
uint16_t * m_baseptr
Definition: HcalUHTRData.h:83
void HcalUHTRData::packer::addTP ( int  tpword,
bool  soi = false 
)

Definition at line 94 of file HcalUHTRData.cc.

94  {
95  if (m_flavor==0x4) {
96  m_baseptr[m_ptr]=tpword&0xFFF;
97  if (soi) m_baseptr[m_ptr]|=0x4000;
98  m_ptr++;
99  }
100 }
uint16_t * m_baseptr
Definition: HcalUHTRData.h:83

Member Data Documentation

uint16_t* HcalUHTRData::packer::m_baseptr
private

Definition at line 83 of file HcalUHTRData.h.

int HcalUHTRData::packer::m_flavor
private

Definition at line 85 of file HcalUHTRData.h.

int HcalUHTRData::packer::m_ministep
private

Definition at line 86 of file HcalUHTRData.h.

int HcalUHTRData::packer::m_ptr
private

Definition at line 84 of file HcalUHTRData.h.