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 | 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 116 of file SiStripFEDBuffer.h.

Constructor & Destructor Documentation

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

Definition at line 310 of file SiStripFEDBuffer.h.

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

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

311  : data_(channel.data()),
312  currentOffset_(channel.offset()+3),
313  currentStrip_(0),
314  valuesLeft_((channel.length()-3)/2)
315  {
316  if ((channel.length()-3)%2) throwBadChannelLength(channel.length());
317  }
static void throwBadChannelLength(const uint16_t length)

Member Function Documentation

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

Definition at line 324 of file SiStripFEDBuffer.h.

References currentOffset_, and data_.

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

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

Definition at line 329 of file SiStripFEDBuffer.h.

References valuesLeft_.

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

330  {
331  return valuesLeft_;
332  }
FEDRawChannelUnpacker & sistrip::FEDRawChannelUnpacker::operator++ ( void  )
inline

Definition at line 334 of file SiStripFEDBuffer.h.

References currentOffset_, currentStrip_, and valuesLeft_.

335  {
336  currentOffset_ += 2;
337  currentStrip_++;
338  valuesLeft_--;
339  return (*this);
340  }
FEDRawChannelUnpacker & sistrip::FEDRawChannelUnpacker::operator++ ( int  )
inline

Definition at line 342 of file SiStripFEDBuffer.h.

343  {
344  ++(*this); return *this;
345  }
static FEDRawChannelUnpacker sistrip::FEDRawChannelUnpacker::procRawModeUnpacker ( const FEDChannel channel)
inlinestatic

Definition at line 121 of file SiStripFEDBuffer.h.

References FEDRawChannelUnpacker().

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

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

Definition at line 319 of file SiStripFEDBuffer.h.

References currentStrip_.

320  {
321  return currentStrip_;
322  }
static FEDRawChannelUnpacker sistrip::FEDRawChannelUnpacker::scopeModeUnpacker ( const FEDChannel channel)
inlinestatic

Definition at line 119 of file SiStripFEDBuffer.h.

References FEDRawChannelUnpacker().

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

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

Definition at line 415 of file SiStripFEDBuffer.cc.

References Exception, and contentValuesCheck::ss.

Referenced by FEDRawChannelUnpacker().

416  {
417  std::ostringstream ss;
418  ss << "Channel length is invalid. Raw channels have 3 header bytes and 2 bytes per sample. "
419  << "Channel length is " << uint16_t(length) << "."
420  << std::endl;
421  throw cms::Exception("FEDBuffer") << ss.str();
422  }
static FEDRawChannelUnpacker sistrip::FEDRawChannelUnpacker::virginRawModeUnpacker ( const FEDChannel channel)
inlinestatic

Definition at line 120 of file SiStripFEDBuffer.h.

References FEDRawChannelUnpacker().

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

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

Member Data Documentation

uint16_t sistrip::FEDRawChannelUnpacker::currentOffset_
private

Definition at line 131 of file SiStripFEDBuffer.h.

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

uint8_t sistrip::FEDRawChannelUnpacker::currentStrip_
private

Definition at line 132 of file SiStripFEDBuffer.h.

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

const uint8_t* sistrip::FEDRawChannelUnpacker::data_
private

Definition at line 130 of file SiStripFEDBuffer.h.

Referenced by adc().

uint16_t sistrip::FEDRawChannelUnpacker::valuesLeft_
private

Definition at line 133 of file SiStripFEDBuffer.h.

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