#include <SiStripFEDBuffer.h>
Public Member Functions | |
uint8_t | adc () const |
FEDZSChannelUnpacker () | |
bool | hasData () const |
FEDZSChannelUnpacker & | operator++ () |
FEDZSChannelUnpacker & | operator++ (int) |
uint8_t | sampleNumber () const |
Static Public Member Functions | |
static FEDZSChannelUnpacker | zeroSuppressedLiteModeUnpacker (const FEDChannel &channel) |
static FEDZSChannelUnpacker | zeroSuppressedModeUnpacker (const FEDChannel &channel) |
Private Member Functions | |
FEDZSChannelUnpacker (const uint8_t *payload, const size_t channelPayloadOffset, const int16_t channelPayloadLength) | |
void | readNewClusterInfo () |
void | throwBadClusterLength () |
Static Private Member Functions | |
static void | throwBadChannelLength (const uint16_t length) |
static void | throwUnorderedData (const uint8_t currentStrip, const uint8_t firstStripOfNewCluster) |
Private Attributes | |
uint16_t | channelPayloadLength_ |
uint16_t | channelPayloadOffset_ |
size_t | currentOffset_ |
uint8_t | currentStrip_ |
const uint8_t * | data_ |
uint8_t | valuesLeftInCluster_ |
Definition at line 80 of file SiStripFEDBuffer.h.
sistrip::FEDZSChannelUnpacker::FEDZSChannelUnpacker | ( | ) | [inline] |
Definition at line 199 of file SiStripFEDBuffer.h.
: data_(NULL), valuesLeftInCluster_(0), channelPayloadOffset_(0), channelPayloadLength_(0) { }
sistrip::FEDZSChannelUnpacker::FEDZSChannelUnpacker | ( | const uint8_t * | payload, |
const size_t | channelPayloadOffset, | ||
const int16_t | channelPayloadLength | ||
) | [inline, private] |
Definition at line 206 of file SiStripFEDBuffer.h.
References channelPayloadLength_, and readNewClusterInfo().
: data_(payload), currentOffset_(channelPayloadOffset), currentStrip_(0), valuesLeftInCluster_(0), channelPayloadOffset_(channelPayloadOffset), channelPayloadLength_(channelPayloadLength) { if (channelPayloadLength_) readNewClusterInfo(); }
uint8_t sistrip::FEDZSChannelUnpacker::adc | ( | ) | const [inline] |
Definition at line 238 of file SiStripFEDBuffer.h.
References currentOffset_, and data_.
Referenced by sistrip::RawToDigiUnpacker::createDigis(), and sistrip::RawToClustersLazyUnpacker::fill().
{ return data_[currentOffset_^7]; }
bool sistrip::FEDZSChannelUnpacker::hasData | ( | ) | const [inline] |
Definition at line 243 of file SiStripFEDBuffer.h.
References channelPayloadLength_, channelPayloadOffset_, and currentOffset_.
Referenced by sistrip::RawToDigiUnpacker::createDigis(), sistrip::RawToClustersLazyUnpacker::fill(), and operator++().
{ return (currentOffset_<channelPayloadOffset_+channelPayloadLength_); }
FEDZSChannelUnpacker & sistrip::FEDZSChannelUnpacker::operator++ | ( | void | ) | [inline] |
Definition at line 248 of file SiStripFEDBuffer.h.
References currentOffset_, currentStrip_, hasData(), readNewClusterInfo(), throwUnorderedData(), and valuesLeftInCluster_.
{ if (valuesLeftInCluster_) { currentStrip_++; currentOffset_++; valuesLeftInCluster_--; } else { currentOffset_++; if (hasData()) { const uint8_t oldStrip = currentStrip_; readNewClusterInfo(); if ( !(currentStrip_ > oldStrip) ) throwUnorderedData(oldStrip,currentStrip_); } } return (*this); }
FEDZSChannelUnpacker & sistrip::FEDZSChannelUnpacker::operator++ | ( | int | ) | [inline] |
Definition at line 265 of file SiStripFEDBuffer.h.
{ ++(*this); return *this; }
void sistrip::FEDZSChannelUnpacker::readNewClusterInfo | ( | ) | [inline, private] |
Definition at line 270 of file SiStripFEDBuffer.h.
References currentOffset_, currentStrip_, data_, and valuesLeftInCluster_.
Referenced by FEDZSChannelUnpacker(), and operator++().
{ currentStrip_ = data_[(currentOffset_++)^7]; valuesLeftInCluster_ = data_[(currentOffset_++)^7]-1; }
uint8_t sistrip::FEDZSChannelUnpacker::sampleNumber | ( | ) | const [inline] |
Definition at line 233 of file SiStripFEDBuffer.h.
References currentStrip_.
Referenced by sistrip::RawToDigiUnpacker::createDigis(), and sistrip::RawToClustersLazyUnpacker::fill().
{ return currentStrip_; }
void sistrip::FEDZSChannelUnpacker::throwBadChannelLength | ( | const uint16_t | length | ) | [static, private] |
Definition at line 434 of file SiStripFEDBuffer.cc.
References Exception.
Referenced by zeroSuppressedLiteModeUnpacker(), and zeroSuppressedModeUnpacker().
{ std::ostringstream ss; ss << "Channel length is longer than max allowed value. " << "Channel length is " << uint16_t(length) << "." << std::endl; throw cms::Exception("FEDBuffer") << ss.str(); }
void sistrip::FEDZSChannelUnpacker::throwBadClusterLength | ( | ) | [private] |
Definition at line 443 of file SiStripFEDBuffer.cc.
References Exception, and valuesLeftInCluster_.
{ std::ostringstream ss; ss << "Cluster does not fit into channel. " << "Cluster length is " << uint16_t(valuesLeftInCluster_) << "." << std::endl; throw cms::Exception("FEDBuffer") << ss.str(); }
void sistrip::FEDZSChannelUnpacker::throwUnorderedData | ( | const uint8_t | currentStrip, |
const uint8_t | firstStripOfNewCluster | ||
) | [static, private] |
Definition at line 452 of file SiStripFEDBuffer.cc.
References Exception.
Referenced by operator++().
{ std::ostringstream ss; ss << "First strip of new cluster is not greater than last strip of previous cluster. " << "Last strip of previous cluster is " << uint16_t(currentStrip) << ". " << "First strip of new cluster is " << uint16_t(firstStripOfNewCluster) << "." << std::endl; throw cms::Exception("FEDBuffer") << ss.str(); }
FEDZSChannelUnpacker sistrip::FEDZSChannelUnpacker::zeroSuppressedLiteModeUnpacker | ( | const FEDChannel & | channel | ) | [inline, static] |
Definition at line 225 of file SiStripFEDBuffer.h.
References sistrip::FEDChannel::data(), sistrip::FEDChannel::length(), sistrip::FEDChannel::offset(), query::result, and throwBadChannelLength().
Referenced by sistrip::RawToDigiUnpacker::createDigis(), and sistrip::RawToClustersLazyUnpacker::fill().
{ uint16_t length = channel.length(); if (length & 0xF000) throwBadChannelLength(length); FEDZSChannelUnpacker result(channel.data(),channel.offset()+2,length-2); return result; }
FEDZSChannelUnpacker sistrip::FEDZSChannelUnpacker::zeroSuppressedModeUnpacker | ( | const FEDChannel & | channel | ) | [inline, static] |
Definition at line 217 of file SiStripFEDBuffer.h.
References sistrip::FEDChannel::data(), sistrip::FEDChannel::length(), sistrip::FEDChannel::offset(), query::result, and throwBadChannelLength().
Referenced by sistrip::RawToDigiUnpacker::createDigis(), and sistrip::RawToClustersLazyUnpacker::fill().
{ uint16_t length = channel.length(); if (length & 0xF000) throwBadChannelLength(length); FEDZSChannelUnpacker result(channel.data(),channel.offset()+7,length-7); return result; }
uint16_t sistrip::FEDZSChannelUnpacker::channelPayloadLength_ [private] |
Definition at line 103 of file SiStripFEDBuffer.h.
Referenced by FEDZSChannelUnpacker(), and hasData().
uint16_t sistrip::FEDZSChannelUnpacker::channelPayloadOffset_ [private] |
Definition at line 102 of file SiStripFEDBuffer.h.
Referenced by hasData().
size_t sistrip::FEDZSChannelUnpacker::currentOffset_ [private] |
Definition at line 99 of file SiStripFEDBuffer.h.
Referenced by adc(), hasData(), operator++(), and readNewClusterInfo().
uint8_t sistrip::FEDZSChannelUnpacker::currentStrip_ [private] |
Definition at line 100 of file SiStripFEDBuffer.h.
Referenced by operator++(), readNewClusterInfo(), and sampleNumber().
const uint8_t* sistrip::FEDZSChannelUnpacker::data_ [private] |
Definition at line 98 of file SiStripFEDBuffer.h.
Referenced by adc(), and readNewClusterInfo().
uint8_t sistrip::FEDZSChannelUnpacker::valuesLeftInCluster_ [private] |
Definition at line 101 of file SiStripFEDBuffer.h.
Referenced by operator++(), readNewClusterInfo(), and throwBadClusterLength().