CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
sistrip::FEDBufferBase Class Reference

#include <SiStripFEDBufferComponents.h>

Inheritance diagram for sistrip::FEDBufferBase:
sistrip::FEDBuffer sistrip::FEDSpyBuffer

Public Member Functions

uint8_t apveAddress () const
 
FEDBufferFormat bufferFormat () const
 
size_t bufferSize () const
 
uint16_t calcCRC () const
 
const FEDChannelchannel (const uint8_t internalFEDChannelNum) const
 
const FEDChannelchannel (const uint8_t internalFEUnitNum, const uint8_t internalChannelNum) const
 
virtual bool channelGood (const uint8_t internalFEDChannelNum) const
 
bool channelGood (const uint8_t internalFEUnitNum, const uint8_t internalChannelNum) const
 
bool checkAPVEAddressValid () const
 
bool checkBufferFormat () const
 
bool checkCRC () const
 
bool checkHeaderType () const
 
bool checkLengthFromTrailer () const
 
bool checkMajorityAddresses () const
 
bool checkNoExtraHeadersOrTrailers () const
 
bool checkNoFEOverflows () const
 
bool checkNoSlinkCRCError () const
 
bool checkNoSLinkTransmissionError () const
 
bool checkNoUnexpectedSourceID () const
 
bool checkReadoutMode () const
 
bool checkSourceIDs () const
 
virtual std::string checkSummary () const
 
uint16_t daqBXID () const
 
uint16_t daqCRC () const
 
uint32_t daqEventLengthIn64bitWords () const
 
uint32_t daqEventLengthInBytes () const
 
FEDDAQEventType daqEventType () const
 
FEDDAQHeader daqHeader () const
 
uint32_t daqLvl1ID () const
 
uint16_t daqSourceID () const
 
FEDDAQTrailer daqTrailer () const
 
FEDTTSBits daqTTSState () const
 
bool doChecks () const
 
bool doDAQHeaderAndTrailerChecks () const
 
bool doTrackerSpecialHeaderChecks () const
 
void dump (std::ostream &os) const
 
void dumpOriginalBuffer (std::ostream &os) const
 
 FEDBufferBase (const FEDRawData &fedBuffer)
 
FEDStatusRegister fedStatusRegister () const
 
bool feEnabled (const uint8_t internalFEUnitNum) const
 
bool feOverflow (const uint8_t internalFEUnitNum) const
 
FEDHeaderType headerType () const
 
FEDLegacyReadoutMode legacyReadoutMode () const
 
bool majorityAddressErrorForFEUnit (const uint8_t internalFEUnitNum) const
 
uint8_t nFEUnitsEnabled () const
 
uint8_t packetCode (bool legacy=false, const uint8_t internalFEDChannelNum=0) const
 
virtual void print (std::ostream &os) const
 
FEDReadoutMode readoutMode () const
 
uint16_t sourceID () const
 
TrackerSpecialHeader trackerSpecialHeader () const
 
virtual ~FEDBufferBase ()
 

Protected Member Functions

 FEDBufferBase (const FEDRawData &fedBuffer, const bool fillChannelVector)
 
const uint8_t * getPointerToByteAfterEndOfPayload () const
 
const uint8_t * getPointerToDataAfterTrackerSpecialHeader () const
 

Protected Attributes

std::vector< FEDChannelchannels_
 

Private Member Functions

void init ()
 

Private Attributes

const size_t bufferSize_
 
FEDDAQHeader daqHeader_
 
FEDDAQTrailer daqTrailer_
 
const uint8_t * orderedBuffer_
 
const uint8_t * originalBuffer_
 
TrackerSpecialHeader specialHeader_
 

Detailed Description

Definition at line 643 of file SiStripFEDBufferComponents.h.

Constructor & Destructor Documentation

◆ FEDBufferBase() [1/2]

sistrip::FEDBufferBase::FEDBufferBase ( const FEDRawData fedBuffer)
explicit

constructor from a FEDRawData buffer

The sistrip::preconstructCheckFEDBufferBase() method should be used to check the validity of the fedBuffer before constructing a sistrip::FEDBufferBase.

See also
sistrip::preconstructCheckFEDBufferBase()

Definition at line 1248 of file SiStripFEDBufferComponents.cc.

References init().

1249  : channels_(FEDCH_PER_FED, FEDChannel(nullptr, 0, 0)),
1250  originalBuffer_(fedBuffer.data()),
1251  bufferSize_(fedBuffer.size()) {
1252  init();
1253  }
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:48
std::vector< FEDChannel > channels_
static const uint16_t FEDCH_PER_FED
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24

◆ ~FEDBufferBase()

sistrip::FEDBufferBase::~FEDBufferBase ( )
virtual

Definition at line 1304 of file SiStripFEDBufferComponents.cc.

References orderedBuffer_, and originalBuffer_.

1304  {
1305  //if the buffer was coppied and swapped then delete the copy
1307  delete[] orderedBuffer_;
1308  }

◆ FEDBufferBase() [2/2]

sistrip::FEDBufferBase::FEDBufferBase ( const FEDRawData fedBuffer,
const bool  fillChannelVector 
)
protected

Definition at line 1255 of file SiStripFEDBufferComponents.cc.

References channels_, sistrip::FEDCH_PER_FED, and init().

1256  : originalBuffer_(fedBuffer.data()), bufferSize_(fedBuffer.size()) {
1257  init();
1258  if (fillChannelVector)
1259  channels_.assign(FEDCH_PER_FED, FEDChannel(nullptr, 0, 0));
1260  }
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:48
std::vector< FEDChannel > channels_
static const uint16_t FEDCH_PER_FED
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24

Member Function Documentation

◆ apveAddress()

uint8_t sistrip::FEDBufferBase::apveAddress ( ) const
inline

◆ bufferFormat()

FEDBufferFormat sistrip::FEDBufferBase::bufferFormat ( ) const
inline

◆ bufferSize()

size_t sistrip::FEDBufferBase::bufferSize ( ) const
inline

◆ calcCRC()

uint16_t sistrip::FEDBufferBase::calcCRC ( ) const
inline

Definition at line 1399 of file SiStripFEDBufferComponents.h.

References bufferSize_, sistrip::calculateFEDBufferCRC(), and orderedBuffer_.

Referenced by checkCRC().

uint16_t calculateFEDBufferCRC(const uint8_t *buffer, const size_t lengthInBytes)

◆ channel() [1/2]

const FEDChannel & sistrip::FEDBufferBase::channel ( const uint8_t  internalFEDChannelNum) const
inline

Definition at line 1508 of file SiStripFEDBufferComponents.h.

References channels_, and sistrip::internalFEDChannelNum().

Referenced by channel(), and packetCode().

1508  {
1510  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
std::vector< FEDChannel > channels_

◆ channel() [2/2]

const FEDChannel & sistrip::FEDBufferBase::channel ( const uint8_t  internalFEUnitNum,
const uint8_t  internalChannelNum 
) const
inline

Definition at line 1512 of file SiStripFEDBufferComponents.h.

References channel(), and sistrip::internalFEDChannelNum().

1513  {
1514  return channel(internalFEDChannelNum(internalFEUnitNum, internalChannelNum));
1515  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
const FEDChannel & channel(const uint8_t internalFEDChannelNum) const

◆ channelGood() [1/2]

bool sistrip::FEDBufferBase::channelGood ( const uint8_t  internalFEDChannelNum) const
virtual

Reimplemented in sistrip::FEDSpyBuffer.

Definition at line 1351 of file SiStripFEDBufferComponents.cc.

References sistrip::FEDCH_PER_FEUNIT, feEnabled(), feOverflow(), sistrip::internalFEDChannelNum(), and majorityAddressErrorForFEUnit().

Referenced by channelGood().

1351  {
1352  const uint8_t feUnit = internalFEDChannelNum / FEDCH_PER_FEUNIT;
1353  return (!majorityAddressErrorForFEUnit(feUnit) && feEnabled(feUnit) && !feOverflow(feUnit));
1354  }
bool feOverflow(const uint8_t internalFEUnitNum) const
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const
bool feEnabled(const uint8_t internalFEUnitNum) const
static const uint16_t FEDCH_PER_FEUNIT

◆ channelGood() [2/2]

bool sistrip::FEDBufferBase::channelGood ( const uint8_t  internalFEUnitNum,
const uint8_t  internalChannelNum 
) const
inline

Definition at line 1504 of file SiStripFEDBufferComponents.h.

References channelGood(), and sistrip::internalFEDChannelNum().

1504  {
1505  return channelGood(internalFEDChannelNum(internalFEUnitNum, internalChannelNum));
1506  }
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
virtual bool channelGood(const uint8_t internalFEDChannelNum) const

◆ checkAPVEAddressValid()

bool sistrip::FEDBufferBase::checkAPVEAddressValid ( ) const
inline

Definition at line 1536 of file SiStripFEDBufferComponents.h.

References sistrip::APV_MAX_ADDRESS, and apveAddress().

1536 { return (apveAddress() <= APV_MAX_ADDRESS); }
static const uint8_t APV_MAX_ADDRESS

◆ checkBufferFormat()

bool sistrip::FEDBufferBase::checkBufferFormat ( ) const
inline

◆ checkCRC()

bool sistrip::FEDBufferBase::checkCRC ( ) const
inline

◆ checkHeaderType()

bool sistrip::FEDBufferBase::checkHeaderType ( ) const
inline

◆ checkLengthFromTrailer()

bool sistrip::FEDBufferBase::checkLengthFromTrailer ( ) const
inline

◆ checkMajorityAddresses()

bool sistrip::FEDBufferBase::checkMajorityAddresses ( ) const

Definition at line 1341 of file SiStripFEDBufferComponents.cc.

References feEnabled(), sistrip::FEUNITS_PER_FED, and majorityAddressErrorForFEUnit().

Referenced by checkSummary().

1341  {
1342  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
1343  if (!feEnabled(iFE))
1344  continue;
1346  return false;
1347  }
1348  return true;
1349  }
bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const
bool feEnabled(const uint8_t internalFEUnitNum) const
static const uint16_t FEUNITS_PER_FED

◆ checkNoExtraHeadersOrTrailers()

bool sistrip::FEDBufferBase::checkNoExtraHeadersOrTrailers ( ) const
inline

◆ checkNoFEOverflows()

bool sistrip::FEDBufferBase::checkNoFEOverflows ( ) const
inline

◆ checkNoSlinkCRCError()

bool sistrip::FEDBufferBase::checkNoSlinkCRCError ( ) const
inline

◆ checkNoSLinkTransmissionError()

bool sistrip::FEDBufferBase::checkNoSLinkTransmissionError ( ) const
inline

◆ checkNoUnexpectedSourceID()

bool sistrip::FEDBufferBase::checkNoUnexpectedSourceID ( ) const
inline

◆ checkReadoutMode()

bool sistrip::FEDBufferBase::checkReadoutMode ( ) const
inline

◆ checkSourceIDs()

bool sistrip::FEDBufferBase::checkSourceIDs ( ) const

Definition at line 1337 of file SiStripFEDBufferComponents.cc.

References daqSourceID(), sistrip::FED_ID_MAX, and sistrip::FED_ID_MIN.

Referenced by checkSummary(), and doDAQHeaderAndTrailerChecks().

1337  {
1338  return ((daqSourceID() >= FED_ID_MIN) && (daqSourceID() <= FED_ID_MAX));
1339  }
static const uint16_t FED_ID_MIN
static const uint16_t FED_ID_MAX

◆ checkSummary()

std::string sistrip::FEDBufferBase::checkSummary ( ) const
virtual

Reimplemented in sistrip::FEDBuffer.

Definition at line 1356 of file SiStripFEDBufferComponents.cc.

References checkBufferFormat(), checkCRC(), checkHeaderType(), checkLengthFromTrailer(), checkMajorityAddresses(), checkNoExtraHeadersOrTrailers(), checkNoFEOverflows(), checkNoSlinkCRCError(), checkNoSLinkTransmissionError(), checkNoUnexpectedSourceID(), checkReadoutMode(), checkSourceIDs(), feEnabled(), feOverflow(), sistrip::FEUNITS_PER_FED, majorityAddressErrorForFEUnit(), and edmLumisInFiles::summary.

Referenced by sistrip::FEDBuffer::checkSummary().

1356  {
1357  std::ostringstream summary;
1358  summary << "Check buffer type valid: " << (checkBufferFormat() ? "passed" : "FAILED") << std::endl;
1359  summary << "Check header format valid: " << (checkHeaderType() ? "passed" : "FAILED") << std::endl;
1360  summary << "Check readout mode valid: " << (checkReadoutMode() ? "passed" : "FAILED") << std::endl;
1361  //summary << "Check APVe address valid: " << ( checkAPVEAddressValid() ? "passed" : "FAILED" ) << std::endl;
1362  summary << "Check FE unit majority addresses: " << (checkMajorityAddresses() ? "passed" : "FAILED") << std::endl;
1363  if (!checkMajorityAddresses()) {
1364  summary << "FEs with majority address error: ";
1365  unsigned int badFEs = 0;
1366  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
1367  if (!feEnabled(iFE))
1368  continue;
1369  if (majorityAddressErrorForFEUnit(iFE)) {
1370  summary << uint16_t(iFE) << " ";
1371  badFEs++;
1372  }
1373  }
1374  summary << std::endl;
1375  summary << "Number of FE Units with bad addresses: " << badFEs << std::endl;
1376  }
1377  summary << "Check for FE unit buffer overflows: " << (checkNoFEOverflows() ? "passed" : "FAILED") << std::endl;
1378  if (!checkNoFEOverflows()) {
1379  summary << "FEs which overflowed: ";
1380  unsigned int badFEs = 0;
1381  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
1382  if (feOverflow(iFE)) {
1383  summary << uint16_t(iFE) << " ";
1384  badFEs++;
1385  }
1386  }
1387  summary << std::endl;
1388  summary << "Number of FE Units which overflowed: " << badFEs << std::endl;
1389  }
1390  summary << "Check for S-Link CRC errors: " << (checkNoSlinkCRCError() ? "passed" : "FAILED") << std::endl;
1391  summary << "Check for S-Link transmission error: " << (checkNoSLinkTransmissionError() ? "passed" : "FAILED")
1392  << std::endl;
1393  summary << "Check CRC: " << (checkCRC() ? "passed" : "FAILED") << std::endl;
1394  summary << "Check source ID is FED ID: " << (checkSourceIDs() ? "passed" : "FAILED") << std::endl;
1395  summary << "Check for unexpected source ID at FRL: " << (checkNoUnexpectedSourceID() ? "passed" : "FAILED")
1396  << std::endl;
1397  summary << "Check there are no extra headers or trailers: "
1398  << (checkNoExtraHeadersOrTrailers() ? "passed" : "FAILED") << std::endl;
1399  summary << "Check length from trailer: " << (checkLengthFromTrailer() ? "passed" : "FAILED") << std::endl;
1400  return summary.str();
1401  }
bool feOverflow(const uint8_t internalFEUnitNum) const
bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const
bool feEnabled(const uint8_t internalFEUnitNum) const
static const uint16_t FEUNITS_PER_FED

◆ daqBXID()

uint16_t sistrip::FEDBufferBase::daqBXID ( ) const
inline

Definition at line 1413 of file SiStripFEDBufferComponents.h.

References sistrip::FEDDAQHeader::bxID(), and daqHeader_.

Referenced by print().

◆ daqCRC()

uint16_t sistrip::FEDBufferBase::daqCRC ( ) const
inline

Definition at line 1421 of file SiStripFEDBufferComponents.h.

References sistrip::FEDDAQTrailer::crc(), and daqTrailer_.

Referenced by checkCRC().

◆ daqEventLengthIn64bitWords()

uint32_t sistrip::FEDBufferBase::daqEventLengthIn64bitWords ( ) const
inline

◆ daqEventLengthInBytes()

uint32_t sistrip::FEDBufferBase::daqEventLengthInBytes ( ) const
inline

◆ daqEventType()

FEDDAQEventType sistrip::FEDBufferBase::daqEventType ( ) const
inline

◆ daqHeader()

FEDDAQHeader sistrip::FEDBufferBase::daqHeader ( ) const
inline

Definition at line 1401 of file SiStripFEDBufferComponents.h.

References daqHeader_.

Referenced by sistrip::RawToDigiUnpacker::updateEventSummary().

1401 { return daqHeader_; }

◆ daqLvl1ID()

uint32_t sistrip::FEDBufferBase::daqLvl1ID ( ) const
inline

Definition at line 1411 of file SiStripFEDBufferComponents.h.

References daqHeader_, and sistrip::FEDDAQHeader::l1ID().

Referenced by print().

◆ daqSourceID()

uint16_t sistrip::FEDBufferBase::daqSourceID ( ) const
inline

Definition at line 1415 of file SiStripFEDBufferComponents.h.

References daqHeader_, and sistrip::FEDDAQHeader::sourceID().

Referenced by checkSourceIDs(), and print().

◆ daqTrailer()

FEDDAQTrailer sistrip::FEDBufferBase::daqTrailer ( ) const
inline

Definition at line 1403 of file SiStripFEDBufferComponents.h.

References daqTrailer_.

1403 { return daqTrailer_; }

◆ daqTTSState()

FEDTTSBits sistrip::FEDBufferBase::daqTTSState ( ) const
inline

Definition at line 1423 of file SiStripFEDBufferComponents.h.

References daqTrailer_, and sistrip::FEDDAQTrailer::ttsBits().

Referenced by print().

◆ doChecks()

bool sistrip::FEDBufferBase::doChecks ( ) const
inline

◆ doDAQHeaderAndTrailerChecks()

bool sistrip::FEDBufferBase::doDAQHeaderAndTrailerChecks ( ) const
inline

◆ doTrackerSpecialHeaderChecks()

bool sistrip::FEDBufferBase::doTrackerSpecialHeaderChecks ( ) const
inline

Definition at line 1517 of file SiStripFEDBufferComponents.h.

References checkBufferFormat(), checkHeaderType(), checkNoFEOverflows(), and checkReadoutMode().

Referenced by doChecks().

1517  {
1518  return (checkBufferFormat() && checkHeaderType() && checkReadoutMode() &&
1519  //checkAPVEAddressValid() &&
1520  checkNoFEOverflows());
1521  }

◆ dump()

void sistrip::FEDBufferBase::dump ( std::ostream &  os) const
inline

Definition at line 1395 of file SiStripFEDBufferComponents.h.

References bufferSize_, orderedBuffer_, and sistrip::printHex().

Referenced by sistrip::FEDSpyBuffer::delayChipGood().

void printHex(const void *pointer, const size_t length, std::ostream &os)

◆ dumpOriginalBuffer()

void sistrip::FEDBufferBase::dumpOriginalBuffer ( std::ostream &  os) const
inline

Definition at line 1397 of file SiStripFEDBufferComponents.h.

References bufferSize_, originalBuffer_, and sistrip::printHex().

void printHex(const void *pointer, const size_t length, std::ostream &os)

◆ fedStatusRegister()

FEDStatusRegister sistrip::FEDBufferBase::fedStatusRegister ( ) const
inline

◆ feEnabled()

bool sistrip::FEDBufferBase::feEnabled ( const uint8_t  internalFEUnitNum) const
inline

◆ feOverflow()

bool sistrip::FEDBufferBase::feOverflow ( const uint8_t  internalFEUnitNum) const
inline

Definition at line 1498 of file SiStripFEDBufferComponents.h.

References sistrip::TrackerSpecialHeader::feOverflow(), and specialHeader_.

Referenced by channelGood(), checkSummary(), sistrip::FEDBuffer::feGood(), and sistrip::FEDBuffer::feGoodWithoutAPVEmulatorCheck().

1498  {
1499  return specialHeader_.feOverflow(internalFEUnitNum);
1500  }
TrackerSpecialHeader specialHeader_
bool feOverflow(const uint8_t internalFEUnitNum) const

◆ getPointerToByteAfterEndOfPayload()

const uint8_t * sistrip::FEDBufferBase::getPointerToByteAfterEndOfPayload ( ) const
inlineprotected

Definition at line 1554 of file SiStripFEDBufferComponents.h.

References bufferSize_, and orderedBuffer_.

Referenced by sistrip::FEDBuffer::FEDBuffer().

1554  {
1555  return orderedBuffer_ + bufferSize_ - 8;
1556  }

◆ getPointerToDataAfterTrackerSpecialHeader()

const uint8_t * sistrip::FEDBufferBase::getPointerToDataAfterTrackerSpecialHeader ( ) const
inlineprotected

◆ headerType()

FEDHeaderType sistrip::FEDBufferBase::headerType ( ) const
inline

◆ init()

void sistrip::FEDBufferBase::init ( void  )
private

Definition at line 1262 of file SiStripFEDBufferComponents.cc.

References sistrip::BUFFER_FORMAT_NEW, sistrip::BUFFER_FORMAT_OLD_VME, sistrip::TrackerSpecialHeader::bufferFormat(), bufferFormat(), bufferSize_, daqHeader_, daqTrailer_, mps_fire::i, orderedBuffer_, originalBuffer_, and specialHeader_.

Referenced by FEDBufferBase().

1262  {
1263  //construct tracker special header using second 64 bit word
1264  specialHeader_ = TrackerSpecialHeader(originalBuffer_ + 8);
1265 
1266  //check the buffer format
1268  //swap the buffer words so that the whole buffer is in slink ordering
1270  uint8_t* newBuffer = new uint8_t[bufferSize_];
1271  const uint32_t* originalU32 = reinterpret_cast<const uint32_t*>(originalBuffer_);
1272  const size_t sizeU32 = bufferSize_ / 4;
1273  uint32_t* newU32 = reinterpret_cast<uint32_t*>(newBuffer);
1275  //swap whole buffer
1276  for (size_t i = 0; i < sizeU32; i += 2) {
1277  newU32[i] = originalU32[i + 1];
1278  newU32[i + 1] = originalU32[i];
1279  }
1280  }
1282  //copy DAQ header
1283  memcpy(newU32, originalU32, 8);
1284  //copy DAQ trailer
1285  memcpy(newU32 + sizeU32 - 2, originalU32 + sizeU32 - 2, 8);
1286  //swap the payload
1287  for (size_t i = 2; i < sizeU32 - 2; i += 2) {
1288  newU32[i] = originalU32[i + 1];
1289  newU32[i + 1] = originalU32[i];
1290  }
1291  }
1292  orderedBuffer_ = newBuffer;
1293  } //if ( (bufferFormat == BUFFER_FORMAT_OLD_VME) || (bufferFormat == BUFFER_FORMAT_NEW) )
1294  else {
1296  }
1297 
1298  //construct header object at begining of buffer
1299  daqHeader_ = FEDDAQHeader(orderedBuffer_);
1300  //construct trailer object using last 64 bit word of buffer
1301  daqTrailer_ = FEDDAQTrailer(orderedBuffer_ + bufferSize_ - 8);
1302  }
FEDBufferFormat bufferFormat() const
TrackerSpecialHeader specialHeader_

◆ legacyReadoutMode()

FEDLegacyReadoutMode sistrip::FEDBufferBase::legacyReadoutMode ( ) const
inline

Definition at line 1429 of file SiStripFEDBufferComponents.h.

References sistrip::TrackerSpecialHeader::legacyReadoutMode(), and specialHeader_.

Referenced by packetCode().

1429 { return specialHeader_.legacyReadoutMode(); }
FEDLegacyReadoutMode legacyReadoutMode() const
TrackerSpecialHeader specialHeader_

◆ majorityAddressErrorForFEUnit()

bool sistrip::FEDBufferBase::majorityAddressErrorForFEUnit ( const uint8_t  internalFEUnitNum) const
inline

◆ nFEUnitsEnabled()

uint8_t sistrip::FEDBufferBase::nFEUnitsEnabled ( ) const

Definition at line 1328 of file SiStripFEDBufferComponents.cc.

References feEnabled(), sistrip::FEUNITS_PER_FED, and mps_fire::result.

Referenced by print().

1328  {
1329  uint8_t result = 0;
1330  for (uint8_t iFE = 0; iFE < FEUNITS_PER_FED; iFE++) {
1331  if (feEnabled(iFE))
1332  result++;
1333  }
1334  return result;
1335  }
bool feEnabled(const uint8_t internalFEUnitNum) const
static const uint16_t FEUNITS_PER_FED

◆ packetCode()

uint8_t sistrip::FEDBufferBase::packetCode ( bool  legacy = false,
const uint8_t  internalFEDChannelNum = 0 
) const
inline

Definition at line 1437 of file SiStripFEDBufferComponents.h.

References channel(), sistrip::internalFEDChannelNum(), legacyReadoutMode(), ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, sistrip::PACKET_CODE_PROC_RAW, sistrip::PACKET_CODE_SCOPE, sistrip::PACKET_CODE_VIRGIN_RAW, sistrip::PACKET_CODE_ZERO_SUPPRESSED, sistrip::FEDChannel::packetCode(), sistrip::READOUT_MODE_INVALID, sistrip::READOUT_MODE_LEGACY_INVALID, sistrip::READOUT_MODE_LEGACY_PREMIX_RAW, sistrip::READOUT_MODE_LEGACY_PROC_RAW_FAKE, sistrip::READOUT_MODE_LEGACY_PROC_RAW_REAL, sistrip::READOUT_MODE_LEGACY_SCOPE, sistrip::READOUT_MODE_LEGACY_SPY, sistrip::READOUT_MODE_LEGACY_VIRGIN_RAW_FAKE, sistrip::READOUT_MODE_LEGACY_VIRGIN_RAW_REAL, sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_FAKE, sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_LITE_FAKE, sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_LITE_REAL, sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_REAL, sistrip::READOUT_MODE_PREMIX_RAW, sistrip::READOUT_MODE_PROC_RAW, sistrip::READOUT_MODE_SCOPE, sistrip::READOUT_MODE_SPY, sistrip::READOUT_MODE_VIRGIN_RAW, sistrip::READOUT_MODE_ZERO_SUPPRESSED, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT_CMOVERRIDE, and readoutMode().

Referenced by sistrip::FEDBuffer::checkChannelPacketCodes(), sistrip::FEDBuffer::checkSummary(), and sistrip::FEDBuffer::getCorrectPacketCode().

1437  {
1438  if (legacy) {
1440  switch (mode) {
1442  return PACKET_CODE_SCOPE;
1445  return PACKET_CODE_VIRGIN_RAW;
1448  return PACKET_CODE_PROC_RAW;
1457  default:
1458  return 0;
1459  }
1460  } else {
1462  switch (mode) {
1463  case READOUT_MODE_SCOPE:
1464  return PACKET_CODE_SCOPE;
1467  case READOUT_MODE_PROC_RAW:
1468  return PACKET_CODE_PROC_RAW;
1480  case READOUT_MODE_SPY:
1481  case READOUT_MODE_INVALID:
1482  default:
1483  return 0;
1484  }
1485  }
1486  }
FEDReadoutMode readoutMode() const
FEDLegacyReadoutMode legacyReadoutMode() const
static const uint8_t PACKET_CODE_SCOPE
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED
static const uint8_t PACKET_CODE_PROC_RAW
const FEDChannel & channel(const uint8_t internalFEDChannelNum) const
static const uint8_t PACKET_CODE_VIRGIN_RAW

◆ print()

void sistrip::FEDBufferBase::print ( std::ostream &  os) const
virtual

Reimplemented in sistrip::FEDBuffer, and sistrip::FEDSpyBuffer.

Definition at line 1310 of file SiStripFEDBufferComponents.cc.

References apveAddress(), bufferFormat(), bufferSize(), daqBXID(), daqEventLengthInBytes(), daqEventType(), daqLvl1ID(), daqSourceID(), daqTTSState(), fedStatusRegister(), headerType(), nFEUnitsEnabled(), sistrip::FEDStatusRegister::printFlags(), and readoutMode().

Referenced by sistrip::FEDSpyBuffer::print(), and sistrip::FEDBuffer::print().

1310  {
1311  os << "buffer format: " << bufferFormat() << std::endl;
1312  os << "Buffer size: " << bufferSize() << " bytes" << std::endl;
1313  os << "Event length from DAQ trailer: " << daqEventLengthInBytes() << " bytes" << std::endl;
1314  os << "Source ID: " << daqSourceID() << std::endl;
1315  os << "Header type: " << headerType() << std::endl;
1316  os << "Readout mode: " << readoutMode() << std::endl;
1317  os << "DAQ event type: " << daqEventType() << std::endl;
1318  os << "TTS state: " << daqTTSState() << std::endl;
1319  os << "L1 ID: " << daqLvl1ID() << std::endl;
1320  os << "BX ID: " << daqBXID() << std::endl;
1321  os << "FED status register flags: ";
1323  os << std::endl;
1324  os << "APVe Address: " << uint16_t(apveAddress()) << std::endl;
1325  os << "Enabled FE units: " << uint16_t(nFEUnitsEnabled()) << std::endl;
1326  }
FEDBufferFormat bufferFormat() const
FEDReadoutMode readoutMode() const
FEDDAQEventType daqEventType() const
void printFlags(std::ostream &os) const
FEDStatusRegister fedStatusRegister() const

◆ readoutMode()

FEDReadoutMode sistrip::FEDBufferBase::readoutMode ( ) const
inline

◆ sourceID()

uint16_t sistrip::FEDBufferBase::sourceID ( ) const

◆ trackerSpecialHeader()

TrackerSpecialHeader sistrip::FEDBufferBase::trackerSpecialHeader ( ) const
inline

Definition at line 1407 of file SiStripFEDBufferComponents.h.

References specialHeader_.

1407 { return specialHeader_; }
TrackerSpecialHeader specialHeader_

Member Data Documentation

◆ bufferSize_

const size_t sistrip::FEDBufferBase::bufferSize_
private

◆ channels_

std::vector<FEDChannel> sistrip::FEDBufferBase::channels_
protected

◆ daqHeader_

FEDDAQHeader sistrip::FEDBufferBase::daqHeader_
private

◆ daqTrailer_

FEDDAQTrailer sistrip::FEDBufferBase::daqTrailer_
private

◆ orderedBuffer_

const uint8_t* sistrip::FEDBufferBase::orderedBuffer_
private

◆ originalBuffer_

const uint8_t* sistrip::FEDBufferBase::originalBuffer_
private

Definition at line 734 of file SiStripFEDBufferComponents.h.

Referenced by dumpOriginalBuffer(), init(), and ~FEDBufferBase().

◆ specialHeader_

TrackerSpecialHeader sistrip::FEDBufferBase::specialHeader_
private