CMS 3D CMS Logo

Namespaces | Enumerations | Functions
sistrip::fedchannelunpacker Namespace Reference

Namespaces

 detail
 

Enumerations

enum  StatusCode {
  StatusCode::SUCCESS = 0, StatusCode::BAD_CHANNEL_LENGTH, StatusCode::UNORDERED_DATA, StatusCode::BAD_PACKET_CODE,
  StatusCode::ZERO_PACKET_CODE
}
 

Functions

bool isNonLiteZS (FEDReadoutMode mode, bool legacy=false, FEDLegacyReadoutMode lmode=READOUT_MODE_LEGACY_INVALID)
 
bool isProcessedRaw (FEDReadoutMode mode, bool legacy=false, FEDLegacyReadoutMode lmode=READOUT_MODE_LEGACY_INVALID)
 
bool isScopeMode (FEDReadoutMode mode, bool legacy=false, FEDLegacyReadoutMode lmode=READOUT_MODE_LEGACY_INVALID)
 
bool isVirginRaw (FEDReadoutMode mode, bool legacy=false, FEDLegacyReadoutMode lmode=READOUT_MODE_LEGACY_INVALID)
 
bool isZeroSuppressed (FEDReadoutMode mode, bool legacy=false, FEDLegacyReadoutMode lmode=READOUT_MODE_LEGACY_INVALID)
 
template<typename OUT >
StatusCode unpackProcessedRaw (const FEDChannel &channel, OUT &&out)
 
template<typename OUT >
StatusCode unpackScope (const FEDChannel &channel, OUT &&out)
 
template<typename OUT >
StatusCode unpackVirginRaw (const FEDChannel &channel, OUT &&out, uint8_t packetCode)
 
template<typename OUT >
StatusCode unpackZeroSuppressed (const FEDChannel &channel, OUT &&out, uint16_t stripStart, bool isNonLite, FEDReadoutMode mode, bool legacy=false, FEDLegacyReadoutMode lmode=READOUT_MODE_LEGACY_INVALID, uint8_t packetCode=0)
 

Enumeration Type Documentation

◆ StatusCode

Function Documentation

◆ isNonLiteZS()

bool sistrip::fedchannelunpacker::isNonLiteZS ( FEDReadoutMode  mode,
bool  legacy = false,
FEDLegacyReadoutMode  lmode = READOUT_MODE_LEGACY_INVALID 
)
inline

◆ isProcessedRaw()

bool sistrip::fedchannelunpacker::isProcessedRaw ( FEDReadoutMode  mode,
bool  legacy = false,
FEDLegacyReadoutMode  lmode = READOUT_MODE_LEGACY_INVALID 
)
inline

◆ isScopeMode()

bool sistrip::fedchannelunpacker::isScopeMode ( FEDReadoutMode  mode,
bool  legacy = false,
FEDLegacyReadoutMode  lmode = READOUT_MODE_LEGACY_INVALID 
)
inline

◆ isVirginRaw()

bool sistrip::fedchannelunpacker::isVirginRaw ( FEDReadoutMode  mode,
bool  legacy = false,
FEDLegacyReadoutMode  lmode = READOUT_MODE_LEGACY_INVALID 
)
inline

◆ isZeroSuppressed()

bool sistrip::fedchannelunpacker::isZeroSuppressed ( FEDReadoutMode  mode,
bool  legacy = false,
FEDLegacyReadoutMode  lmode = READOUT_MODE_LEGACY_INVALID 
)
inline

Definition at line 357 of file SiStripFEDBuffer.h.

References ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, sistrip::READOUT_MODE_LEGACY_PREMIX_RAW, 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_ZERO_SUPPRESSED, sistrip::READOUT_MODE_ZERO_SUPPRESSED_FAKE, 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, and sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT_CMOVERRIDE.

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

359  {
360  if (!legacy) {
361  switch (mode) {
373  return true;
374  break;
375  default:
376  return false;
377  }
378  } else {
379  switch (lmode) {
385  return true;
386  default:
387  return false;
388  }
389  }
390  }

◆ unpackProcessedRaw()

template<typename OUT >
StatusCode sistrip::fedchannelunpacker::unpackProcessedRaw ( const FEDChannel channel,
OUT &&  out 
)

Definition at line 421 of file SiStripFEDBuffer.h.

References MillePedeFileConverter_cfg::out.

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

421  {
422  return detail::unpackRawW<16>(channel, out);
423  }

◆ unpackScope()

template<typename OUT >
StatusCode sistrip::fedchannelunpacker::unpackScope ( const FEDChannel channel,
OUT &&  out 
)

Definition at line 417 of file SiStripFEDBuffer.h.

References MillePedeFileConverter_cfg::out.

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

417  {
418  return detail::unpackRawW<16>(channel, out);
419  }

◆ unpackVirginRaw()

template<typename OUT >
StatusCode sistrip::fedchannelunpacker::unpackVirginRaw ( const FEDChannel channel,
OUT &&  out,
uint8_t  packetCode 
)

Definition at line 426 of file SiStripFEDBuffer.h.

References mps_fire::i, sistrip::FEDChannel::length(), MillePedeFileConverter_cfg::out, sistrip::PACKET_CODE_VIRGIN_RAW, sistrip::PACKET_CODE_VIRGIN_RAW10, sistrip::PACKET_CODE_VIRGIN_RAW8_BOTBOT, sistrip::PACKET_CODE_VIRGIN_RAW8_TOPBOT, sistrip::fedchannelunpacker::detail::readoutOrder(), EgammaValidation_cff::samples, and SUCCESS.

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

426  {
427  std::vector<SiStripRawDigi> samples;
428  auto st = StatusCode::SUCCESS;
429  if (PACKET_CODE_VIRGIN_RAW == packetCode) {
430  samples.reserve((channel.length() - 3) / 2);
431  st = detail::unpackRawW<16>(channel, std::back_inserter(samples));
432  } else if (PACKET_CODE_VIRGIN_RAW10 == packetCode) {
433  samples.reserve((channel.length() - 3) * 10 / 8);
434  st = detail::unpackRawB<10>(channel, std::back_inserter(samples));
435  } else if (PACKET_CODE_VIRGIN_RAW8_BOTBOT == packetCode || PACKET_CODE_VIRGIN_RAW8_TOPBOT == packetCode) {
436  samples.reserve(channel.length() - 3);
437  st = detail::unpackRawW<8>(
438  channel, std::back_inserter(samples), (PACKET_CODE_VIRGIN_RAW8_BOTBOT == packetCode ? 2 : 1));
439  }
440  if (!samples.empty()) { // reorder
441  for (uint_fast16_t i{0}; i != samples.size(); ++i) {
442  const auto physical = i % 128;
443  const auto readout = (detail::readoutOrder(physical) * 2 // convert index from physical to readout order
444  + (i >= 128 ? 1 : 0)); // un-multiplex data
445  *out++ = samples[readout];
446  }
447  }
448  return st;
449  }
successful classification
static const uint8_t PACKET_CODE_VIRGIN_RAW10
static const uint8_t PACKET_CODE_VIRGIN_RAW8_TOPBOT
static const uint8_t PACKET_CODE_VIRGIN_RAW8_BOTBOT
uint16_t readoutOrder(uint16_t physical_order)
static const uint8_t PACKET_CODE_VIRGIN_RAW

◆ unpackZeroSuppressed()

template<typename OUT >
StatusCode sistrip::fedchannelunpacker::unpackZeroSuppressed ( const FEDChannel channel,
OUT &&  out,
uint16_t  stripStart,
bool  isNonLite,
FEDReadoutMode  mode,
bool  legacy = false,
FEDLegacyReadoutMode  lmode = READOUT_MODE_LEGACY_INVALID,
uint8_t  packetCode = 0 
)

Definition at line 451 of file SiStripFEDBuffer.h.

References ALCARECOPromptCalibProdSiPixelAli0T_cff::mode, MillePedeFileConverter_cfg::out, sistrip::PACKET_CODE_ZERO_SUPPRESSED10, sistrip::PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT, sistrip::PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT, sistrip::READOUT_MODE_LEGACY_PREMIX_RAW, sistrip::READOUT_MODE_PREMIX_RAW, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT_CMOVERRIDE, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT, sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT_CMOVERRIDE, SUCCESS, and ZERO_PACKET_CODE.

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

458  {
459  if ((isNonLite && packetCode == PACKET_CODE_ZERO_SUPPRESSED10) ||
460  ((!legacy) &&
462  return detail::unpackZSB<10>(channel, out, (isNonLite ? 7 : 2), stripStart);
463  } else if ((!legacy) ? mode == READOUT_MODE_PREMIX_RAW : lmode == READOUT_MODE_LEGACY_PREMIX_RAW) {
464  return detail::unpackZSW<16>(channel, out, 7, stripStart);
465  } else { // 8bit
466  uint8_t bits_shift = 0;
467  if (isNonLite) {
468  if (packetCode == PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT)
469  bits_shift = 1;
470  else if (packetCode == PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT)
471  bits_shift = 2;
472  } else { // lite
475  bits_shift = 1;
478  bits_shift = 2;
479  }
480  auto st = detail::unpackZSW<8>(channel, out, (isNonLite ? 7 : 2), stripStart, bits_shift);
481  if (isNonLite && packetCode == 0 && StatusCode::SUCCESS == st) {
482  // workaround for a pre-2015 bug in the packer: assume default ZS packing
483  return StatusCode::ZERO_PACKET_CODE;
484  }
485  return st;
486  }
487  }
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT
successful classification
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED10