CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
sistrip::FEDChannel Class Reference

#include <SiStripFEDBufferComponents.h>

Public Member Functions

uint16_t cmMedian (const uint8_t apvIndex) const
 
const uint8_t * data () const
 
 FEDChannel (const uint8_t *const data, const size_t offset, const uint16_t length)
 
 FEDChannel (const uint8_t *const data, const size_t offset)
 
uint16_t length () const
 
size_t offset () const
 
uint8_t packetCode () const
 

Private Attributes

const uint8_t * data_
 
uint16_t length_
 
size_t offset_
 

Friends

class FEDBuffer
 

Detailed Description

Definition at line 546 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

sistrip::FEDChannel::FEDChannel ( const uint8_t *const  data,
const size_t  offset,
const uint16_t  length 
)
inline

Definition at line 1645 of file SiStripFEDBufferComponents.h.

sistrip::FEDChannel::FEDChannel ( const uint8_t *const  data,
const size_t  offset 
)
inline

Definition at line 1638 of file SiStripFEDBufferComponents.h.

References data_, length_, and offset_.

1639  : data_(data),
1640  offset_(offset)
1641  {
1642  length_ = ( data_[(offset_)^7] + (data_[(offset_+1)^7] << 8) );
1643  }
const uint8_t * data() const

Member Function Documentation

uint16_t sistrip::FEDChannel::cmMedian ( const uint8_t  apvIndex) const

Definition at line 1507 of file SiStripFEDBufferComponents.cc.

References Exception, sistrip::PACKET_CODE_ZERO_SUPPRESSED, sistrip::PACKET_CODE_ZERO_SUPPRESSED10, sistrip::PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT, sistrip::PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT, sistrip::FEDBufferBase::packetCode(), and mps_fire::result.

Referenced by SiStripCMMonitorPlugin::analyze().

1508  {
1509  const auto pCode = packetCode();
1510  if ( ( pCode != PACKET_CODE_ZERO_SUPPRESSED ) && ( pCode != PACKET_CODE_ZERO_SUPPRESSED10 )
1512  {
1513  std::ostringstream ss;
1514  ss << "Request for CM median from channel with non-ZS packet code. "
1515  << "Packet code is " << uint16_t(packetCode()) << "."
1516  << std::endl;
1517  throw cms::Exception("FEDBuffer") << ss.str();
1518  }
1519  if (apvIndex > 1) {
1520  std::ostringstream ss;
1521  ss << "Channel APV index out of range when requesting CM median for APV. "
1522  << "Channel APV index is " << uint16_t(apvIndex) << "."
1523  << std::endl;
1524  throw cms::Exception("FEDBuffer") << ss.str();
1525  }
1526  uint16_t result = 0;
1527  //CM median is 10 bits with lowest order byte first. First APV CM median starts in 4th byte of channel data
1528  result |= data_[(offset_+3+2*apvIndex)^7];
1529  result |= ( ((data_[(offset_+4+2*apvIndex)^7]) << 8) & 0x300 );
1530  return result;
1531  }
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED10
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED
const uint8_t * sistrip::FEDChannel::data ( ) const
inline
uint16_t sistrip::FEDChannel::length ( ) const
inline
size_t sistrip::FEDChannel::offset ( ) const
inline
uint8_t sistrip::FEDChannel::packetCode ( ) const
inline

Definition at line 1657 of file SiStripFEDBufferComponents.h.

References data_, and offset_.

Referenced by SiStripClusterizerFromRaw::run().

1658  {
1659  return data_[(offset_+2)^7];
1660  }

Friends And Related Function Documentation

friend class FEDBuffer
friend

Definition at line 559 of file SiStripFEDBufferComponents.h.

Member Data Documentation

const uint8_t* sistrip::FEDChannel::data_
private

Definition at line 560 of file SiStripFEDBufferComponents.h.

Referenced by data(), FEDChannel(), and packetCode().

uint16_t sistrip::FEDChannel::length_
private

Definition at line 562 of file SiStripFEDBufferComponents.h.

Referenced by FEDChannel(), and length().

size_t sistrip::FEDChannel::offset_
private

Definition at line 561 of file SiStripFEDBufferComponents.h.

Referenced by FEDChannel(), offset(), and packetCode().