CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes
sistrip::FEDRawChannelUnpacker Class Reference

#include <SiStripFEDBuffer.h>

Public Member Functions

uint16_t adc () const
 
 FEDRawChannelUnpacker (const FEDChannel &channel)
 
bool hasData () const
 
FEDRawChannelUnpackeroperator++ ()
 
FEDRawChannelUnpackeroperator++ (int)
 
uint8_t sampleNumber () const
 

Static Public Member Functions

static FEDRawChannelUnpacker procRawModeUnpacker (const FEDChannel &channel)
 
static FEDRawChannelUnpacker scopeModeUnpacker (const FEDChannel &channel)
 
static FEDRawChannelUnpacker virginRawModeUnpacker (const FEDChannel &channel)
 

Static Private Member Functions

static void throwBadChannelLength (const uint16_t length)
 

Private Attributes

uint16_t currentOffset_
 
uint8_t currentStrip_
 
const uint8_t * data_
 
uint16_t valuesLeft_
 

Detailed Description

Definition at line 122 of file SiStripFEDBuffer.h.

Constructor & Destructor Documentation

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

Definition at line 337 of file SiStripFEDBuffer.h.

References sistrip::FEDChannel::length(), and throwBadChannelLength().

338  : data_(channel.data()),
339  currentOffset_(channel.offset() + 3),
340  currentStrip_(0),
341  valuesLeft_((channel.length() - 3) / 2) {
342  if ((channel.length() - 3) % 2)
343  throwBadChannelLength(channel.length());
344  }
static void throwBadChannelLength(const uint16_t length)

Member Function Documentation

uint16_t sistrip::FEDRawChannelUnpacker::adc ( ) const
inline

Definition at line 348 of file SiStripFEDBuffer.h.

References currentOffset_, and data_.

Referenced by sistrip::RawToDigiUnpacker::createDigis(), and SiStripClusterizerFromRaw::run().

348  {
349  return (data_[currentOffset_ ^ 7] + ((data_[(currentOffset_ + 1) ^ 7] & 0x03) << 8));
350  }
bool sistrip::FEDRawChannelUnpacker::hasData ( ) const
inline
FEDRawChannelUnpacker & sistrip::FEDRawChannelUnpacker::operator++ ( void  )
inline

Definition at line 354 of file SiStripFEDBuffer.h.

References currentOffset_, currentStrip_, and valuesLeft_.

354  {
355  currentOffset_ += 2;
356  currentStrip_++;
357  valuesLeft_--;
358  return (*this);
359  }
FEDRawChannelUnpacker & sistrip::FEDRawChannelUnpacker::operator++ ( int  )
inline

Definition at line 361 of file SiStripFEDBuffer.h.

361  {
362  ++(*this);
363  return *this;
364  }
static FEDRawChannelUnpacker sistrip::FEDRawChannelUnpacker::procRawModeUnpacker ( const FEDChannel channel)
inlinestatic

Definition at line 128 of file SiStripFEDBuffer.h.

References ecalMGPA::adc(), and sistrip::FEDBufferBase::channel().

Referenced by sistrip::RawToDigiUnpacker::createDigis(), and SiStripClusterizerFromRaw::run().

128  {
129  return FEDRawChannelUnpacker(channel);
130  }
FEDRawChannelUnpacker(const FEDChannel &channel)
uint8_t sistrip::FEDRawChannelUnpacker::sampleNumber ( ) const
inline

Definition at line 346 of file SiStripFEDBuffer.h.

References currentStrip_.

static FEDRawChannelUnpacker sistrip::FEDRawChannelUnpacker::scopeModeUnpacker ( const FEDChannel channel)
inlinestatic

Definition at line 124 of file SiStripFEDBuffer.h.

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

124 { return FEDRawChannelUnpacker(channel); }
FEDRawChannelUnpacker(const FEDChannel &channel)
void sistrip::FEDRawChannelUnpacker::throwBadChannelLength ( const uint16_t  length)
staticprivate

Definition at line 428 of file SiStripFEDBuffer.cc.

References Exception, and contentValuesCheck::ss.

Referenced by FEDRawChannelUnpacker().

428  {
429  std::ostringstream ss;
430  ss << "Channel length is invalid. Raw channels have 3 header bytes and 2 bytes per sample. "
431  << "Channel length is " << uint16_t(length) << "." << std::endl;
432  throw cms::Exception("FEDBuffer") << ss.str();
433  }
static FEDRawChannelUnpacker sistrip::FEDRawChannelUnpacker::virginRawModeUnpacker ( const FEDChannel channel)
inlinestatic

Definition at line 125 of file SiStripFEDBuffer.h.

Referenced by sistrip::RawToDigiUnpacker::createDigis(), and SiStripClusterizerFromRaw::run().

125  {
126  return FEDRawChannelUnpacker(channel);
127  }
FEDRawChannelUnpacker(const FEDChannel &channel)

Member Data Documentation

uint16_t sistrip::FEDRawChannelUnpacker::currentOffset_
private

Definition at line 141 of file SiStripFEDBuffer.h.

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

uint8_t sistrip::FEDRawChannelUnpacker::currentStrip_
private

Definition at line 142 of file SiStripFEDBuffer.h.

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

const uint8_t* sistrip::FEDRawChannelUnpacker::data_
private

Definition at line 140 of file SiStripFEDBuffer.h.

Referenced by adc().

uint16_t sistrip::FEDRawChannelUnpacker::valuesLeft_
private

Definition at line 143 of file SiStripFEDBuffer.h.

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