CMS 3D CMS Logo

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

Constructor & Destructor Documentation

◆ FEDSpyChannelUnpacker()

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

Definition at line 120 of file SiStripFEDSpyBuffer.h.

121  : data_(reinterpret_cast<const uint32_t*>(channel.data())),
122  currentOffset_(channel.offset()),
123  currentSample_(0),
124  valuesLeft_(channel.length()) {}

Member Function Documentation

◆ adc()

uint16_t sistrip::FEDSpyChannelUnpacker::adc ( ) const

Definition at line 139 of file SiStripFEDSpyBuffer.cc.

References currentOffset_, and data_.

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

139  {
140  const size_t offsetWords = currentOffset_ / 32;
141  const uint8_t offsetBits = currentOffset_ % 32;
142  if (offsetBits < 23) {
143  return ((data_[offsetWords] >> (32 - 10 - offsetBits)) & 0x3FF);
144  } else {
145  return (((data_[offsetWords] << (10 - 32 + offsetBits)) & 0x3FF) |
146  ((data_[offsetWords + 1] & (0xFFC00000 << (32 - offsetBits))) >> (64 - 10 - offsetBits)));
147  }
148  }

◆ hasData()

bool sistrip::FEDSpyChannelUnpacker::hasData ( ) const
inline

Definition at line 128 of file SiStripFEDSpyBuffer.h.

References valuesLeft_.

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

128 { return (valuesLeft_ != 0); }

◆ operator++() [1/2]

FEDSpyChannelUnpacker & sistrip::FEDSpyChannelUnpacker::operator++ ( void  )
inline

Definition at line 130 of file SiStripFEDSpyBuffer.h.

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

130  {
132  currentSample_++;
133  valuesLeft_--;
134  return (*this);
135  }
static const uint16_t FEDCH_PER_DELAY_CHIP

◆ operator++() [2/2]

FEDSpyChannelUnpacker & sistrip::FEDSpyChannelUnpacker::operator++ ( int  )
inline

Definition at line 137 of file SiStripFEDSpyBuffer.h.

137  {
138  ++(*this);
139  return *this;
140  }

◆ sampleNumber()

uint16_t sistrip::FEDSpyChannelUnpacker::sampleNumber ( ) const
inline

Definition at line 126 of file SiStripFEDSpyBuffer.h.

References currentSample_.

Member Data Documentation

◆ currentOffset_

size_t sistrip::FEDSpyChannelUnpacker::currentOffset_
private

Definition at line 87 of file SiStripFEDSpyBuffer.h.

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

◆ currentSample_

uint16_t sistrip::FEDSpyChannelUnpacker::currentSample_
private

Definition at line 88 of file SiStripFEDSpyBuffer.h.

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

◆ data_

const uint32_t* sistrip::FEDSpyChannelUnpacker::data_
private

Definition at line 86 of file SiStripFEDSpyBuffer.h.

Referenced by adc().

◆ valuesLeft_

uint16_t sistrip::FEDSpyChannelUnpacker::valuesLeft_
private

Definition at line 89 of file SiStripFEDSpyBuffer.h.

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