CMS 3D CMS Logo

Public Member Functions | Private Attributes

sistrip::FEDSpyChannelUnpacker Class Reference

#include <SiStripFEDSpyBuffer.h>

List of all members.

Public Member Functions

uint16_t adc () const
 FEDSpyChannelUnpacker (const FEDChannel &channel)
bool hasData () const
FEDSpyChannelUnpackeroperator++ ()
FEDSpyChannelUnpackeroperator++ (int)
uint16_t sampleNumber () const

Private Attributes

size_t currentOffset_
uint16_t currentSample_
const uint32_t * data_
uint16_t valuesLeft_

Detailed Description

Definition at line 67 of file SiStripFEDSpyBuffer.h.


Constructor & Destructor Documentation

sistrip::FEDSpyChannelUnpacker::FEDSpyChannelUnpacker ( const FEDChannel channel) [inline, explicit]

Definition at line 89 of file SiStripFEDSpyBuffer.h.

    : data_(reinterpret_cast<const uint32_t*>(channel.data())),
      currentOffset_(channel.offset()),
      currentSample_(0),
      valuesLeft_(channel.length())
  {
  }

Member Function Documentation

uint16_t sistrip::FEDSpyChannelUnpacker::adc ( ) const

Definition at line 154 of file SiStripFEDSpyBuffer.cc.

References currentOffset_, and data_.

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

  {
    const size_t offsetWords = currentOffset_/32;
    const uint8_t offsetBits = currentOffset_%32;
    if (offsetBits < 23) {
      return ( (data_[offsetWords]>>(32-10-offsetBits)) & 0x3FF );
    } else {
      return ( ((data_[offsetWords]<<(10-32+offsetBits))&0x3FF) | ((data_[offsetWords+1]&(0xFFC00000<<(32-offsetBits)))>>(64-10-offsetBits)) );
    }
  }
bool sistrip::FEDSpyChannelUnpacker::hasData ( ) const [inline]

Definition at line 102 of file SiStripFEDSpyBuffer.h.

References valuesLeft_.

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

  {
    return (valuesLeft_ != 0);
  }
FEDSpyChannelUnpacker & sistrip::FEDSpyChannelUnpacker::operator++ ( void  ) [inline]
FEDSpyChannelUnpacker & sistrip::FEDSpyChannelUnpacker::operator++ ( int  ) [inline]

Definition at line 115 of file SiStripFEDSpyBuffer.h.

  {
    ++(*this); return *this;
  }
uint16_t sistrip::FEDSpyChannelUnpacker::sampleNumber ( ) const [inline]

Definition at line 97 of file SiStripFEDSpyBuffer.h.

References currentSample_.

  {
    return currentSample_;
  }

Member Data Documentation

Definition at line 78 of file SiStripFEDSpyBuffer.h.

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

Definition at line 79 of file SiStripFEDSpyBuffer.h.

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

const uint32_t* sistrip::FEDSpyChannelUnpacker::data_ [private]

Definition at line 77 of file SiStripFEDSpyBuffer.h.

Referenced by adc().

Definition at line 80 of file SiStripFEDSpyBuffer.h.

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