CMS 3D CMS Logo

sistrip::FEDRawChannelUnpacker Class Reference

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

List of all members.

Public Member Functions

uint16_t adc () const
 FEDRawChannelUnpacker (const FEDChannel &channel)
bool hasData () const
FEDRawChannelUnpackeroperator++ (int)
FEDRawChannelUnpackeroperator++ ()
uint8_t strip () 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 (uint16_t length)

Private Attributes

size_t currentOffset_
uint8_t currentStrip_
const uint8_t * data_
uint8_t valuesLeft_


Detailed Description

Definition at line 207 of file SiStripFEDBuffer.h.


Constructor & Destructor Documentation

sistrip::FEDRawChannelUnpacker::FEDRawChannelUnpacker ( const FEDChannel channel  )  [inline]

Definition at line 288 of file SiStripFEDBuffer.h.

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

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

00289     : data_(channel.data()),
00290     currentOffset_(channel.offset()+3),
00291     currentStrip_(0),
00292     valuesLeft_((channel.length()-3)/2)
00293     {
00294       if ((channel.length()-3)%2) throwBadChannelLength(channel.length());
00295     }


Member Function Documentation

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

Definition at line 215 of file SiStripFEDBuffer.h.

References currentOffset_, and data_.

00215 { return ( data_[currentOffset_^7] + ((data_[(currentOffset_+1)^7]&0x03)<<8) ); }

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

Definition at line 216 of file SiStripFEDBuffer.h.

References valuesLeft_.

00216 { return valuesLeft_; }

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

Definition at line 218 of file SiStripFEDBuffer.h.

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

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

Definition at line 297 of file SiStripFEDBuffer.h.

References currentOffset_, currentStrip_, and valuesLeft_.

00298     {
00299       currentOffset_ += 2;
00300       currentStrip_++;
00301       valuesLeft_--;
00302       return (*this);
00303     }

static FEDRawChannelUnpacker sistrip::FEDRawChannelUnpacker::procRawModeUnpacker ( const FEDChannel channel  )  [inline, static]

Definition at line 212 of file SiStripFEDBuffer.h.

References FEDRawChannelUnpacker().

00212 { return FEDRawChannelUnpacker(channel); }

static FEDRawChannelUnpacker sistrip::FEDRawChannelUnpacker::scopeModeUnpacker ( const FEDChannel channel  )  [inline, static]

Definition at line 210 of file SiStripFEDBuffer.h.

References FEDRawChannelUnpacker().

00210 { return FEDRawChannelUnpacker(channel); }

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

Definition at line 214 of file SiStripFEDBuffer.h.

References currentStrip_.

00214 { return currentStrip_; }

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

Definition at line 513 of file SiStripFEDBuffer.cc.

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

Referenced by FEDRawChannelUnpacker().

00514   {
00515     std::stringstream ss;
00516     ss << "Channel length is invalid. Raw channels have 3 header bytes and 2 bytes per sample. "
00517        << "Channel length is " << uint16_t(length) << "."
00518        << std::endl;
00519     throw cms::Exception("FEDBuffer") << ss.str();
00520   }

static FEDRawChannelUnpacker sistrip::FEDRawChannelUnpacker::virginRawModeUnpacker ( const FEDChannel channel  )  [inline, static]

Definition at line 211 of file SiStripFEDBuffer.h.

References FEDRawChannelUnpacker().

00211 { return FEDRawChannelUnpacker(channel); }


Member Data Documentation

size_t sistrip::FEDRawChannelUnpacker::currentOffset_ [private]

Definition at line 222 of file SiStripFEDBuffer.h.

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

uint8_t sistrip::FEDRawChannelUnpacker::currentStrip_ [private]

Definition at line 223 of file SiStripFEDBuffer.h.

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

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

Definition at line 221 of file SiStripFEDBuffer.h.

Referenced by adc().

uint8_t sistrip::FEDRawChannelUnpacker::valuesLeft_ [private]

Definition at line 224 of file SiStripFEDBuffer.h.

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


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