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 176 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 341 of file SiStripFEDBuffer.h.

343  {
344  if (!legacy) {
345  switch (mode) {
357  return true;
358  break;
359  default:
360  return false;
361  }
362  } else {
363  switch (lmode) {
369  return true;
370  default:
371  return false;
372  }
373  }
374  }

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 405 of file SiStripFEDBuffer.h.

405  {
406  return detail::unpackRawW<16>(channel, out);
407  }

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 401 of file SiStripFEDBuffer.h.

401  {
402  return detail::unpackRawW<16>(channel, out);
403  }

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 410 of file SiStripFEDBuffer.h.

410  {
411  std::vector<SiStripRawDigi> samples;
412  auto st = StatusCode::SUCCESS;
413  if (PACKET_CODE_VIRGIN_RAW == packetCode) {
414  samples.reserve((channel.length() - 3) / 2);
415  st = detail::unpackRawW<16>(channel, std::back_inserter(samples));
416  } else if (PACKET_CODE_VIRGIN_RAW10 == packetCode) {
417  samples.reserve((channel.length() - 3) * 10 / 8);
418  st = detail::unpackRawB<10>(channel, std::back_inserter(samples));
419  } else if (PACKET_CODE_VIRGIN_RAW8_BOTBOT == packetCode || PACKET_CODE_VIRGIN_RAW8_TOPBOT == packetCode) {
420  samples.reserve(channel.length() - 3);
421  st = detail::unpackRawW<8>(
422  channel, std::back_inserter(samples), (PACKET_CODE_VIRGIN_RAW8_BOTBOT == packetCode ? 2 : 1));
423  }
424  if (!samples.empty()) { // reorder
425  for (uint_fast16_t i{0}; i != samples.size(); ++i) {
426  const auto physical = i % 128;
427  const auto readout = (detail::readoutOrder(physical) * 2 // convert index from physical to readout order
428  + (i >= 128 ? 1 : 0)); // un-multiplex data
429  *out++ = samples[readout];
430  }
431  }
432  return st;
433  }

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 435 of file SiStripFEDBuffer.h.

442  {
443  if ((isNonLite && packetCode == PACKET_CODE_ZERO_SUPPRESSED10) ||
444  ((!legacy) &&
446  return detail::unpackZSB<10>(channel, out, (isNonLite ? 7 : 2), stripStart);
447  } else if ((!legacy) ? mode == READOUT_MODE_PREMIX_RAW : lmode == READOUT_MODE_LEGACY_PREMIX_RAW) {
448  return detail::unpackZSW<16>(channel, out, 7, stripStart);
449  } else { // 8bit
450  uint8_t bits_shift = 0;
451  if (isNonLite) {
452  if (packetCode == PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT)
453  bits_shift = 1;
454  else if (packetCode == PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT)
455  bits_shift = 2;
456  } else { // lite
459  bits_shift = 1;
462  bits_shift = 2;
463  }
464  auto st = detail::unpackZSW<8>(channel, out, (isNonLite ? 7 : 2), stripStart, bits_shift);
465  if (isNonLite && packetCode == 0 && StatusCode::SUCCESS == st) {
466  // workaround for a pre-2015 bug in the packer: assume default ZS packing
467  return StatusCode::ZERO_PACKET_CODE;
468  }
469  return st;
470  }
471  }

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:355
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:335
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