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

Enumerator
SUCCESS 
BAD_CHANNEL_LENGTH 
UNORDERED_DATA 
BAD_PACKET_CODE 
ZERO_PACKET_CODE 

Definition at line 192 of file SiStripFEDBuffer.h.

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.

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  }

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().

◆ unpackProcessedRaw()

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

Definition at line 421 of file SiStripFEDBuffer.h.

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

References MillePedeFileConverter_cfg::out.

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

◆ unpackScope()

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

Definition at line 417 of file SiStripFEDBuffer.h.

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

References MillePedeFileConverter_cfg::out.

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

◆ unpackVirginRaw()

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

Definition at line 426 of file SiStripFEDBuffer.h.

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  }

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().

◆ 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.

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  }

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().

mps_fire.i
i
Definition: mps_fire.py:428
sistrip::READOUT_MODE_PREMIX_RAW
Definition: SiStripFEDBufferComponents.h:61
sistrip::fedchannelunpacker::StatusCode::BAD_CHANNEL_LENGTH
sistrip::READOUT_MODE_LEGACY_PREMIX_RAW
Definition: SiStripFEDBufferComponents.h:76
sistrip::READOUT_MODE_LEGACY_PROC_RAW_FAKE
Definition: SiStripFEDBufferComponents.h:70
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
sistrip::fedchannelunpacker::StatusCode::UNORDERED_DATA
Phase2Tracker::READOUT_MODE_VIRGIN_RAW
Definition: utils.h:98
sistrip::PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT
Definition: SiStripFEDBufferComponents.h:91
sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_LITE_REAL
Definition: SiStripFEDBufferComponents.h:73
Phase2Tracker::READOUT_MODE_ZERO_SUPPRESSED
Definition: utils.h:100
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT
Definition: SiStripFEDBufferComponents.h:51
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:50
EgammaValidation_cff.samples
samples
Definition: EgammaValidation_cff.py:19
Phase2Tracker::READOUT_MODE_PROC_RAW
Definition: utils.h:99
sistrip::READOUT_MODE_LEGACY_VIRGIN_RAW_FAKE
Definition: SiStripFEDBufferComponents.h:68
Phase2Tracker::READOUT_MODE_SCOPE
Definition: utils.h:97
sistrip::READOUT_MODE_LEGACY_VIRGIN_RAW_REAL
Definition: SiStripFEDBufferComponents.h:67
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8
Definition: SiStripFEDBufferComponents.h:58
sistrip::PACKET_CODE_VIRGIN_RAW10
static const uint8_t PACKET_CODE_VIRGIN_RAW10
Definition: SiStripFEDBufferComponents.h:81
sistrip::PACKET_CODE_ZERO_SUPPRESSED10
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED10
Definition: SiStripFEDBufferComponents.h:89
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:59
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10
Definition: SiStripFEDBufferComponents.h:49
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:53
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT
Definition: SiStripFEDBufferComponents.h:55
sistrip::PACKET_CODE_VIRGIN_RAW8_BOTBOT
static const uint8_t PACKET_CODE_VIRGIN_RAW8_BOTBOT
Definition: SiStripFEDBufferComponents.h:82
sistrip::fedchannelunpacker::detail::readoutOrder
uint16_t readoutOrder(uint16_t physical_order)
Definition: SiStripFEDBuffer.h:351
sistrip::PACKET_CODE_VIRGIN_RAW8_TOPBOT
static const uint8_t PACKET_CODE_VIRGIN_RAW8_TOPBOT
Definition: SiStripFEDBufferComponents.h:83
sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_LITE_FAKE
Definition: SiStripFEDBufferComponents.h:74
sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_FAKE
Definition: SiStripFEDBufferComponents.h:72
sistrip::fedchannelunpacker::StatusCode::BAD_PACKET_CODE
sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_REAL
Definition: SiStripFEDBufferComponents.h:71
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
sistrip::READOUT_MODE_LEGACY_PROC_RAW_REAL
Definition: SiStripFEDBufferComponents.h:69
sistrip::PACKET_CODE_VIRGIN_RAW
static const uint8_t PACKET_CODE_VIRGIN_RAW
Definition: SiStripFEDBufferComponents.h:80
sistrip::fedchannelunpacker::StatusCode::ZERO_PACKET_CODE
HTXS::SUCCESS
successful classification
Definition: HiggsTemplateCrossSections.h:13
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:54
sistrip::READOUT_MODE_LEGACY_SCOPE
Definition: SiStripFEDBufferComponents.h:66
sistrip::READOUT_MODE_ZERO_SUPPRESSED_FAKE
Definition: SiStripFEDBufferComponents.h:57
sistrip::PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT
Definition: SiStripFEDBufferComponents.h:90