CMS 3D CMS Logo

sistrip::FEDZSChannelUnpacker Class Reference

#include <EventFilter/SiStripRawToDigi/interface/SiStripFEDBuffer.h>

List of all members.

Public Member Functions

uint8_t adc () const
 FEDZSChannelUnpacker ()
bool hasData () const
FEDZSChannelUnpackeroperator++ (int)
FEDZSChannelUnpackeroperator++ ()
uint8_t strip () 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, size_t channelPayloadOffset, int16_t channelPayloadLength)
void readNewClusterInfo ()
void throwBadClusterLength ()

Static Private Member Functions

static void throwBadChannelLength (uint16_t length)

Private Attributes

size_t currentOffset_
uint8_t currentStrip_
const uint8_t * data_
int16_t valuesLeftAfterThisCluster_
uint8_t valuesLeftInCluster_


Detailed Description

Definition at line 183 of file SiStripFEDBuffer.h.


Constructor & Destructor Documentation

sistrip::FEDZSChannelUnpacker::FEDZSChannelUnpacker (  )  [inline]

Definition at line 188 of file SiStripFEDBuffer.h.

sistrip::FEDZSChannelUnpacker::FEDZSChannelUnpacker ( const uint8_t *  payload,
size_t  channelPayloadOffset,
int16_t  channelPayloadLength 
) [inline, private]

Definition at line 307 of file SiStripFEDBuffer.h.

References readNewClusterInfo().

00308     : data_(payload),
00309     currentOffset_(channelPayloadOffset),
00310     currentStrip_(0),
00311     valuesLeftInCluster_(0),
00312     valuesLeftAfterThisCluster_(channelPayloadLength)
00313     {
00314       readNewClusterInfo();
00315     }


Member Function Documentation

uint8_t sistrip::FEDZSChannelUnpacker::adc (  )  const [inline]

Definition at line 190 of file SiStripFEDBuffer.h.

References currentOffset_, and data_.

00190 { return data_[currentOffset_^7]; }

bool sistrip::FEDZSChannelUnpacker::hasData (  )  const [inline]

Definition at line 191 of file SiStripFEDBuffer.h.

References valuesLeftAfterThisCluster_, and valuesLeftInCluster_.

FEDZSChannelUnpacker& sistrip::FEDZSChannelUnpacker::operator++ ( int   )  [inline]

Definition at line 193 of file SiStripFEDBuffer.h.

00193 { ++(*this); return *this; }

FEDZSChannelUnpacker & sistrip::FEDZSChannelUnpacker::operator++ ( void   )  [inline]

Definition at line 327 of file SiStripFEDBuffer.h.

References currentOffset_, currentStrip_, readNewClusterInfo(), and valuesLeftInCluster_.

00328     {
00329       if (valuesLeftInCluster_) {
00330         currentStrip_++;
00331         currentOffset_++;
00332         valuesLeftInCluster_--;
00333       } else {
00334         currentOffset_++;
00335         readNewClusterInfo();
00336       }
00337       return (*this);
00338     }

void sistrip::FEDZSChannelUnpacker::readNewClusterInfo (  )  [inline, private]

Definition at line 317 of file SiStripFEDBuffer.h.

References currentOffset_, currentStrip_, data_, throwBadClusterLength(), valuesLeftAfterThisCluster_, and valuesLeftInCluster_.

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

00318     {
00319       if (valuesLeftAfterThisCluster_) {
00320         currentStrip_ = data_[(currentOffset_++)^7];
00321         valuesLeftInCluster_ = data_[(currentOffset_++)^7]-1;
00322         valuesLeftAfterThisCluster_ -= valuesLeftInCluster_+3;
00323         if (valuesLeftAfterThisCluster_ < 0) throwBadClusterLength();
00324       }
00325     }

uint8_t sistrip::FEDZSChannelUnpacker::strip ( void   )  const [inline]

Definition at line 189 of file SiStripFEDBuffer.h.

References currentStrip_.

00189 { return currentStrip_; }

void sistrip::FEDZSChannelUnpacker::throwBadChannelLength ( uint16_t  length  )  [static, private]

Definition at line 525 of file SiStripFEDBuffer.cc.

References lat::endl(), Exception, and ss.

Referenced by zeroSuppressedLiteModeUnpacker(), and zeroSuppressedModeUnpacker().

00526   {
00527     std::stringstream ss;
00528     ss << "Channel length is longer than max allowed value. "
00529        << "Channel length is " << uint16_t(length) << "."
00530        << std::endl;
00531     throw cms::Exception("FEDBuffer") << ss.str();
00532   }

void sistrip::FEDZSChannelUnpacker::throwBadClusterLength (  )  [private]

Definition at line 534 of file SiStripFEDBuffer.cc.

References lat::endl(), Exception, ss, and valuesLeftInCluster_.

Referenced by readNewClusterInfo().

00535   {
00536     std::stringstream ss;
00537     ss << "Cluster does not fit into channel. "
00538        << "Cluster length is " << uint16_t(valuesLeftInCluster_) << "."
00539        << std::endl;
00540     throw cms::Exception("FEDBuffer") << ss.str();
00541   }

FEDZSChannelUnpacker sistrip::FEDZSChannelUnpacker::zeroSuppressedLiteModeUnpacker ( const FEDChannel channel  )  [inline, static]

Definition at line 348 of file SiStripFEDBuffer.h.

References sistrip::FEDChannel::data(), sistrip::FEDChannel::length(), sistrip::FEDChannel::offset(), HLT_VtxMuL3::result, and throwBadChannelLength().

00349     {
00350       uint16_t length = channel.length();
00351       if (length & 0xF000) throwBadChannelLength(length);
00352       FEDZSChannelUnpacker result(channel.data(),channel.offset()+2,length-2);
00353       return result;
00354     }

FEDZSChannelUnpacker sistrip::FEDZSChannelUnpacker::zeroSuppressedModeUnpacker ( const FEDChannel channel  )  [inline, static]

Definition at line 340 of file SiStripFEDBuffer.h.

References sistrip::FEDChannel::data(), sistrip::FEDChannel::length(), sistrip::FEDChannel::offset(), HLT_VtxMuL3::result, and throwBadChannelLength().

00341     {
00342       uint16_t length = channel.length();
00343       if (length & 0xF000) throwBadChannelLength(length);
00344       FEDZSChannelUnpacker result(channel.data(),channel.offset()+7,length-7);
00345       return result;
00346     }


Member Data Documentation

size_t sistrip::FEDZSChannelUnpacker::currentOffset_ [private]

Definition at line 201 of file SiStripFEDBuffer.h.

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

uint8_t sistrip::FEDZSChannelUnpacker::currentStrip_ [private]

Definition at line 202 of file SiStripFEDBuffer.h.

Referenced by operator++(), readNewClusterInfo(), and strip().

const uint8_t* sistrip::FEDZSChannelUnpacker::data_ [private]

Definition at line 200 of file SiStripFEDBuffer.h.

Referenced by adc(), and readNewClusterInfo().

int16_t sistrip::FEDZSChannelUnpacker::valuesLeftAfterThisCluster_ [private]

Definition at line 204 of file SiStripFEDBuffer.h.

Referenced by hasData(), and readNewClusterInfo().

uint8_t sistrip::FEDZSChannelUnpacker::valuesLeftInCluster_ [private]

Definition at line 203 of file SiStripFEDBuffer.h.

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


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:52:35 2009 for CMSSW by  doxygen 1.5.4