CMS 3D CMS Logo

SiStripFEDBuffer.h
Go to the documentation of this file.
1 #ifndef EventFilter_SiStripRawToDigi_SiStripFEDBuffer_H
2 #define EventFilter_SiStripRawToDigi_SiStripFEDBuffer_H
3 
4 #include <string>
5 #include <vector>
6 #include <memory>
7 #include <ostream>
8 #include <cstring>
9 #include <cmath>
13 
14 #include <cstdint>
15 
16 namespace sistrip {
17  constexpr uint16_t BITS_PER_BYTE = 8;
18 
19  //
20  // Class definitions
21  //
22 
23  //class representing standard (non-spy channel) FED buffers
24  class FEDBuffer final : public FEDBufferBase {
25  public:
41  explicit FEDBuffer(const FEDRawData& fedBuffer, const bool allowBadBuffer = false);
42  ~FEDBuffer() override;
43 
55 
56  void print(std::ostream& os) const override;
57  const FEDFEHeader* feHeader() const;
58  //check that a FE unit is enabled, has a good majority address and, if in full debug mode, that it is present
59  bool feGood(const uint8_t internalFEUnitNum) const;
60  bool feGoodWithoutAPVEmulatorCheck(const uint8_t internalFEUnitNum) const;
61  //check that a FE unit is present in the data.
62  //The high order byte of the FEDStatus register in the tracker special header is used in APV error mode.
63  //The FE length from the full debug header is used in full debug mode.
64  bool fePresent(uint8_t internalFEUnitNum) const;
65  //check that a channel is present in data, found, on a good FE unit and has no errors flagged in status bits
67  virtual bool channelGood(const uint8_t internalFEDannelNum, const bool doAPVeCheck = true) const;
68  void setLegacyMode(bool legacy) { legacyUnpacker_ = legacy; }
69 
70  //functions to check buffer. All return true if there is no problem.
71  //minimum checks to do before using buffer
73  virtual bool doChecks(bool doCRC = true) const;
74 
75  //additional checks to check for corrupt buffers
76  //check channel lengths fit inside to buffer length
77  bool checkChannelLengths() const;
78  //check that channel lengths add up to buffer length (this does the previous check as well)
80  //check channel packet codes match readout mode
81  bool checkChannelPacketCodes() const;
82  //check FE unit lengths in FULL DEBUG header match the lengths of their channels
83  bool checkFEUnitLengths() const;
84  //check FE unit APV addresses in FULL DEBUG header are equal to the APVe address if the majority was good
85  bool checkFEUnitAPVAddresses() const;
86  //do all corrupt buffer checks
87  virtual bool doCorruptBufferChecks() const;
88 
89  //check that there are no errors in channel, APV or FEUnit status bits
90  //these are done by channelGood(). Channels with bad status bits may be disabled so bad status bits do not usually indicate an error
91  bool checkStatusBits(const uint8_t internalFEDChannelNum) const;
92  bool checkStatusBits(const uint8_t internalFEUnitNum, const uint8_t internalChannelNum) const;
93  //same but for all channels on enabled FE units
94  bool checkAllChannelStatusBits() const;
95 
96  //check that all FE unit payloads are present
97  bool checkFEPayloadsPresent() const;
98 
99  //print a summary of all checks
100  std::string checkSummary() const override;
101 
102  private:
103  uint8_t nFEUnitsPresent() const;
104  inline uint8_t getCorrectPacketCode() const { return packetCode(legacyUnpacker_); }
105  uint16_t calculateFEUnitLength(const uint8_t internalFEUnitNumber) const;
106  std::unique_ptr<FEDFEHeader> feHeader_;
107  const uint8_t* payloadPointer_;
108  uint16_t payloadLength_;
109  uint8_t validChannels_;
111  bool legacyUnpacker_ = false;
112  };
113 
114  //
115  // Inline function definitions
116  //
117 
131  inline FEDBufferStatusCode preconstructCheckFEDBuffer(const FEDRawData& fedBuffer, bool allowBadBuffer = false) {
132  const auto st_base = preconstructCheckFEDBufferBase(fedBuffer, !allowBadBuffer);
133  if (FEDBufferStatusCode::SUCCESS != st_base)
134  return st_base;
135  const TrackerSpecialHeader hdr{fedBuffer.data() + 8};
136  const auto hdr_type = hdr.headerType();
137  if ((!allowBadBuffer) && ((hdr_type == sistrip::HEADER_TYPE_INVALID) || (hdr_type == sistrip::HEADER_TYPE_NONE))) {
138 #ifdef EDM_ML_DEBUG
139  std::ostringstream msg;
140  msg << "Header type is invalid. Header type nibble is ";
141  const auto headerTypeNibble = hdr.headerTypeNibble();
142  printHex(&headerTypeNibble, 1, msg);
143  LogDebug("FEDBuffer") << msg.str();
144 #endif
146  }
147  if (READOUT_MODE_SPY == hdr.readoutMode())
150  }
151 
152  //FEDBuffer
153 
154  inline const FEDFEHeader* FEDBuffer::feHeader() const { return feHeader_.get(); }
155 
156  inline bool FEDBuffer::feGood(const uint8_t internalFEUnitNum) const {
157  return (!majorityAddressErrorForFEUnit(internalFEUnitNum) && !feOverflow(internalFEUnitNum) &&
158  fePresent(internalFEUnitNum));
159  }
160 
161  inline bool FEDBuffer::feGoodWithoutAPVEmulatorCheck(const uint8_t internalFEUnitNum) const {
162  return (!feOverflow(internalFEUnitNum) && fePresent(internalFEUnitNum));
163  }
164 
165  inline bool FEDBuffer::fePresent(uint8_t internalFEUnitNum) const { return fePresent_[internalFEUnitNum]; }
166 
167  inline bool FEDBuffer::checkStatusBits(const uint8_t internalFEDChannelNum) const {
168  return feHeader_->checkChannelStatusBits(internalFEDChannelNum);
169  }
170 
171  inline bool FEDBuffer::checkStatusBits(const uint8_t internalFEUnitNum, const uint8_t internalChannelNum) const {
172  return checkStatusBits(internalFEDChannelNum(internalFEUnitNum, internalChannelNum));
173  }
174 
175  namespace fedchannelunpacker {
177 
178  namespace detail {
179 
180  template <uint8_t num_words>
181  uint16_t getADC_W(const uint8_t* data, uint_fast16_t offset, uint8_t bits_shift) {
182  // get ADC from one or two bytes (at most 10 bits), and shift if needed
183  return (data[offset ^ 7] + (num_words == 2 ? ((data[(offset + 1) ^ 7] & 0x03) << 8) : 0)) << bits_shift;
184  }
185 
186  template <uint16_t mask>
187  uint16_t getADC_B2(const uint8_t* data, uint_fast16_t wOffset, uint_fast8_t bOffset) {
188  // get ADC from two bytes, from wOffset until bOffset bits from the next byte (maximum decided by mask)
189  return (((data[wOffset ^ 7]) << bOffset) + (data[(wOffset + 1) ^ 7] >> (BITS_PER_BYTE - bOffset))) & mask;
190  }
191  template <uint16_t mask>
192  uint16_t getADC_B1(const uint8_t* data, uint_fast16_t wOffset, uint_fast8_t bOffset) {
193  // get ADC from one byte, until bOffset into the byte at wOffset (maximum decided by mask)
194  return (data[wOffset ^ 7] >> (BITS_PER_BYTE - bOffset)) & mask;
195  }
196 
197  // Unpack Raw with ADCs in whole 8-bit words (8bit and 10-in-16bit)
198  template <uint8_t num_bits, typename OUT>
199  StatusCode unpackRawW(const FEDChannel& channel, OUT&& out, uint8_t bits_shift = 0) {
200  constexpr auto num_words = num_bits / 8;
201  static_assert(((num_bits % 8) == 0) && (num_words > 0) && (num_words < 3));
202  if ((num_words > 1) && ((channel.length() - 3) % num_words)) {
203  LogDebug("FEDBuffer") << "Channel length is invalid. Raw channels have 3 header bytes and " << num_words
204  << " bytes per sample. "
205  << "Channel length is " << uint16_t(channel.length()) << ".";
207  }
208  const uint8_t* const data = channel.data();
209  const uint_fast16_t end = channel.offset() + channel.length();
210  for (uint_fast16_t offset = channel.offset() + 3; offset != end; offset += num_words) {
211  *out++ = SiStripRawDigi(getADC_W<num_words>(data, offset, bits_shift));
212  }
213  return StatusCode::SUCCESS;
214  }
215 
216  // Generic implementation for non-whole words (10bit, essentially)
217  template <uint_fast8_t num_bits, typename OUT>
218  StatusCode unpackRawB(const FEDChannel& channel, OUT&& out) {
219  static_assert(num_bits <= 16, "Word length must be between 0 and 16.");
220  if (channel.length() & 0xF000) {
221  LogDebug("FEDBuffer") << "Channel length is invalid. Channel length is " << uint16_t(channel.length()) << ".";
223  }
224  constexpr uint16_t mask = (1 << num_bits) - 1;
225  const uint8_t* const data = channel.data();
226  const uint_fast16_t chEnd = channel.offset() + channel.length();
227  uint_fast16_t wOffset = channel.offset() + 3;
228  uint_fast8_t bOffset = 0;
229  while (((wOffset + 1) < chEnd) || ((chEnd - wOffset) * BITS_PER_BYTE - bOffset >= num_bits)) {
230  bOffset += num_bits;
231  if ((num_bits > BITS_PER_BYTE) || (bOffset > BITS_PER_BYTE)) {
232  bOffset -= BITS_PER_BYTE;
233  **out++ = SiStripRawDigi(getADC_B2<mask>(data, wOffset, bOffset));
234  ++wOffset;
235  } else {
236  **out++ = SiStripRawDigi(getADC_B1<mask>(data, wOffset, bOffset));
237  }
238  if (bOffset == BITS_PER_BYTE) {
239  bOffset = 0;
240  ++wOffset;
241  }
242  }
243  return StatusCode::SUCCESS;
244  }
245 
246  template <uint8_t num_bits, typename OUT>
248  const FEDChannel& channel, OUT&& out, uint8_t headerLength, uint16_t stripStart, uint8_t bits_shift = 0) {
249  constexpr auto num_words = num_bits / 8;
250  static_assert(((num_bits % 8) == 0) && (num_words > 0) && (num_words < 3));
251  if (channel.length() & 0xF000) {
252  LogDebug("FEDBuffer") << "Channel length is invalid. Channel length is " << uint16_t(channel.length()) << ".";
254  }
255  const uint8_t* const data = channel.data();
256  uint_fast16_t offset = channel.offset() + headerLength; // header is 2 (lite) or 7
257  uint_fast8_t firstStrip{0}, nInCluster{0}, inCluster{0};
258  const uint_fast16_t end = channel.offset() + channel.length();
259  while (offset != end) {
260  if (inCluster == nInCluster) {
261  if (offset + 2 >= end) {
262  // offset should already be at end then (empty cluster)
263  break;
264  }
265  const uint_fast8_t newFirstStrip = data[(offset++) ^ 7];
266  if (newFirstStrip < (firstStrip + inCluster)) {
267  LogDebug("FEDBuffer") << "First strip of new cluster is not greater than last strip of previous cluster. "
268  << "Last strip of previous cluster is " << uint16_t(firstStrip + inCluster) << ". "
269  << "First strip of new cluster is " << uint16_t(newFirstStrip) << ".";
271  }
272  firstStrip = newFirstStrip;
273  nInCluster = data[(offset++) ^ 7];
274  inCluster = 0;
275  }
276  *out++ = SiStripDigi(stripStart + firstStrip + inCluster, getADC_W<num_words>(data, offset, bits_shift));
277  offset += num_words;
278  ++inCluster;
279  }
280  return StatusCode::SUCCESS;
281  }
282 
283  // Generic implementation (for 10bit, essentially)
284  template <uint_fast8_t num_bits, typename OUT>
285  StatusCode unpackZSB(const FEDChannel& channel, OUT&& out, uint8_t headerLength, uint16_t stripStart) {
286  constexpr uint16_t mask = (1 << num_bits) - 1;
287  if (channel.length() & 0xF000) {
288  LogDebug("FEDBuffer") << "Channel length is invalid. Channel length is " << uint16_t(channel.length()) << ".";
290  }
291  const uint8_t* const data = channel.data();
292  uint_fast16_t wOffset = channel.offset() + headerLength; // header is 2 (lite) or 7
293  uint_fast8_t bOffset{0}, firstStrip{0}, nInCluster{0}, inCluster{0};
294  const uint_fast16_t chEnd = channel.offset() + channel.length();
295  while (((wOffset + 1) < chEnd) ||
296  ((inCluster != nInCluster) && ((chEnd - wOffset) * BITS_PER_BYTE - bOffset >= num_bits))) {
297  if (inCluster == nInCluster) {
298  if (wOffset + 2 >= chEnd) {
299  // offset should already be at end then (empty cluster)
300  break;
301  }
302  if (bOffset) {
303  ++wOffset;
304  bOffset = 0;
305  }
306  const uint_fast8_t newFirstStrip = data[(wOffset++) ^ 7];
307  if (newFirstStrip < (firstStrip + inCluster)) {
308  LogDebug("FEDBuffer") << "First strip of new cluster is not greater than last strip of previous cluster. "
309  << "Last strip of previous cluster is " << uint16_t(firstStrip + inCluster) << ". "
310  << "First strip of new cluster is " << uint16_t(newFirstStrip) << ".";
312  }
313  firstStrip = newFirstStrip;
314  nInCluster = data[(wOffset++) ^ 7];
315  inCluster = 0;
316  bOffset = 0;
317  }
318  bOffset += num_bits;
319  if ((num_bits > BITS_PER_BYTE) || (bOffset > BITS_PER_BYTE)) {
320  bOffset -= BITS_PER_BYTE;
321  *out++ = SiStripDigi(stripStart + firstStrip + inCluster, getADC_B2<mask>(data, wOffset, bOffset));
322  ++wOffset;
323  } else {
324  *out++ = SiStripDigi(stripStart + firstStrip + inCluster, getADC_B1<mask>(data, wOffset, bOffset));
325  }
326  ++inCluster;
327  if (bOffset == BITS_PER_BYTE) {
328  bOffset = 0;
329  ++wOffset;
330  }
331  }
332  return StatusCode::SUCCESS;
333  }
334 
335  inline uint16_t readoutOrder(uint16_t physical_order) {
336  return (4 * ((static_cast<uint16_t>((static_cast<float>(physical_order) / 8.0))) % 4) +
337  static_cast<uint16_t>(static_cast<float>(physical_order) / 32.0) + 16 * (physical_order % 8));
338  }
339  }; // namespace detail
340 
342  bool legacy = false,
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  }
376  bool legacy = false,
381  }
383  bool legacy = false,
385  return (!legacy) ? mode == READOUT_MODE_VIRGIN_RAW
387  }
389  bool legacy = false,
391  return (!legacy) ? mode == READOUT_MODE_PROC_RAW
393  }
395  bool legacy = false,
397  return (!legacy) ? mode == READOUT_MODE_SCOPE : lmode == READOUT_MODE_LEGACY_SCOPE;
398  }
399 
400  template <typename OUT>
401  StatusCode unpackScope(const FEDChannel& channel, OUT&& out) {
402  return detail::unpackRawW<16>(channel, out);
403  }
404  template <typename OUT>
406  return detail::unpackRawW<16>(channel, out);
407  }
408 
409  template <typename OUT>
410  StatusCode unpackVirginRaw(const FEDChannel& channel, OUT&& out, uint8_t packetCode) {
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  }
434  template <typename OUT>
436  OUT&& out,
437  uint16_t stripStart,
438  bool isNonLite,
440  bool legacy = false,
442  uint8_t packetCode = 0) {
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
468  }
469  return st;
470  }
471  }
472  }; // namespace fedchannelunpacker
474 } // namespace sistrip
475 
476 #endif //ndef EventFilter_SiStripRawToDigi_SiStripFEDBuffer_H
sistrip::FEDBuffer::payloadLength_
uint16_t payloadLength_
Definition: SiStripFEDBuffer.h:108
sistrip::fedchannelunpacker::isVirginRaw
bool isVirginRaw(FEDReadoutMode mode, bool legacy=false, FEDLegacyReadoutMode lmode=READOUT_MODE_LEGACY_INVALID)
Definition: SiStripFEDBuffer.h:382
sistrip::fedchannelunpacker::StatusCode::SUCCESS
sistrip::FEDBuffer::getCorrectPacketCode
uint8_t getCorrectPacketCode() const
Definition: SiStripFEDBuffer.h:104
sistrip::FEDBuffer::legacyUnpacker_
bool legacyUnpacker_
Definition: SiStripFEDBuffer.h:111
mps_fire.i
i
Definition: mps_fire.py:355
sistrip::FEDBuffer::feGood
bool feGood(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBuffer.h:156
sistrip::READOUT_MODE_PREMIX_RAW
Definition: SiStripFEDBufferComponents.h:61
sistrip::FEDChannel::offset
size_t offset() const
Definition: SiStripFEDBufferComponents.h:1577
sistrip::fedchannelunpacker::detail::unpackRawB
StatusCode unpackRawB(const FEDChannel &channel, OUT &&out)
Definition: SiStripFEDBuffer.h:218
sistrip::fedchannelunpacker::StatusCode::BAD_CHANNEL_LENGTH
sistrip::READOUT_MODE_LEGACY_PREMIX_RAW
Definition: SiStripFEDBufferComponents.h:76
sistrip::FEDBuffer::print
void print(std::ostream &os) const override
Definition: SiStripFEDBuffer.cc:402
sistrip::fedchannelunpacker::isNonLiteZS
bool isNonLiteZS(FEDReadoutMode mode, bool legacy=false, FEDLegacyReadoutMode lmode=READOUT_MODE_LEGACY_INVALID)
Definition: SiStripFEDBuffer.h:375
mps_update.status
status
Definition: mps_update.py:69
sistrip::READOUT_MODE_LEGACY_PROC_RAW_FAKE
Definition: SiStripFEDBufferComponents.h:70
sistrip::toString
std::string toString(fedchannelunpacker::StatusCode status)
Definition: SiStripFEDBuffer.cc:412
sistrip::READOUT_MODE_SCOPE
Definition: SiStripFEDBufferComponents.h:47
sistrip::fedchannelunpacker::detail::unpackRawW
StatusCode unpackRawW(const FEDChannel &channel, OUT &&out, uint8_t bits_shift=0)
Definition: SiStripFEDBuffer.h:199
SiStripRawDigi.h
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
sistrip::READOUT_MODE_SPY
Definition: SiStripFEDBufferComponents.h:60
sistrip::fedchannelunpacker::detail::getADC_B1
uint16_t getADC_B1(const uint8_t *data, uint_fast16_t wOffset, uint_fast8_t bOffset)
Definition: SiStripFEDBuffer.h:192
sistrip::FEDBufferBase::channelGood
virtual bool channelGood(const uint8_t internalFEDChannelNum) const
Definition: SiStripFEDBufferComponents.cc:1351
sistrip::FEDBufferBase::doChecks
virtual bool doChecks() const
Definition: SiStripFEDBufferComponents.cc:1356
sistrip::fedchannelunpacker::StatusCode::UNORDERED_DATA
sistrip::fedchannelunpacker::unpackScope
StatusCode unpackScope(const FEDChannel &channel, OUT &&out)
Definition: SiStripFEDBuffer.h:401
mps_check.msg
tuple msg
Definition: mps_check.py:285
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
sistrip::fedchannelunpacker::unpackProcessedRaw
StatusCode unpackProcessedRaw(const FEDChannel &channel, OUT &&out)
Definition: SiStripFEDBuffer.h:405
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT
Definition: SiStripFEDBufferComponents.h:51
sistrip::FEDBuffer::checkStatusBits
bool checkStatusBits(const uint8_t internalFEDChannelNum) const
Definition: SiStripFEDBuffer.h:167
sistrip::FEDBuffer::checkChannelLengths
bool checkChannelLengths() const
Definition: SiStripFEDBuffer.cc:191
sistrip::FEDChannel::data
const uint8_t * data() const
Definition: SiStripFEDBufferComponents.h:1575
sistrip::FEDBufferBase
Definition: SiStripFEDBufferComponents.h:643
sistrip::fedchannelunpacker::isProcessedRaw
bool isProcessedRaw(FEDReadoutMode mode, bool legacy=false, FEDLegacyReadoutMode lmode=READOUT_MODE_LEGACY_INVALID)
Definition: SiStripFEDBuffer.h:388
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
sistrip::FEDBuffer::feHeader_
std::unique_ptr< FEDFEHeader > feHeader_
Definition: SiStripFEDBuffer.h:106
end
#define end
Definition: vmac.h:39
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:50
sistrip::HEADER_TYPE_INVALID
Definition: SiStripFEDBufferComponents.h:38
FEDRawData
Definition: FEDRawData.h:19
sistrip::fedchannelunpacker::StatusCode
StatusCode
Definition: SiStripFEDBuffer.h:176
EgammaValidation_cff.samples
samples
Definition: EgammaValidation_cff.py:19
sistrip::FEDReadoutMode
FEDReadoutMode
Definition: SiStripFEDBufferComponents.h:45
sistrip::fedchannelunpacker::detail::unpackZSB
StatusCode unpackZSB(const FEDChannel &channel, OUT &&out, uint8_t headerLength, uint16_t stripStart)
Definition: SiStripFEDBuffer.h:285
sistrip::internalFEDChannelNum
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
Definition: SiStripFEDBufferComponents.h:785
sistrip::READOUT_MODE_LEGACY_VIRGIN_RAW_FAKE
Definition: SiStripFEDBufferComponents.h:68
SiStripRawDigi
A Digi for the silicon strip detector, containing only adc information, and suitable for storing raw ...
Definition: SiStripRawDigi.h:15
sistrip::fedchannelunpacker::unpackZeroSuppressed
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)
Definition: SiStripFEDBuffer.h:435
sistrip::HEADER_TYPE_NONE
Definition: SiStripFEDBufferComponents.h:41
sistrip::FEDBuffer::~FEDBuffer
~FEDBuffer() override
Definition: SiStripFEDBuffer.cc:48
sistrip::READOUT_MODE_LEGACY_VIRGIN_RAW_REAL
Definition: SiStripFEDBufferComponents.h:67
sistrip::FEDBuffer::FEDBuffer
FEDBuffer(const FEDRawData &fedBuffer, const bool allowBadBuffer=false)
Definition: SiStripFEDBuffer.cc:13
SiStripDigi.h
sistrip::FEDBuffer::checkChannelLengthsMatchBufferLength
bool checkChannelLengthsMatchBufferLength() const
Definition: SiStripFEDBuffer.cc:193
sistrip::READOUT_MODE_PROC_RAW
Definition: SiStripFEDBufferComponents.h:52
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::fedchannelunpacker::detail::getADC_W
uint16_t getADC_W(const uint8_t *data, uint_fast16_t offset, uint8_t bits_shift)
Definition: SiStripFEDBuffer.h:181
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:59
sistrip::TrackerSpecialHeader
Definition: SiStripFEDBufferComponents.h:315
sistrip::fedchannelunpacker::isScopeMode
bool isScopeMode(FEDReadoutMode mode, bool legacy=false, FEDLegacyReadoutMode lmode=READOUT_MODE_LEGACY_INVALID)
Definition: SiStripFEDBuffer.h:394
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
sistrip::FEDLegacyReadoutMode
FEDLegacyReadoutMode
Definition: SiStripFEDBufferComponents.h:64
sistrip::FEUNITS_PER_FED
static const uint16_t FEUNITS_PER_FED
Definition: ConstantsForHardwareSystems.h:29
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10
Definition: SiStripFEDBufferComponents.h:49
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:53
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
sistrip::FEDBufferStatusCode
FEDBufferStatusCode
Definition: SiStripFEDBufferComponents.h:140
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT
Definition: SiStripFEDBufferComponents.h:55
sistrip::FEDBuffer::checkChannelPacketCodes
bool checkChannelPacketCodes() const
Definition: SiStripFEDBuffer.cc:224
SiStripFEDBufferComponents.h
sistrip::FEDBufferBase::majorityAddressErrorForFEUnit
bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:1486
sistrip::FEDBuffer::checkSummary
std::string checkSummary() const override
Definition: SiStripFEDBuffer.cc:301
sistrip::FEDBuffer::validChannels_
uint8_t validChannels_
Definition: SiStripFEDBuffer.h:109
sistrip::BITS_PER_BYTE
constexpr uint16_t BITS_PER_BYTE
Definition: SiStripFEDBuffer.h:17
sistrip::FEDChannel::length
uint16_t length() const
Definition: SiStripFEDBufferComponents.h:1563
sistrip::fedchannelunpacker::unpackVirginRaw
StatusCode unpackVirginRaw(const FEDChannel &channel, OUT &&out, uint8_t packetCode)
Definition: SiStripFEDBuffer.h:410
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::FEDBufferStatusCode::SUCCESS
sistrip::FEDBufferStatusCode::WRONG_HEADERTYPE
sistrip::READOUT_MODE_VIRGIN_RAW
Definition: SiStripFEDBufferComponents.h:48
sistrip::printHex
void printHex(const void *pointer, const size_t length, std::ostream &os)
Definition: SiStripFEDBufferComponents.cc:26
sistrip::fedchannelunpacker::detail::getADC_B2
uint16_t getADC_B2(const uint8_t *data, uint_fast16_t wOffset, uint_fast8_t bOffset)
Definition: SiStripFEDBuffer.h:187
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::FEDBuffer
Definition: SiStripFEDBuffer.h:24
sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_FAKE
Definition: SiStripFEDBufferComponents.h:72
sistrip::preconstructCheckFEDBufferBase
FEDBufferStatusCode preconstructCheckFEDBufferBase(const FEDRawData &fedBuffer, bool checkRecognizedFormat=true)
Definition: SiStripFEDBufferComponents.h:757
sistrip::FEDBuffer::fePresent
bool fePresent(uint8_t internalFEUnitNum) const
Definition: SiStripFEDBuffer.h:165
sistrip::preconstructCheckFEDBuffer
FEDBufferStatusCode preconstructCheckFEDBuffer(const FEDRawData &fedBuffer, bool allowBadBuffer=false)
Definition: SiStripFEDBuffer.h:131
sistrip::FEDBuffer::checkFEUnitAPVAddresses
bool checkFEUnitAPVAddresses() const
Definition: SiStripFEDBuffer.cc:246
sistrip::FEDBuffer::findChannels
FEDBufferStatusCode findChannels()
Definition: SiStripFEDBuffer.cc:50
sistrip::READOUT_MODE_LEGACY_INVALID
Definition: SiStripFEDBufferComponents.h:65
sistrip::fedchannelunpacker::StatusCode::BAD_PACKET_CODE
sistrip::FEDBuffer::fePresent_
bool fePresent_[FEUNITS_PER_FED]
Definition: SiStripFEDBuffer.h:110
sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_REAL
Definition: SiStripFEDBufferComponents.h:71
sistrip::FEDBuffer::checkAllChannelStatusBits
bool checkAllChannelStatusBits() const
Definition: SiStripFEDBuffer.cc:176
sistrip::FEDBufferBase::feOverflow
bool feOverflow(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:1494
sistrip::FEDBuffer::setLegacyMode
void setLegacyMode(bool legacy)
Definition: SiStripFEDBuffer.h:68
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
sistrip::FEDBuffer::feGoodWithoutAPVEmulatorCheck
bool feGoodWithoutAPVEmulatorCheck(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBuffer.h:161
sistrip::FEDBuffer::doCorruptBufferChecks
virtual bool doCorruptBufferChecks() const
Definition: SiStripFEDBuffer.cc:169
sistrip::FEDFEHeader
Definition: SiStripFEDBufferComponents.h:466
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
sistrip::FEDBuffer::feHeader
const FEDFEHeader * feHeader() const
Definition: SiStripFEDBuffer.h:154
SiStripDigi
A Digi for the silicon strip detector, containing both strip and adc information, and suitable for st...
Definition: SiStripDigi.h:12
sistrip::READOUT_MODE_LEGACY_PROC_RAW_REAL
Definition: SiStripFEDBufferComponents.h:69
sistrip::FEDBuffer::channelGood
virtual bool channelGood(const uint8_t internalFEDannelNum, const bool doAPVeCheck=true) const
Definition: SiStripFEDBuffer.cc:149
sistrip::FEDBuffer::payloadPointer_
const uint8_t * payloadPointer_
Definition: SiStripFEDBuffer.h:107
sistrip
sistrip classes
Definition: SiStripQualityHelpers.h:14
sistrip::FEDBufferStatusCode::EXPECT_NOT_SPY
sistrip::PACKET_CODE_VIRGIN_RAW
static const uint8_t PACKET_CODE_VIRGIN_RAW
Definition: SiStripFEDBufferComponents.h:80
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
sistrip::fedchannelunpacker::StatusCode::ZERO_PACKET_CODE
sistrip::FEDChannel
Definition: SiStripFEDBufferComponents.h:616
sistrip::FEDBufferBase::packetCode
uint8_t packetCode(bool legacy=false, const uint8_t internalFEDChannelNum=0) const
Definition: SiStripFEDBufferComponents.h:1433
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:54
CfgNavigationSchool_cfi.OUT
OUT
Definition: CfgNavigationSchool_cfi.py:9
sistrip::READOUT_MODE_LEGACY_SCOPE
Definition: SiStripFEDBufferComponents.h:66
sistrip::FEDBuffer::nFEUnitsPresent
uint8_t nFEUnitsPresent() const
Definition: SiStripFEDBuffer.cc:393
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
sistrip::fedchannelunpacker::detail::unpackZSW
StatusCode unpackZSW(const FEDChannel &channel, OUT &&out, uint8_t headerLength, uint16_t stripStart, uint8_t bits_shift=0)
Definition: SiStripFEDBuffer.h:247
sistrip::FEDBuffer::checkFEPayloadsPresent
bool checkFEPayloadsPresent() const
Definition: SiStripFEDBuffer.cc:293
sistrip::FEDBuffer::checkFEUnitLengths
bool checkFEUnitLengths() const
Definition: SiStripFEDBuffer.cc:268
sistrip::fedchannelunpacker::isZeroSuppressed
bool isZeroSuppressed(FEDReadoutMode mode, bool legacy=false, FEDLegacyReadoutMode lmode=READOUT_MODE_LEGACY_INVALID)
Definition: SiStripFEDBuffer.h:341
sistrip::READOUT_MODE_ZERO_SUPPRESSED
Definition: SiStripFEDBufferComponents.h:56
sistrip::FEDBuffer::calculateFEUnitLength
uint16_t calculateFEUnitLength(const uint8_t internalFEUnitNumber) const
Definition: SiStripFEDBuffer.cc:284