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 Attributes
sistrip::FEDSpyChannelUnpacker Class Reference

#include <SiStripFEDSpyBuffer.h>

Public Member Functions

uint16_t adc () const
 
 FEDSpyChannelUnpacker (const FEDChannel &channel)
 
bool hasData () const
 
FEDSpyChannelUnpackeroperator++ ()
 
FEDSpyChannelUnpackeroperator++ (int)
 
uint16_t sampleNumber () const
 

Private Attributes

size_t currentOffset_
 
uint16_t currentSample_
 
const uint32_t * data_
 
uint16_t valuesLeft_
 

Detailed Description

Definition at line 67 of file SiStripFEDSpyBuffer.h.

Constructor & Destructor Documentation

sistrip::FEDSpyChannelUnpacker::FEDSpyChannelUnpacker ( const FEDChannel channel)
inlineexplicit

Definition at line 89 of file SiStripFEDSpyBuffer.h.

90  : data_(reinterpret_cast<const uint32_t*>(channel.data())),
91  currentOffset_(channel.offset()),
92  currentSample_(0),
93  valuesLeft_(channel.length())
94  {
95  }

Member Function Documentation

uint16_t sistrip::FEDSpyChannelUnpacker::adc ( ) const

Definition at line 154 of file SiStripFEDSpyBuffer.cc.

References currentOffset_, and data_.

Referenced by sistrip::SpyUnpacker::createDigis().

155  {
156  const size_t offsetWords = currentOffset_/32;
157  const uint8_t offsetBits = currentOffset_%32;
158  if (offsetBits < 23) {
159  return ( (data_[offsetWords]>>(32-10-offsetBits)) & 0x3FF );
160  } else {
161  return ( ((data_[offsetWords]<<(10-32+offsetBits))&0x3FF) | ((data_[offsetWords+1]&(0xFFC00000<<(32-offsetBits)))>>(64-10-offsetBits)) );
162  }
163  }
bool sistrip::FEDSpyChannelUnpacker::hasData ( ) const
inline

Definition at line 102 of file SiStripFEDSpyBuffer.h.

References valuesLeft_.

Referenced by sistrip::SpyUnpacker::createDigis().

103  {
104  return (valuesLeft_ != 0);
105  }
FEDSpyChannelUnpacker & sistrip::FEDSpyChannelUnpacker::operator++ ( void  )
inline

Definition at line 107 of file SiStripFEDSpyBuffer.h.

References currentOffset_, currentSample_, sistrip::FEDCH_PER_DELAY_CHIP, and valuesLeft_.

108  {
110  currentSample_++;
111  valuesLeft_--;
112  return (*this);
113  }
static const uint16_t FEDCH_PER_DELAY_CHIP
FEDSpyChannelUnpacker & sistrip::FEDSpyChannelUnpacker::operator++ ( int  )
inline

Definition at line 115 of file SiStripFEDSpyBuffer.h.

116  {
117  ++(*this); return *this;
118  }
uint16_t sistrip::FEDSpyChannelUnpacker::sampleNumber ( ) const
inline

Definition at line 97 of file SiStripFEDSpyBuffer.h.

References currentSample_.

98  {
99  return currentSample_;
100  }

Member Data Documentation

size_t sistrip::FEDSpyChannelUnpacker::currentOffset_
private

Definition at line 78 of file SiStripFEDSpyBuffer.h.

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

uint16_t sistrip::FEDSpyChannelUnpacker::currentSample_
private

Definition at line 79 of file SiStripFEDSpyBuffer.h.

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

const uint32_t* sistrip::FEDSpyChannelUnpacker::data_
private

Definition at line 77 of file SiStripFEDSpyBuffer.h.

Referenced by adc().

uint16_t sistrip::FEDSpyChannelUnpacker::valuesLeft_
private

Definition at line 80 of file SiStripFEDSpyBuffer.h.

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