CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

size_t currentOffset_
 
uint8_t currentStrip_
 
const uint8_t * data_
 
uint16_t valuesLeft_
 

Detailed Description

Definition at line 108 of file SiStripFEDBuffer.h.

Constructor & Destructor Documentation

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

Definition at line 166 of file SiStripFEDBuffer.h.

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

Referenced by procRawModeUnpacker(), scopeModeUnpacker(), and virginRawModeUnpacker().

167  : data_(channel.data()),
168  currentOffset_(channel.offset()+3),
169  currentStrip_(0),
170  valuesLeft_((channel.length()-3)/2)
171  {
172  if ((channel.length()-3)%2) throwBadChannelLength(channel.length());
173  }
static void throwBadChannelLength(const uint16_t length)

Member Function Documentation

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

Definition at line 180 of file SiStripFEDBuffer.h.

References currentOffset_, and data_.

Referenced by sistrip::RawToDigiUnpacker::createDigis(), and sistrip::RawToClustersLazyUnpacker::fill().

181  {
182  return ( data_[currentOffset_^7] + ((data_[(currentOffset_+1)^7]&0x03)<<8) );
183  }
bool sistrip::FEDRawChannelUnpacker::hasData ( ) const
inline

Definition at line 185 of file SiStripFEDBuffer.h.

References valuesLeft_.

Referenced by sistrip::RawToDigiUnpacker::createDigis(), and sistrip::RawToClustersLazyUnpacker::fill().

186  {
187  return valuesLeft_;
188  }
FEDRawChannelUnpacker & sistrip::FEDRawChannelUnpacker::operator++ ( void  )
inline

Definition at line 190 of file SiStripFEDBuffer.h.

References currentOffset_, currentStrip_, and valuesLeft_.

191  {
192  currentOffset_ += 2;
193  currentStrip_++;
194  valuesLeft_--;
195  return (*this);
196  }
FEDRawChannelUnpacker & sistrip::FEDRawChannelUnpacker::operator++ ( int  )
inline

Definition at line 198 of file SiStripFEDBuffer.h.

199  {
200  ++(*this); return *this;
201  }
static FEDRawChannelUnpacker sistrip::FEDRawChannelUnpacker::procRawModeUnpacker ( const FEDChannel channel)
inlinestatic

Definition at line 113 of file SiStripFEDBuffer.h.

References FEDRawChannelUnpacker().

Referenced by sistrip::RawToDigiUnpacker::createDigis(), and sistrip::RawToClustersLazyUnpacker::fill().

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

Definition at line 175 of file SiStripFEDBuffer.h.

References currentStrip_.

176  {
177  return currentStrip_;
178  }
static FEDRawChannelUnpacker sistrip::FEDRawChannelUnpacker::scopeModeUnpacker ( const FEDChannel channel)
inlinestatic

Definition at line 111 of file SiStripFEDBuffer.h.

References FEDRawChannelUnpacker().

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

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

Definition at line 424 of file SiStripFEDBuffer.cc.

References edm::hlt::Exception.

Referenced by FEDRawChannelUnpacker().

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

Definition at line 112 of file SiStripFEDBuffer.h.

References FEDRawChannelUnpacker().

Referenced by sistrip::RawToDigiUnpacker::createDigis(), and sistrip::RawToClustersLazyUnpacker::fill().

112 { return FEDRawChannelUnpacker(channel); }
FEDRawChannelUnpacker(const FEDChannel &channel)

Member Data Documentation

size_t sistrip::FEDRawChannelUnpacker::currentOffset_
private

Definition at line 123 of file SiStripFEDBuffer.h.

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

uint8_t sistrip::FEDRawChannelUnpacker::currentStrip_
private

Definition at line 124 of file SiStripFEDBuffer.h.

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

const uint8_t* sistrip::FEDRawChannelUnpacker::data_
private

Definition at line 122 of file SiStripFEDBuffer.h.

Referenced by adc().

uint16_t sistrip::FEDRawChannelUnpacker::valuesLeft_
private

Definition at line 125 of file SiStripFEDBuffer.h.

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