CMS 3D CMS Logo

SiStripFEDBufferComponents.h
Go to the documentation of this file.
1 #ifndef EventFilter_SiStripRawToDigi_SiStripFEDBufferComponents_H
2 #define EventFilter_SiStripRawToDigi_SiStripFEDBufferComponents_H
3 
4 #include <ostream>
5 #include <memory>
6 #include <cstring>
7 #include <vector>
12 #include <cstdint>
13 
14 namespace sistrip {
15 
16  //
17  // Constants
18  //
19 
20  static const uint8_t INVALID = 0xFF;
21 
22  static const uint8_t APV_MAX_ADDRESS = 192;
23 
24  static const uint16_t SCOPE_MODE_MAX_SCOPE_LENGTH = 1022;
25 
31  };
32  //these are the values which appear in the buffer.
33  static const uint8_t BUFFER_FORMAT_CODE_OLD = 0xED;
34  static const uint8_t BUFFER_FORMAT_CODE_NEW = 0xC5;
35 
36  //enum values are values which appear in buffer. DO NOT CHANGE!
41  HEADER_TYPE_NONE = 4 //spy channel
42  };
43 
44  //enum values are values which appear in buffer. DO NOT CHANGE!
62  };
63 
77  };
78 
79  static const uint8_t PACKET_CODE_SCOPE = 0xE1;
80  static const uint8_t PACKET_CODE_VIRGIN_RAW = 0xE6;
81  static const uint8_t PACKET_CODE_VIRGIN_RAW10 = 0x86;
82  static const uint8_t PACKET_CODE_VIRGIN_RAW8_BOTBOT = 0xC6; //FIXME need to implement this!
83  static const uint8_t PACKET_CODE_VIRGIN_RAW8_TOPBOT = 0xA6;
84  static const uint8_t PACKET_CODE_PROC_RAW = 0xF2;
85  static const uint8_t PACKET_CODE_PROC_RAW10 = 0x92; //FIXME need to implement this!
86  static const uint8_t PACKET_CODE_PROC_RAW8_BOTBOT = 0xCA;
87  static const uint8_t PACKET_CODE_PROC_RAW8_TOPBOT = 0xB2;
88  static const uint8_t PACKET_CODE_ZERO_SUPPRESSED = 0xEA;
89  static const uint8_t PACKET_CODE_ZERO_SUPPRESSED10 = 0x8A;
90  static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT = 0xCA;
91  static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT = 0xAA;
92 
93  //enum values are values which appear in buffer. DO NOT CHANGE!
94  //see http://cmsdoc.cern.ch/cms/TRIDAS/horizontal/RUWG/DAQ_IF_guide/DAQ_IF_guide.html
104  };
105 
106  //enum values are values which appear in buffer. DO NOT CHANGE!
107  //see http://cmsdoc.cern.ch/cms/TRIDAS/horizontal/RUWG/DAQ_IF_guide/DAQ_IF_guide.html
108  enum FEDTTSBits {
112  TTS_BUSY = 0x4,
113  TTS_READY = 0x8,
114  TTS_ERROR = 0x12,
117  };
118 
119  //enum values are values which appear in buffer. DO NOT CHANGE!
125  };
126 
127  //enum values are values which appear in buffer. DO NOT CHANGE!
138  };
139 
140  enum class FEDBufferStatusCode {
141  // for FEDBufferBase
142  SUCCESS = 0,
143  BUFFER_NULL,
146  // for FEDBuffer and FEDSpyBuffer
148  EXPECT_SPY,
149  // for FEDBuffer
154  };
155 
156  //
157  // Global function declarations
158  //
159 
160  //used by these classes
161  uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum);
162  void printHex(const void* pointer, const size_t length, std::ostream& os);
163  //calculate the CRC for a FED buffer
164  uint16_t calculateFEDBufferCRC(const uint8_t* buffer, const size_t lengthInBytes);
165  //to make enums printable
166  std::ostream& operator<<(std::ostream& os, const FEDBufferFormat& value);
167  std::ostream& operator<<(std::ostream& os, const FEDHeaderType& value);
168  std::ostream& operator<<(std::ostream& os, const FEDLegacyReadoutMode& value);
169  std::ostream& operator<<(std::ostream& os, const FEDReadoutMode& value);
170  std::ostream& operator<<(std::ostream& os, const FEDDAQEventType& value);
171  std::ostream& operator<<(std::ostream& os, const FEDTTSBits& value);
172  std::ostream& operator<<(std::ostream& os, const FEDBufferState& value);
173  std::ostream& operator<<(std::ostream& os, const FEDChannelStatus& value);
174  std::ostream& operator<<(std::ostream& os, const FEDBufferStatusCode& value);
175  //convert name of an element of enum to enum value (useful for getting values from config)
176  FEDBufferFormat fedBufferFormatFromString(const std::string& bufferFormatString);
177  FEDHeaderType fedHeaderTypeFromString(const std::string& headerTypeString);
178  FEDReadoutMode fedReadoutModeFromString(const std::string& readoutModeString);
179  uint8_t packetCodeFromString(const std::string& packetCodeString, FEDReadoutMode mode);
180  FEDDAQEventType fedDAQEventTypeFromString(const std::string& daqEventTypeString);
181 
182  //
183  // Class definitions
184  //
185 
186  //handles conversion between order of data in buffer in VR/PR modes (readout order) and strip order (physical order)
188  public:
189  //convert strip/sample index in channel (ie 0-255) between physical and readout order
190  static uint8_t physicalOrderForStripInChannel(const uint8_t readoutOrderStripIndexInChannel);
191  static uint8_t readoutOrderForStripInChannel(const uint8_t physicalOrderStripIndexInChannel);
192  //convert strip/sample index in APV (ie 0-127) between physical and readout order
193  static uint8_t physicalOrderForStripInAPV(const uint8_t readoutOrderStripIndexInAPV);
194  static uint8_t readoutOrderForStripInAPV(const uint8_t physicalOrderStripIndexInAPV);
195  };
196 
197  //see http://cmsdoc.cern.ch/cms/TRIDAS/horizontal/RUWG/DAQ_IF_guide/DAQ_IF_guide.html
198  class FEDDAQHeader {
199  public:
201  explicit FEDDAQHeader(const uint8_t* header);
202  //0x5 in first fragment
203  uint8_t boeNibble() const;
204  uint8_t eventTypeNibble() const;
205  FEDDAQEventType eventType() const;
206  uint32_t l1ID() const;
207  uint16_t bxID() const;
208  uint16_t sourceID() const;
209  uint8_t version() const;
210  //0 if current header word is last, 1 otherwise
211  bool hBit() const;
212  bool lastHeader() const;
213  void print(std::ostream& os) const;
214  //used by digi2Raw
215  const uint8_t* data() const;
216  FEDDAQHeader& setEventType(const FEDDAQEventType evtType);
217  FEDDAQHeader& setL1ID(const uint32_t l1ID);
218  FEDDAQHeader& setBXID(const uint16_t bxID);
219  FEDDAQHeader& setSourceID(const uint16_t sourceID);
220  FEDDAQHeader(const uint32_t l1ID,
221  const uint16_t bxID,
222  const uint16_t sourceID,
223  const FEDDAQEventType evtType = DAQ_EVENT_TYPE_PHYSICS);
224 
225  private:
226  uint8_t header_[8];
227  };
228 
229  //see http://cmsdoc.cern.ch/cms/TRIDAS/horizontal/RUWG/DAQ_IF_guide/DAQ_IF_guide.html
231  public:
233  explicit FEDDAQTrailer(const uint8_t* trailer);
234  //0xA in first fragment
235  uint8_t eoeNibble() const;
236  uint32_t eventLengthIn64BitWords() const;
237  uint32_t eventLengthInBytes() const;
238  uint16_t crc() const;
239  //set to 1 if FRL detects a transmission error over S-link
240  bool cBit() const;
241  bool slinkTransmissionError() const { return cBit(); }
242  //set to 1 if the FED ID is not the one expected by the FRL
243  bool fBit() const;
244  bool badSourceID() const { return fBit(); }
245  uint8_t eventStatusNibble() const;
246  uint8_t ttsNibble() const;
247  FEDTTSBits ttsBits() const;
248  //0 if the current trailer is the last, 1 otherwise
249  bool tBit() const;
250  bool lastTrailer() const { return !tBit(); }
251  //set to 1 if the S-link sender card detects a CRC error (the CRC it computes is put in the CRC field)
252  bool rBit() const;
253  bool slinkCRCError() const { return rBit(); }
254  void print(std::ostream& os) const;
255  //used by digi2Raw
256  const uint8_t* data() const;
258  FEDDAQTrailer& setCRC(const uint16_t crc);
259  FEDDAQTrailer& setSLinkTransmissionErrorBit(const bool bitSet);
260  FEDDAQTrailer& setBadSourceIDBit(const bool bitSet);
261  FEDDAQTrailer& setSLinkCRCErrorBit(const bool bitSet);
264  FEDDAQTrailer(const uint32_t eventLengthIn64BitWords,
265  const uint16_t crc = 0,
266  const FEDTTSBits ttsBits = TTS_READY,
267  const bool slinkTransmissionError = false,
268  const bool badFEDID = false,
269  const bool slinkCRCError = false,
270  const uint8_t eventStatusNibble = 0);
271 
272  private:
273  uint8_t trailer_[8];
274  };
275 
277  public:
278  FEDStatusRegister(const uint16_t fedStatusRegister);
279  bool slinkFullFlag() const;
281  bool qdrMemoryFullFlag() const;
282  bool qdrMemoryPartialFullFlag() const;
283  bool qdrMemoryEmptyFlag() const;
284  bool l1aBxFIFOFullFlag() const;
285  bool l1aBxFIFOPartialFullFlag() const;
286  bool l1aBxFIFOEmptyFlag() const;
289  bool feDataMissingFlag(const uint8_t internalFEUnitNum) const;
290  void print(std::ostream& os) const;
291  void printFlags(std::ostream& os) const;
292  operator uint16_t() const;
293  //used by digi2Raw
294  FEDStatusRegister& setSLinkFullFlag(const bool bitSet);
298  FEDStatusRegister(const FEDBufferState qdrMemoryBufferState = BUFFER_STATE_UNSET,
299  const FEDBufferState l1aBxFIFOBufferState = BUFFER_STATE_UNSET,
300  const bool trackerHeaderMonitorDataReadyFlagSet = false,
301  const bool slinkFullFlagSet = false);
302 
303  private:
304  bool getBit(const uint8_t num) const;
305  void setBit(const uint8_t num, const bool bitSet);
306  void setQDRMemoryFullFlag(const bool bitSet);
307  void setQDRMemoryPartialFullFlag(const bool bitSet);
308  void setQDRMemoryEmptyFlag(const bool bitSet);
309  void setL1ABXFIFOFullFlag(const bool bitSet);
310  void setL1ABXFIFOPartialFullFlag(const bool bitSet);
311  void setL1ABXFIFOEmptyFlag(const bool bitSet);
312  uint16_t data_;
313  };
314 
316  public:
318  //construct with a pointer to the data. The data will be coppied and swapped if necessary.
319  explicit TrackerSpecialHeader(const uint8_t* headerPointer);
320  uint8_t bufferFormatByte() const;
322  uint8_t headerTypeNibble() const;
323  FEDHeaderType headerType() const;
324  uint8_t trackerEventTypeNibble() const;
325  FEDReadoutMode readoutMode() const;
327  uint8_t apveAddress() const;
328  uint8_t apvAddressErrorRegister() const;
329  bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const;
330  uint8_t feEnableRegister() const;
331  bool feEnabled(const uint8_t internalFEUnitNum) const;
332  uint8_t feOverflowRegister() const;
333  bool feOverflow(const uint8_t internalFEUnitNum) const;
334  uint16_t fedStatusRegisterWord() const;
336  void print(std::ostream& os) const;
337  //used by digi2Raw
338  //returns ordered buffer (ie this may need to be swapped to get original order)
339  const uint8_t* data() const;
340  bool wasSwapped() const;
341  TrackerSpecialHeader& setBufferFormat(const FEDBufferFormat newBufferFormat);
344  TrackerSpecialHeader& setAPVEAddress(const uint8_t address);
345  TrackerSpecialHeader& setAPVEAddressErrorRegister(const uint8_t addressErrorRegister);
346  TrackerSpecialHeader& setAPVAddressErrorForFEUnit(const uint8_t internalFEUnitNum, const bool error);
348  TrackerSpecialHeader& setFEEnableForFEUnit(const uint8_t internalFEUnitNum, const bool enabled);
350  TrackerSpecialHeader& setFEOverflowForFEUnit(const uint8_t internalFEUnitNum, const bool overflow);
355  const uint8_t address = 0x00,
356  const uint8_t addressErrorRegister = 0x00,
357  const uint8_t feEnableRegister = 0xFF,
358  const uint8_t feOverflowRegister = 0x00,
360 
361  // detect the buffer format without constructing the full header
362  static FEDBufferFormat bufferFormat(const uint8_t* headerPointer) {
363  if (headerPointer[BUFFERFORMAT] == BUFFER_FORMAT_CODE_NEW) {
364  return BUFFER_FORMAT_NEW;
365  } else if (headerPointer[BUFFERFORMAT] == BUFFER_FORMAT_CODE_OLD) {
367  } else if (headerPointer[BUFFERFORMAT ^ 4] == BUFFER_FORMAT_CODE_OLD) {
368  // same case as used to detect "wordSwapped_" in the constructor
369  return BUFFER_FORMAT_OLD_VME;
370  } else {
371  return BUFFER_FORMAT_INVALID;
372  }
373  }
374 
375  private:
376  void setBufferFormatByte(const FEDBufferFormat newBufferFormat);
377  void setHeaderTypeNibble(const uint8_t value);
378  void setReadoutModeBits(const uint8_t value);
382  FEENABLE = 3,
387  };
388  //copy of header, 32 bit word swapped if needed
389  uint8_t specialHeader_[8];
390  //was the header word swapped wrt order in buffer?
392  };
393 
395  public:
396  FEDBackendStatusRegister(const uint32_t backendStatusRegister);
397  bool internalFreezeFlag() const;
398  bool slinkDownFlag() const;
399  bool slinkFullFlag() const;
400  bool backpressureFlag() const;
401  bool ttcReadyFlag() const;
410  void print(std::ostream& os) const;
411  void printFlags(std::ostream& os) const;
412  operator uint32_t() const;
413  //used by digi2Raw
415  FEDBackendStatusRegister& setSLinkDownFlag(const bool bitSet);
416  FEDBackendStatusRegister& setSLinkFullFlag(const bool bitSet);
417  FEDBackendStatusRegister& setBackpressureFlag(const bool bitSet);
418  FEDBackendStatusRegister& setTTCReadyFlag(const bool bitSet);
427  FEDBackendStatusRegister(const FEDBufferState qdrMemoryBufferState = BUFFER_STATE_UNSET,
428  const FEDBufferState frameAddressFIFOBufferState = BUFFER_STATE_UNSET,
429  const FEDBufferState totalLengthFIFOBufferState = BUFFER_STATE_UNSET,
430  const FEDBufferState trackerHeaderFIFOBufferState = BUFFER_STATE_UNSET,
431  const FEDBufferState l1aBxFIFOBufferState = BUFFER_STATE_UNSET,
432  const FEDBufferState feEventLengthFIFOBufferState = BUFFER_STATE_UNSET,
434  const bool backpressure = false,
435  const bool slinkFull = false,
436  const bool slinkDown = false,
437  const bool internalFreeze = false,
438  const bool trackerHeaderMonitorDataReady = false,
439  const bool ttcReady = true);
440 
441  private:
442  bool getBit(const uint8_t num) const;
443  void setBit(const uint8_t num, const bool bitSet);
444  //get the state of the buffer in position 'bufferPosition'
445  FEDBufferState getBufferState(const uint8_t bufferPosition) const;
446  //set the state of the buffer in position 'bufferPosition' to state 'state'
447  void setBufferSate(const uint8_t bufferPosition, const FEDBufferState state);
448  void printFlagsForBuffer(const FEDBufferState bufferState, const std::string name, std::ostream& os) const;
449  //constants marking order of flags in buffer
450  //eg. bit offset for L1A/BX FIFO Partial full flag is STATE_OFFSET_PARTIAL_FULL+BUFFER_POSITION_L1ABX_FIFO
451  // bit offset for total length FIFO empty flag is STATE_OFFSET_EMPTY+BUFFER_POSITION_TOTAL_LENGTH_FIFO
452  //see BE FPGA technical description
461  };
463  uint32_t data_;
464  };
465 
466  class FEDFEHeader {
467  public:
468  //factory function: allocates new FEDFEHeader derrivative of appropriate type
469  static std::unique_ptr<FEDFEHeader> newFEHeader(const FEDHeaderType headerType, const uint8_t* headerBuffer);
470  //used by digi2Raw
471  static std::unique_ptr<FEDFEHeader> newFEHeader(const FEDHeaderType headerType);
472  //create a buffer to use with digi2Raw
473  static std::unique_ptr<FEDFEHeader> newFEFakeHeader(const FEDHeaderType headerType);
474  virtual ~FEDFEHeader();
475  //the length of the header
476  virtual size_t lengthInBytes() const = 0;
477  //check that there are no errors indicated in which ever error bits are available in the header
478  //check bits for both APVs on a channel
479  bool checkChannelStatusBits(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum) const;
480  virtual bool checkChannelStatusBits(const uint8_t internalFEDChannelNum) const = 0;
481  //check bits for one APV
482  bool checkStatusBits(const uint8_t internalFEUnitNum,
483  const uint8_t internalFEUnitChannelNum,
484  const uint8_t apvNum) const;
485  virtual bool checkStatusBits(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const = 0;
486  virtual void print(std::ostream& os) const = 0;
487  virtual FEDFEHeader* clone() const = 0;
488  //used by digi2Raw
489  virtual const uint8_t* data() const = 0;
490  virtual void setChannelStatus(const uint8_t internalFEDChannelNum, const FEDChannelStatus status) = 0;
491  virtual void setFEUnitMajorityAddress(const uint8_t internalFEUnitNum, const uint8_t address) = 0;
492  virtual void setBEStatusRegister(const FEDBackendStatusRegister beStatusRegister) = 0;
493  virtual void setDAQRegister(const uint32_t daqRegister) = 0;
494  virtual void setDAQRegister2(const uint32_t daqRegister2) = 0;
495  virtual void set32BitReservedRegister(const uint8_t internalFEUnitNum, const uint32_t reservedRegister) = 0;
496  virtual void setFEUnitLength(const uint8_t internalFEUnitNum, const uint16_t length) = 0;
497  void setChannelStatus(const uint8_t internalFEUnitNum,
498  const uint8_t internalFEUnitChannelNum,
499  const FEDChannelStatus status);
500  };
501 
502  class FEDAPVErrorHeader final : public FEDFEHeader {
503  public:
504  explicit FEDAPVErrorHeader(const uint8_t* headerBuffer);
505  ~FEDAPVErrorHeader() override;
506  size_t lengthInBytes() const override;
507  bool checkChannelStatusBits(const uint8_t internalFEDChannelNum) const override;
508  bool checkStatusBits(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const override;
509  void print(std::ostream& os) const override;
510  FEDAPVErrorHeader* clone() const override;
511  //used by digi2Raw
512  const uint8_t* data() const override;
513  FEDAPVErrorHeader& setAPVStatusBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood);
514  FEDAPVErrorHeader& setAPVStatusBit(const uint8_t internalFEUnitNum,
515  const uint8_t internalFEUnitChannelNum,
516  const uint8_t apvNum,
517  const bool apvGood);
518  FEDAPVErrorHeader(const std::vector<bool>& apvsGood = std::vector<bool>(APVS_PER_FED, true));
519  //Information which is not present in APVError mode is allowed to be set here so that the methods can be called on the base class without caring
520  //if the values need to be set.
521  void setChannelStatus(const uint8_t internalFEDChannelNum, const FEDChannelStatus status) override;
522  void setFEUnitMajorityAddress(const uint8_t internalFEUnitNum, const uint8_t address) override;
523  void setBEStatusRegister(const FEDBackendStatusRegister beStatusRegister) override;
524  void setDAQRegister(const uint32_t daqRegister) override;
525  void setDAQRegister2(const uint32_t daqRegister2) override;
526  void set32BitReservedRegister(const uint8_t internalFEUnitNum, const uint32_t reservedRegister) override;
527  void setFEUnitLength(const uint8_t internalFEUnitNum, const uint16_t length) override;
528 
529  private:
530  static const size_t APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS = 3;
533  };
534 
535  class FEDFullDebugHeader final : public FEDFEHeader {
536  public:
537  explicit FEDFullDebugHeader(const uint8_t* headerBuffer);
538  ~FEDFullDebugHeader() override;
539  size_t lengthInBytes() const override;
540  bool checkChannelStatusBits(const uint8_t internalFEDChannelNum) const override;
541  bool checkStatusBits(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const override;
542  void print(std::ostream& os) const override;
543  FEDFullDebugHeader* clone() const override;
544 
545  uint8_t feUnitMajorityAddress(const uint8_t internalFEUnitNum) const;
547  uint32_t daqRegister() const;
548  uint32_t daqRegister2() const;
549  uint16_t feUnitLength(const uint8_t internalFEUnitNum) const;
550  bool fePresent(const uint8_t internalFEUnitNum) const;
551 
553  FEDChannelStatus getChannelStatus(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum) const;
554 
555  //These methods return true if there was an error of the appropriate type (ie if the error bit is 0).
556  //They return false if the error could not occur due to a more general error.
557  //was channel unlocked
558  bool unlocked(const uint8_t internalFEDChannelNum) const;
559  bool unlocked(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum) const;
560  //was channel out of sync if it was unlocked
561  bool outOfSync(const uint8_t internalFEDChannelNum) const;
562  bool outOfSync(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum) const;
563  //was there an internal APV error if it was in sync
564  bool apvError(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const;
565  bool apvError(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum, const uint8_t apvNum) const;
566  //was the APV address wrong if it was in sync (does not depend on APV internal error bit)
567  bool apvAddressError(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const;
568  bool apvAddressError(const uint8_t internalFEUnitNum,
569  const uint8_t internalFEUnitChannelNum,
570  const uint8_t apvNum) const;
571 
572  //used by digi2Raw
573  const uint8_t* data() const override;
574  void setChannelStatus(const uint8_t internalFEDChannelNum, const FEDChannelStatus status) override;
575  void setFEUnitMajorityAddress(const uint8_t internalFEUnitNum, const uint8_t address) override;
577  void setDAQRegister(const uint32_t daqRegister) override;
578  void setDAQRegister2(const uint32_t daqRegister2) override;
579  void set32BitReservedRegister(const uint8_t internalFEUnitNum, const uint32_t reservedRegister) override;
580  void setFEUnitLength(const uint8_t internalFEUnitNum, const uint16_t length) override;
581  static uint32_t get32BitWordFrom(const uint8_t* startOfWord);
582  uint8_t* feWord(const uint8_t internalFEUnitNum);
583  const uint8_t* feWord(const uint8_t internalFEUnitNum) const;
584  FEDFullDebugHeader(const std::vector<uint16_t>& feUnitLengths = std::vector<uint16_t>(FEUNITS_PER_FED, 0),
585  const std::vector<uint8_t>& feMajorityAddresses = std::vector<uint8_t>(FEUNITS_PER_FED, 0),
586  const std::vector<FEDChannelStatus>& channelStatus =
587  std::vector<FEDChannelStatus>(FEDCH_PER_FED, CHANNEL_STATUS_NO_PROBLEMS),
589  const uint32_t daqRegister = 0,
590  const uint32_t daqRegister2 = 0);
591 
592  private:
593  bool getBit(const uint8_t internalFEDChannelNum, const uint8_t bit) const;
594  static void set32BitWordAt(uint8_t* startOfWord, const uint32_t value);
595  void setBit(const uint8_t internalFEDChannelNum, const uint8_t bit, const bool value);
596 
597  //These methods return true if there was an error of the appropriate type (ie if the error bit is 0).
598  //They ignore any previous errors which make the status bits meaningless and return the value of the bit anyway.
599  //In general, the methods above which only return an error for the likely cause are more useful.
600  bool unlockedFromBit(const uint8_t internalFEDChannelNum) const;
601  bool outOfSyncFromBit(const uint8_t internalFEDChannelNum) const;
602  bool apvErrorFromBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const;
603  bool apvAddressErrorFromBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const;
604 
605  //following methods set the bits to 1 (no error) if value is false
606  void setUnlocked(const uint8_t internalFEDChannelNum, const bool value);
607  void setOutOfSync(const uint8_t internalFEDChannelNum, const bool value);
608  void setAPVAddressError(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool value);
609  void setAPVError(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool value);
613  };
614 
615  //holds information about position of a channel in the buffer for use by unpacker
616  class FEDChannel {
617  public:
618  FEDChannel(const uint8_t* const data, const uint32_t offset, const uint16_t length);
619  //gets length from first 2 bytes (assuming normal FED channel)
620  FEDChannel(const uint8_t* const data, const uint32_t offset);
621  uint16_t length() const;
622  const uint8_t* data() const;
623  uint32_t offset() const;
631  uint16_t cmMedian(const uint8_t apvIndex) const;
632  //third byte of channel data for normal FED channels
633  uint8_t packetCode() const;
634 
635  private:
636  friend class FEDBuffer;
637  const uint8_t* data_;
638  uint32_t offset_;
639  uint16_t length_;
640  };
641 
642  //base class for sistrip FED buffers which have a DAQ header/trailer and tracker special header
644  public:
653  explicit FEDBufferBase(const FEDRawData& fedBuffer);
654  virtual ~FEDBufferBase();
655  //dump buffer to stream
656  void dump(std::ostream& os) const;
657  //dump original buffer before word swapping
658  void dumpOriginalBuffer(std::ostream& os) const;
659  virtual void print(std::ostream& os) const;
660  //calculate the CRC from the buffer
661  uint16_t calcCRC() const;
662 
663  //methods to get parts of the buffer
664  FEDDAQHeader daqHeader() const;
665  FEDDAQTrailer daqTrailer() const;
666  size_t bufferSize() const;
668  //methods to get info from DAQ header
670  uint32_t daqLvl1ID() const;
671  uint16_t daqBXID() const;
672  uint16_t daqSourceID() const;
673  uint16_t sourceID() const;
674  //methods to get info from DAQ trailer
675  uint32_t daqEventLengthIn64bitWords() const;
676  uint32_t daqEventLengthInBytes() const;
677  uint16_t daqCRC() const;
678  FEDTTSBits daqTTSState() const;
679  //methods to get info from the tracker special header
681  FEDHeaderType headerType() const;
683  FEDReadoutMode readoutMode() const;
684  uint8_t packetCode(bool legacy = false, const uint8_t internalFEDChannelNum = 0) const;
685  uint8_t apveAddress() const;
686  bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const;
687  bool feEnabled(const uint8_t internalFEUnitNum) const;
688  uint8_t nFEUnitsEnabled() const;
689  bool feOverflow(const uint8_t internalFEUnitNum) const;
691 
692  //check that channel has no errors
693  virtual bool channelGood(const uint8_t internalFEDChannelNum) const;
694  bool channelGood(const uint8_t internalFEUnitNum, const uint8_t internalChannelNum) const;
695  //return channel object for channel
696  const FEDChannel& channel(const uint8_t internalFEDChannelNum) const;
697  const FEDChannel& channel(const uint8_t internalFEUnitNum, const uint8_t internalChannelNum) const;
698 
699  //summary checks
700  //check that tracker special header is valid (does not check for FE unit errors indicated in special header)
701  bool doTrackerSpecialHeaderChecks() const;
702  //check for errors in DAQ heaqder and trailer (not including bad CRC)
703  bool doDAQHeaderAndTrailerChecks() const;
704  //do both
705  bool doChecks() const;
706  //print the result of all detailed checks
707  virtual std::string checkSummary() const;
708 
709  //detailed checks
710  bool checkCRC() const;
711  bool checkMajorityAddresses() const;
712  //methods to check tracker special header
713  bool checkBufferFormat() const;
714  bool checkHeaderType() const;
715  bool checkReadoutMode() const;
716  bool checkAPVEAddressValid() const;
717  bool checkNoFEOverflows() const;
718  //methods to check daq header and trailer
719  bool checkNoSlinkCRCError() const;
720  bool checkNoSLinkTransmissionError() const;
721  bool checkSourceIDs() const;
722  bool checkNoUnexpectedSourceID() const;
723  bool checkNoExtraHeadersOrTrailers() const;
724  bool checkLengthFromTrailer() const;
725 
726  protected:
727  const uint8_t* getPointerToDataAfterTrackerSpecialHeader() const;
728  const uint8_t* getPointerToByteAfterEndOfPayload() const;
729  FEDBufferBase(const FEDRawData& fedBuffer, const bool fillChannelVector);
730  std::vector<FEDChannel> channels_;
731 
732  private:
733  void init();
734  const uint8_t* originalBuffer_;
735  const uint8_t* orderedBuffer_;
736  const size_t bufferSize_;
740  };
741 
742  //
743  // Inline function definitions
744  //
745 
758  bool checkRecognizedFormat = true) {
759  if (!fedBuffer.data())
761  //min buffer length. DAQ header, DAQ trailer, tracker special header.
762  static const size_t MIN_BUFFER_SIZE = 8 + 8 + 8;
763  //check size is non zero
764  if (fedBuffer.size() < MIN_BUFFER_SIZE) {
765  LogDebug("FEDBuffer") << "Buffer is too small. Min size is " << MIN_BUFFER_SIZE << ". Buffer size is "
766  << fedBuffer.size() << ". ";
768  }
769  if (checkRecognizedFormat) {
771  LogDebug("FEDBuffer") << "Buffer format not recognized. Tracker special header: "
772  << TrackerSpecialHeader(fedBuffer.data() + 8);
774  }
775  }
777  }
778 
779  inline std::ostream& operator<<(std::ostream& os, const FEDBufferBase& obj) {
780  obj.print(os);
781  os << obj.checkSummary();
782  return os;
783  }
784 
785  inline uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum) {
786  return (internalFEUnitNum * FEDCH_PER_FEUNIT + internalFEUnitChannelNum);
787  }
788 
789  inline std::ostream& operator<<(std::ostream& os, const FEDDAQHeader& obj) {
790  obj.print(os);
791  return os;
792  }
793  inline std::ostream& operator<<(std::ostream& os, const FEDDAQTrailer& obj) {
794  obj.print(os);
795  return os;
796  }
797  inline std::ostream& operator<<(std::ostream& os, const TrackerSpecialHeader& obj) {
798  obj.print(os);
799  return os;
800  }
801  inline std::ostream& operator<<(std::ostream& os, const FEDStatusRegister& obj) {
802  obj.print(os);
803  return os;
804  }
805  inline std::ostream& operator<<(std::ostream& os, const FEDFEHeader& obj) {
806  obj.print(os);
807  return os;
808  }
809 
810  //FEDStripOrdering
811 
812  inline uint8_t FEDStripOrdering::physicalOrderForStripInChannel(const uint8_t readoutOrderStripIndexInChannel) {
813  return physicalOrderForStripInAPV(readoutOrderStripIndexInChannel / 2) +
814  (readoutOrderStripIndexInChannel % 2) * STRIPS_PER_APV;
815  }
816 
817  inline uint8_t FEDStripOrdering::readoutOrderForStripInChannel(const uint8_t physicalOrderStripIndexInChannel) {
818  return (readoutOrderForStripInAPV(physicalOrderStripIndexInChannel % 128) * 2 +
819  (physicalOrderStripIndexInChannel / 128));
820  }
821 
822  inline uint8_t FEDStripOrdering::physicalOrderForStripInAPV(const uint8_t readout_order) {
823  return ((32 * (readout_order % 4)) + (8 * static_cast<uint16_t>(static_cast<float>(readout_order) / 4.0)) -
824  (31 * static_cast<uint16_t>(static_cast<float>(readout_order) / 16.0)));
825  }
826 
827  inline uint8_t FEDStripOrdering::readoutOrderForStripInAPV(const uint8_t physical_order) {
828  return (4 * ((static_cast<uint16_t>((static_cast<float>(physical_order) / 8.0))) % 4) +
829  static_cast<uint16_t>(static_cast<float>(physical_order) / 32.0) + 16 * (physical_order % 8));
830  }
831 
832  //TrackerSpecialHeader
833 
835 
837 
838  inline uint8_t TrackerSpecialHeader::headerTypeNibble() const { return ((specialHeader_[BUFFERTYPE] & 0xF0) >> 4); }
839 
841  const auto nibble = headerTypeNibble();
842  switch (nibble) {
845  case HEADER_TYPE_NONE:
846  return FEDHeaderType(nibble);
847  default:
848  return HEADER_TYPE_INVALID;
849  }
850  }
851 
852  inline uint8_t TrackerSpecialHeader::trackerEventTypeNibble() const { return (specialHeader_[BUFFERTYPE] & 0x0F); }
853 
855  const auto nibble = trackerEventTypeNibble();
856  //if it is scope mode then return as is (it cannot be fake data)
857  //if it is premix then return as is: stripping last bit would make it spy data !
858  if ((nibble == READOUT_MODE_SCOPE) || (nibble == READOUT_MODE_PREMIX_RAW)) // 0x or 0xf
859  return FEDReadoutMode(nibble);
860  //if not then ignore the last bit which indicates if it is real or fake
861  else {
862  const uint8_t mode = (nibble & 0xF);
863  switch (mode) {
869  //case READOUT_MODE_ZERO_SUPPRESSED_CMOVERRIDE:
877  case READOUT_MODE_SPY:
878  return FEDReadoutMode(mode);
879  default:
880  return READOUT_MODE_INVALID;
881  }
882  }
883  }
884 
886 
888 
889  inline bool TrackerSpecialHeader::majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const {
890  return (!(readoutMode() == READOUT_MODE_SCOPE) && !((0x1 << internalFEUnitNum) & apvAddressErrorRegister()));
891  }
892 
894 
895  inline bool TrackerSpecialHeader::feEnabled(const uint8_t internalFEUnitNum) const {
896  return ((0x1 << internalFEUnitNum) & feEnableRegister());
897  }
898 
900 
901  inline bool TrackerSpecialHeader::feOverflow(const uint8_t internalFEUnitNum) const {
902  return ((0x1 << internalFEUnitNum) & feOverflowRegister());
903  }
904 
906  //get 16 bits
907  uint16_t statusRegister = ((specialHeader_[(FEDSTATUS + 1)] << 8) | specialHeader_[FEDSTATUS]);
908  return statusRegister;
909  }
910 
913  }
914 
915  inline void TrackerSpecialHeader::print(std::ostream& os) const { printHex(specialHeader_, 8, os); }
916 
917  inline const uint8_t* TrackerSpecialHeader::data() const { return specialHeader_; }
918 
919  inline bool TrackerSpecialHeader::wasSwapped() const { return wordSwapped_; }
920 
922  specialHeader_[BUFFERTYPE] = ((specialHeader_[BUFFERTYPE] & 0x0F) | ((value << 4) & 0xF0));
923  }
924 
925  inline void TrackerSpecialHeader::setReadoutModeBits(const uint8_t value) {
926  specialHeader_[BUFFERTYPE] = ((specialHeader_[BUFFERTYPE] & (~0x0F)) | (value & 0x0F));
927  }
928 
930  specialHeader_[APVEADDRESS] = address;
931  return *this;
932  }
933 
934  inline TrackerSpecialHeader& TrackerSpecialHeader::setAPVEAddressErrorRegister(const uint8_t addressErrorRegister) {
935  specialHeader_[ADDRESSERROR] = addressErrorRegister;
936  return *this;
937  }
938 
939  inline TrackerSpecialHeader& TrackerSpecialHeader::setFEEnableRegister(const uint8_t feEnableRegister) {
941  return *this;
942  }
943 
944  inline TrackerSpecialHeader& TrackerSpecialHeader::setFEOverflowRegister(const uint8_t feOverflowRegister) {
946  return *this;
947  }
948 
950  specialHeader_[FEDSTATUS] = (static_cast<uint16_t>(fedStatusRegister) & 0x00FF);
951  specialHeader_[FEDSTATUS + 1] = ((static_cast<uint16_t>(fedStatusRegister) & 0xFF00) >> 8);
952  return *this;
953  }
954 
955  //FEDStatusRegister
956 
957  inline FEDStatusRegister::FEDStatusRegister(const uint16_t fedStatusRegister) : data_(fedStatusRegister) {}
958 
959  inline FEDStatusRegister::operator uint16_t() const { return data_; }
960 
961  inline bool FEDStatusRegister::getBit(const uint8_t num) const { return ((0x1 << num) & (data_)); }
962 
963  inline bool FEDStatusRegister::slinkFullFlag() const { return getBit(0); }
964 
966 
967  inline bool FEDStatusRegister::qdrMemoryFullFlag() const { return getBit(2); }
968 
969  inline bool FEDStatusRegister::qdrMemoryPartialFullFlag() const { return getBit(3); }
970 
971  inline bool FEDStatusRegister::qdrMemoryEmptyFlag() const { return getBit(4); }
972 
973  inline bool FEDStatusRegister::l1aBxFIFOFullFlag() const { return getBit(5); }
974 
975  inline bool FEDStatusRegister::l1aBxFIFOPartialFullFlag() const { return getBit(6); }
976 
977  inline bool FEDStatusRegister::l1aBxFIFOEmptyFlag() const { return getBit(7); }
978 
979  inline bool FEDStatusRegister::feDataMissingFlag(const uint8_t internalFEUnitNum) const {
980  return getBit(8 + internalFEUnitNum);
981  }
982 
983  inline void FEDStatusRegister::print(std::ostream& os) const { printHex(&data_, 2, os); }
984 
986  setBit(0, bitSet);
987  return *this;
988  }
989 
991  setBit(1, bitSet);
992  return *this;
993  }
994 
995  inline void FEDStatusRegister::setQDRMemoryFullFlag(const bool bitSet) { setBit(2, bitSet); }
996 
997  inline void FEDStatusRegister::setQDRMemoryPartialFullFlag(const bool bitSet) { setBit(3, bitSet); }
998 
999  inline void FEDStatusRegister::setQDRMemoryEmptyFlag(const bool bitSet) { setBit(4, bitSet); }
1000 
1001  inline void FEDStatusRegister::setL1ABXFIFOFullFlag(const bool bitSet) { setBit(5, bitSet); }
1002 
1003  inline void FEDStatusRegister::setL1ABXFIFOPartialFullFlag(const bool bitSet) { setBit(6, bitSet); }
1004 
1005  inline void FEDStatusRegister::setL1ABXFIFOEmptyFlag(const bool bitSet) { setBit(7, bitSet); }
1006 
1007  inline FEDStatusRegister::FEDStatusRegister(const FEDBufferState qdrMemoryBufferState,
1008  const FEDBufferState l1aBxFIFOBufferState,
1009  const bool trackerHeaderMonitorDataReadyFlagSet,
1010  const bool slinkFullFlagSet)
1011  : data_(0x0000) {
1012  setSLinkFullFlag(slinkFullFlagSet);
1013  setTrackerHeaderMonitorDataReadyFlag(trackerHeaderMonitorDataReadyFlagSet);
1014  setQDRMemoryBufferState(qdrMemoryBufferState);
1015  setL1ABXFIFOBufferState(l1aBxFIFOBufferState);
1016  }
1017 
1018  //FEDBackendStatusRegister
1019 
1020  inline FEDBackendStatusRegister::FEDBackendStatusRegister(const uint32_t backendStatusRegister)
1021  : data_(backendStatusRegister) {}
1022 
1023  inline FEDBackendStatusRegister::operator uint32_t() const { return data_; }
1024 
1025  inline void FEDBackendStatusRegister::print(std::ostream& os) const { printHex(&data_, 4, os); }
1026 
1027  inline bool FEDBackendStatusRegister::getBit(const uint8_t num) const { return ((0x1 << num) & (data_)); }
1028 
1029  inline bool FEDBackendStatusRegister::internalFreezeFlag() const { return getBit(1); }
1030 
1031  inline bool FEDBackendStatusRegister::slinkDownFlag() const { return getBit(2); }
1032 
1033  inline bool FEDBackendStatusRegister::slinkFullFlag() const { return getBit(3); }
1034 
1035  inline bool FEDBackendStatusRegister::backpressureFlag() const { return getBit(4); }
1036 
1037  inline bool FEDBackendStatusRegister::ttcReadyFlag() const { return getBit(6); }
1038 
1040 
1042  setBit(1, bitSet);
1043  return *this;
1044  }
1045 
1047  setBit(2, bitSet);
1048  return *this;
1049  }
1050 
1052  setBit(3, bitSet);
1053  return *this;
1054  }
1055 
1057  setBit(4, bitSet);
1058  return *this;
1059  }
1060 
1062  setBit(6, bitSet);
1063  return *this;
1064  }
1065 
1067  setBit(7, bitSet);
1068  return *this;
1069  }
1070 
1073  }
1074 
1077  }
1078 
1081  }
1082 
1085  }
1086 
1089  }
1090 
1093  }
1094 
1097  }
1098 
1101  return *this;
1102  }
1103 
1106  return *this;
1107  }
1108 
1111  return *this;
1112  }
1113 
1116  return *this;
1117  }
1118 
1121  return *this;
1122  }
1123 
1126  return *this;
1127  }
1128 
1131  return *this;
1132  }
1133 
1134  //FEDFEHeader
1135 
1136  inline std::unique_ptr<FEDFEHeader> FEDFEHeader::newFEHeader(const FEDHeaderType headerType,
1137  const uint8_t* headerBuffer) {
1138  switch (headerType) {
1140  return std::unique_ptr<FEDFEHeader>(new FEDFullDebugHeader(headerBuffer));
1141  case HEADER_TYPE_APV_ERROR:
1142  return std::unique_ptr<FEDFEHeader>(new FEDAPVErrorHeader(headerBuffer));
1143  default:
1144  return std::unique_ptr<FEDFEHeader>();
1145  }
1146  }
1147 
1148  inline std::unique_ptr<FEDFEHeader> FEDFEHeader::newFEHeader(const FEDHeaderType headerType) {
1149  switch (headerType) {
1151  return std::unique_ptr<FEDFEHeader>(new FEDFullDebugHeader());
1152  case HEADER_TYPE_APV_ERROR:
1153  return std::unique_ptr<FEDFEHeader>(new FEDAPVErrorHeader());
1154  default:
1155  return std::unique_ptr<FEDFEHeader>();
1156  }
1157  }
1158 
1159  inline std::unique_ptr<FEDFEHeader> FEDFEHeader::newFEFakeHeader(const FEDHeaderType headerType) {
1160  switch (headerType) {
1162  return std::unique_ptr<FEDFEHeader>(new FEDFullDebugHeader);
1163  case HEADER_TYPE_APV_ERROR:
1164  return std::unique_ptr<FEDFEHeader>(new FEDAPVErrorHeader);
1165  default:
1166  return std::unique_ptr<FEDFEHeader>();
1167  }
1168  }
1169 
1170  inline bool FEDFEHeader::checkChannelStatusBits(const uint8_t internalFEUnitNum,
1171  const uint8_t internalFEUnitChannelNum) const {
1172  return checkChannelStatusBits(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum));
1173  }
1174 
1175  inline bool FEDFEHeader::checkStatusBits(const uint8_t internalFEUnitNum,
1176  const uint8_t internalFEUnitChannelNum,
1177  const uint8_t apvNum) const {
1178  return checkStatusBits(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum), apvNum);
1179  }
1180 
1181  inline void FEDFEHeader::setChannelStatus(const uint8_t internalFEUnitNum,
1182  const uint8_t internalFEUnitChannelNum,
1183  const FEDChannelStatus status) {
1184  this->setChannelStatus(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum), status);
1185  }
1186 
1187  inline FEDAPVErrorHeader::FEDAPVErrorHeader(const uint8_t* headerBuffer) {
1188  memcpy(header_, headerBuffer, APV_ERROR_HEADER_SIZE_IN_BYTES);
1189  }
1190 
1191  inline FEDAPVErrorHeader& FEDAPVErrorHeader::setAPVStatusBit(const uint8_t internalFEUnitNum,
1192  const uint8_t internalFEUnitChannelNum,
1193  const uint8_t apvNum,
1194  const bool apvGood) {
1195  return setAPVStatusBit(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum), apvNum, apvGood);
1196  }
1197 
1198  inline FEDFullDebugHeader::FEDFullDebugHeader(const uint8_t* headerBuffer) {
1199  memcpy(header_, headerBuffer, FULL_DEBUG_HEADER_SIZE_IN_BYTES);
1200  }
1201 
1202  inline uint8_t FEDFullDebugHeader::feUnitMajorityAddress(const uint8_t internalFEUnitNum) const {
1203  return feWord(internalFEUnitNum)[9];
1204  }
1205 
1208  }
1209 
1210  inline uint32_t FEDFullDebugHeader::daqRegister() const { return get32BitWordFrom(feWord(7) + 10); }
1211 
1212  inline uint32_t FEDFullDebugHeader::daqRegister2() const { return get32BitWordFrom(feWord(6) + 10); }
1213 
1214  inline uint16_t FEDFullDebugHeader::feUnitLength(const uint8_t internalFEUnitNum) const {
1215  return ((feWord(internalFEUnitNum)[15] << 8) | (feWord(internalFEUnitNum)[14]));
1216  }
1217 
1218  inline bool FEDFullDebugHeader::fePresent(const uint8_t internalFEUnitNum) const {
1219  return (feUnitLength(internalFEUnitNum) != 0);
1220  }
1221 
1222  inline bool FEDFullDebugHeader::unlocked(const uint8_t internalFEDChannelNum) const {
1224  }
1225 
1226  inline bool FEDFullDebugHeader::unlocked(const uint8_t internalFEUnitNum,
1227  const uint8_t internalFEUnitChannelNum) const {
1228  return unlocked(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum));
1229  }
1230 
1231  inline bool FEDFullDebugHeader::outOfSync(const uint8_t internalFEDChannelNum) const {
1233  }
1234 
1235  inline bool FEDFullDebugHeader::outOfSync(const uint8_t internalFEUnitNum,
1236  const uint8_t internalFEUnitChannelNum) const {
1237  return outOfSync(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum));
1238  }
1239 
1240  inline bool FEDFullDebugHeader::apvError(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const {
1243  }
1244 
1245  inline bool FEDFullDebugHeader::apvError(const uint8_t internalFEUnitNum,
1246  const uint8_t internalFEUnitChannelNum,
1247  const uint8_t apvNum) const {
1248  return apvError(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum), apvNum);
1249  }
1250 
1251  inline bool FEDFullDebugHeader::apvAddressError(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const {
1254  }
1255 
1256  inline bool FEDFullDebugHeader::apvAddressError(const uint8_t internalFEUnitNum,
1257  const uint8_t internalFEUnitChannelNum,
1258  const uint8_t apvNum) const {
1259  return apvAddressError(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum), apvNum);
1260  }
1261 
1262  inline FEDChannelStatus FEDFullDebugHeader::getChannelStatus(const uint8_t internalFEUnitNum,
1263  const uint8_t internalFEUnitChannelNum) const {
1264  return getChannelStatus(internalFEDChannelNum(internalFEUnitNum, internalFEUnitChannelNum));
1265  }
1266 
1268  return !getBit(internalFEDChannelNum, 5);
1269  }
1270 
1272  return !getBit(internalFEDChannelNum, 4);
1273  }
1274 
1275  inline bool FEDFullDebugHeader::apvErrorFromBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const {
1276  //Discovered March 2012: two bits inverted in firmware. Decided
1277  //to update documentation but keep firmware identical for
1278  //backward compatibility. So status bit order is actually:
1279  //apvErr1 - apvAddrErr0 - apvErr0 - apvAddrErr1 - OOS - unlocked.
1280  //Before, it was: return !getBit(internalFEDChannelNum,0+2*apvNum);
1281 
1282  return !getBit(internalFEDChannelNum, 0 + 2 * (1 - apvNum));
1283  }
1284 
1286  const uint8_t apvNum) const {
1287  return !getBit(internalFEDChannelNum, 1 + 2 * apvNum);
1288  }
1289 
1290  inline bool FEDFullDebugHeader::getBit(const uint8_t internalFEDChannelNum, const uint8_t bit) const {
1291  const uint8_t* pFEWord = feWord(internalFEDChannelNum / FEDCH_PER_FEUNIT);
1292  const uint8_t bitInFeWord = ((FEDCH_PER_FEUNIT - 1) - (internalFEDChannelNum % FEDCH_PER_FEUNIT)) * 6 + bit;
1293  return (pFEWord[bitInFeWord / 8] & (0x1 << (bitInFeWord % 8)));
1294  }
1295 
1296  inline uint32_t FEDFullDebugHeader::get32BitWordFrom(const uint8_t* startOfWord) {
1297  return (startOfWord[0] | (startOfWord[1] << 8) | (startOfWord[2] << 16) | (startOfWord[3] << 24));
1298  }
1299 
1300  inline void FEDFullDebugHeader::set32BitWordAt(uint8_t* startOfWord, const uint32_t value) {
1301  memcpy(startOfWord, &value, 4);
1302  }
1303 
1304  inline const uint8_t* FEDFullDebugHeader::feWord(const uint8_t internalFEUnitNum) const {
1305  return header_ + internalFEUnitNum * 2 * 8;
1306  }
1307 
1308  //re-use const method
1309  inline uint8_t* FEDFullDebugHeader::feWord(const uint8_t internalFEUnitNum) {
1310  return const_cast<uint8_t*>(std::as_const(*this).feWord(internalFEUnitNum));
1311  }
1312 
1313  inline void FEDFullDebugHeader::setUnlocked(const uint8_t internalFEDChannelNum, const bool value) {
1315  }
1316 
1317  inline void FEDFullDebugHeader::setOutOfSync(const uint8_t internalFEDChannelNum, const bool value) {
1319  }
1320 
1322  const uint8_t apvNum,
1323  const bool value) {
1324  setBit(internalFEDChannelNum, 1 + 2 * apvNum, !value);
1325  }
1326 
1328  const uint8_t apvNum,
1329  const bool value) {
1330  //Discovered March 2012: two bits inverted in firmware. Decided
1331  //to update documentation but keep firmware identical for
1332  //backward compatibility. So status bit order is actually:
1333  //apvErr1 - apvAddrErr0 - apvErr0 - apvAddrErr1 - OOS - unlocked.
1334  //Before, it was: return !getBit(internalFEDChannelNum,0+2*apvNum);
1335 
1336  setBit(internalFEDChannelNum, 0 + 2 * (1 - apvNum), !value);
1337  }
1338 
1339  //FEDDAQHeader
1340 
1341  inline FEDDAQHeader::FEDDAQHeader(const uint8_t* header) { memcpy(header_, header, 8); }
1342 
1343  inline uint8_t FEDDAQHeader::boeNibble() const { return ((header_[7] & 0xF0) >> 4); }
1344 
1345  inline uint8_t FEDDAQHeader::eventTypeNibble() const { return (header_[7] & 0x0F); }
1346 
1347  inline uint32_t FEDDAQHeader::l1ID() const { return (header_[4] | (header_[5] << 8) | (header_[6] << 16)); }
1348 
1349  inline uint16_t FEDDAQHeader::bxID() const { return ((header_[3] << 4) | ((header_[2] & 0xF0) >> 4)); }
1350 
1351  inline uint16_t FEDDAQHeader::sourceID() const { return (((header_[2] & 0x0F) << 8) | header_[1]); }
1352 
1353  inline uint8_t FEDDAQHeader::version() const { return ((header_[0] & 0xF0) >> 4); }
1354 
1355  inline bool FEDDAQHeader::hBit() const { return (header_[0] & 0x8); }
1356 
1357  inline bool FEDDAQHeader::lastHeader() const { return !hBit(); }
1358 
1359  inline const uint8_t* FEDDAQHeader::data() const { return header_; }
1360 
1361  inline void FEDDAQHeader::print(std::ostream& os) const { printHex(header_, 8, os); }
1362 
1363  //FEDDAQTrailer
1364 
1365  inline FEDDAQTrailer::FEDDAQTrailer(const uint8_t* trailer) { memcpy(trailer_, trailer, 8); }
1366 
1367  inline uint8_t FEDDAQTrailer::eoeNibble() const { return ((trailer_[7] & 0xF0) >> 4); }
1368 
1369  inline uint32_t FEDDAQTrailer::eventLengthIn64BitWords() const {
1370  return (trailer_[4] | (trailer_[5] << 8) | (trailer_[6] << 16));
1371  }
1372 
1373  inline uint32_t FEDDAQTrailer::eventLengthInBytes() const { return eventLengthIn64BitWords() * 8; }
1374 
1375  inline uint16_t FEDDAQTrailer::crc() const { return (trailer_[2] | (trailer_[3] << 8)); }
1376 
1377  inline bool FEDDAQTrailer::cBit() const { return (trailer_[1] & 0x80); }
1378 
1379  inline bool FEDDAQTrailer::fBit() const { return (trailer_[1] & 0x40); }
1380 
1381  inline uint8_t FEDDAQTrailer::eventStatusNibble() const { return (trailer_[1] & 0x0F); }
1382 
1383  inline uint8_t FEDDAQTrailer::ttsNibble() const { return ((trailer_[0] & 0xF0) >> 4); }
1384 
1385  inline bool FEDDAQTrailer::tBit() const { return (trailer_[0] & 0x08); }
1386 
1387  inline bool FEDDAQTrailer::rBit() const { return (trailer_[0] & 0x04); }
1388 
1389  inline void FEDDAQTrailer::print(std::ostream& os) const { printHex(trailer_, 8, os); }
1390 
1391  inline const uint8_t* FEDDAQTrailer::data() const { return trailer_; }
1392 
1393  //FEDBufferBase
1394 
1395  inline void FEDBufferBase::dump(std::ostream& os) const { printHex(orderedBuffer_, bufferSize_, os); }
1396 
1397  inline void FEDBufferBase::dumpOriginalBuffer(std::ostream& os) const { printHex(originalBuffer_, bufferSize_, os); }
1398 
1400 
1402 
1404 
1405  inline size_t FEDBufferBase::bufferSize() const { return bufferSize_; }
1406 
1408 
1410 
1411  inline uint32_t FEDBufferBase::daqLvl1ID() const { return daqHeader_.l1ID(); }
1412 
1413  inline uint16_t FEDBufferBase::daqBXID() const { return daqHeader_.bxID(); }
1414 
1415  inline uint16_t FEDBufferBase::daqSourceID() const { return daqHeader_.sourceID(); }
1416 
1418 
1420 
1421  inline uint16_t FEDBufferBase::daqCRC() const { return daqTrailer_.crc(); }
1422 
1424 
1426 
1428 
1430 
1432 
1434 
1435  inline uint8_t FEDBufferBase::packetCode(bool legacy, const uint8_t internalFEDChannelNum) const {
1436  if (legacy) {
1438  switch (mode) {
1440  return PACKET_CODE_SCOPE;
1443  return PACKET_CODE_VIRGIN_RAW;
1446  return PACKET_CODE_PROC_RAW;
1455  default:
1456  return 0;
1457  }
1458  } else {
1460  switch (mode) {
1461  case READOUT_MODE_SCOPE:
1462  return PACKET_CODE_SCOPE;
1465  case READOUT_MODE_PROC_RAW:
1466  return PACKET_CODE_PROC_RAW;
1478  case READOUT_MODE_SPY:
1479  case READOUT_MODE_INVALID:
1480  default:
1481  return 0;
1482  }
1483  }
1484  }
1485 
1486  inline uint8_t FEDBufferBase::apveAddress() const { return specialHeader_.apveAddress(); }
1487 
1488  inline bool FEDBufferBase::majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const {
1489  return (specialHeader_.majorityAddressErrorForFEUnit(internalFEUnitNum) && (specialHeader_.apveAddress() != 0x00));
1490  }
1491 
1492  inline bool FEDBufferBase::feEnabled(const uint8_t internalFEUnitNum) const {
1493  return specialHeader_.feEnabled(internalFEUnitNum);
1494  }
1495 
1496  inline bool FEDBufferBase::feOverflow(const uint8_t internalFEUnitNum) const {
1497  return specialHeader_.feOverflow(internalFEUnitNum);
1498  }
1499 
1501 
1502  inline bool FEDBufferBase::channelGood(const uint8_t internalFEUnitNum, const uint8_t internalChannelNum) const {
1503  return channelGood(internalFEDChannelNum(internalFEUnitNum, internalChannelNum));
1504  }
1505 
1506  inline const FEDChannel& FEDBufferBase::channel(const uint8_t internalFEDChannelNum) const {
1508  }
1509 
1510  inline const FEDChannel& FEDBufferBase::channel(const uint8_t internalFEUnitNum,
1511  const uint8_t internalChannelNum) const {
1512  return channel(internalFEDChannelNum(internalFEUnitNum, internalChannelNum));
1513  }
1514 
1516  return (checkBufferFormat() && checkHeaderType() && checkReadoutMode() &&
1517  //checkAPVEAddressValid() &&
1518  checkNoFEOverflows());
1519  }
1520 
1524  }
1525 
1526  inline bool FEDBufferBase::checkCRC() const { return (checkNoSlinkCRCError() && (calcCRC() == daqCRC())); }
1527 
1529 
1530  inline bool FEDBufferBase::checkHeaderType() const { return (headerType() != HEADER_TYPE_INVALID); }
1531 
1533 
1535 
1537 
1539 
1541 
1543 
1545  return ((daqHeader_.boeNibble() == 0x5) && (daqTrailer_.eoeNibble() == 0xA));
1546  }
1547 
1549 
1550  inline const uint8_t* FEDBufferBase::getPointerToDataAfterTrackerSpecialHeader() const { return orderedBuffer_ + 16; }
1551 
1553  return orderedBuffer_ + bufferSize_ - 8;
1554  }
1555 
1556  //FEDChannel
1557 
1558  inline FEDChannel::FEDChannel(const uint8_t* const data, const uint32_t offset) : data_(data), offset_(offset) {
1559  length_ = (data_[(offset_) ^ 7] + (data_[(offset_ + 1) ^ 7] << 8));
1560  }
1561 
1562  inline FEDChannel::FEDChannel(const uint8_t* const data, const uint32_t offset, const uint16_t length)
1563  : data_(data), offset_(offset), length_(length) {}
1564 
1565  inline uint16_t FEDChannel::length() const { return length_; }
1566 
1567  inline uint8_t FEDChannel::packetCode() const { return data_[(offset_ + 2) ^ 7]; }
1568 
1569  inline uint16_t FEDChannel::cmMedian(const uint8_t apvIndex) const {
1570  uint16_t result = 0;
1571  //CM median is 10 bits with lowest order byte first. First APV CM median starts in 4th byte of channel data
1572  result |= data_[(offset_ + 3 + 2 * apvIndex) ^ 7];
1573  result |= (((data_[(offset_ + 4 + 2 * apvIndex) ^ 7]) << 8) & 0x300);
1574  return result;
1575  }
1576 
1577  inline const uint8_t* FEDChannel::data() const { return data_; }
1578 
1579  inline uint32_t FEDChannel::offset() const { return offset_; }
1580 } // namespace sistrip
1581 
1582 #endif //ndef EventFilter_SiStripRawToDigi_FEDBufferComponents_H
sistrip::FEDStripOrdering::readoutOrderForStripInAPV
static uint8_t readoutOrderForStripInAPV(const uint8_t physicalOrderStripIndexInAPV)
Definition: SiStripFEDBufferComponents.h:827
sistrip::FEDBufferBase::daqSourceID
uint16_t daqSourceID() const
Definition: SiStripFEDBufferComponents.h:1415
sistrip::FEDFullDebugHeader::unlockedFromBit
bool unlockedFromBit(const uint8_t internalFEDChannelNum) const
Definition: SiStripFEDBufferComponents.h:1267
sistrip::FEDStripOrdering
Definition: SiStripFEDBufferComponents.h:187
sistrip::FEDFullDebugHeader::clone
FEDFullDebugHeader * clone() const override
Definition: SiStripFEDBufferComponents.cc:1127
sistrip::FEDBufferBase::checkLengthFromTrailer
bool checkLengthFromTrailer() const
Definition: SiStripFEDBufferComponents.h:1548
sistrip::TrackerSpecialHeader::setBufferFormat
TrackerSpecialHeader & setBufferFormat(const FEDBufferFormat newBufferFormat)
Definition: SiStripFEDBufferComponents.cc:793
sistrip::FEDFEHeader::checkChannelStatusBits
bool checkChannelStatusBits(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum) const
Definition: SiStripFEDBufferComponents.h:1170
sistrip::TrackerSpecialHeader::specialHeader_
uint8_t specialHeader_[8]
Definition: SiStripFEDBufferComponents.h:389
sistrip::TrackerSpecialHeader::FEENABLE
Definition: SiStripFEDBufferComponents.h:382
sistrip::FEDDAQTrailer::tBit
bool tBit() const
Definition: SiStripFEDBufferComponents.h:1385
sistrip::TrackerSpecialHeader::setReadoutModeBits
void setReadoutModeBits(const uint8_t value)
Definition: SiStripFEDBufferComponents.h:925
sistrip::FEDBackendStatusRegister::setBackpressureFlag
FEDBackendStatusRegister & setBackpressureFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:1056
sistrip::READOUT_MODE_PREMIX_RAW
Definition: SiStripFEDBufferComponents.h:61
sistrip::FEDFullDebugHeader::~FEDFullDebugHeader
~FEDFullDebugHeader() override
Definition: SiStripFEDBufferComponents.cc:1121
sistrip::FEDFullDebugHeader::setDAQRegister2
void setDAQRegister2(const uint32_t daqRegister2) override
Definition: SiStripFEDBufferComponents.cc:1225
sistrip::FEDBufferBase::dump
void dump(std::ostream &os) const
Definition: SiStripFEDBufferComponents.h:1395
MessageLogger.h
sistrip::FEDBufferBase::legacyReadoutMode
FEDLegacyReadoutMode legacyReadoutMode() const
Definition: SiStripFEDBufferComponents.h:1429
sistrip::FEDDAQTrailer::setSLinkCRCErrorBit
FEDDAQTrailer & setSLinkCRCErrorBit(const bool bitSet)
Definition: SiStripFEDBufferComponents.cc:1029
sistrip::CHANNEL_STATUS_IN_SYNC
Definition: SiStripFEDBufferComponents.h:130
sistrip::FEDFullDebugHeader::setDAQRegister
void setDAQRegister(const uint32_t daqRegister) override
Definition: SiStripFEDBufferComponents.cc:1223
sistrip::FEDBufferBase::sourceID
uint16_t sourceID() const
sistrip::FEDChannel::offset_
uint32_t offset_
Definition: SiStripFEDBufferComponents.h:638
funct::false
false
Definition: Factorize.h:29
sistrip::CHANNEL_STATUS_APV0_ADDRESS_GOOD
Definition: SiStripFEDBufferComponents.h:133
sistrip::FEDBufferBase::checkNoFEOverflows
bool checkNoFEOverflows() const
Definition: SiStripFEDBufferComponents.h:1536
sistrip::FEDDAQTrailer::badSourceID
bool badSourceID() const
Definition: SiStripFEDBufferComponents.h:244
sistrip::DAQ_EVENT_TYPE_TEST
Definition: SiStripFEDBufferComponents.h:98
sistrip::FEDChannel::offset
uint32_t offset() const
Definition: SiStripFEDBufferComponents.h:1579
sistrip::READOUT_MODE_LEGACY_PREMIX_RAW
Definition: SiStripFEDBufferComponents.h:76
sistrip::fedHeaderTypeFromString
FEDHeaderType fedHeaderTypeFromString(const std::string &headerTypeString)
Definition: SiStripFEDBufferComponents.cc:402
sistrip::FEDBufferBase::fedStatusRegister
FEDStatusRegister fedStatusRegister() const
Definition: SiStripFEDBufferComponents.h:1500
sistrip::DAQ_EVENT_TYPE_SIMULATED
Definition: SiStripFEDBufferComponents.h:100
sistrip::FEDBackendStatusRegister::setFEFPGABufferState
FEDBackendStatusRegister & setFEFPGABufferState(const FEDBufferState state)
Definition: SiStripFEDBufferComponents.h:1129
sistrip::READOUT_MODE_LEGACY_SPY
Definition: SiStripFEDBufferComponents.h:75
sistrip::TrackerSpecialHeader::setAPVEAddressErrorRegister
TrackerSpecialHeader & setAPVEAddressErrorRegister(const uint8_t addressErrorRegister)
Definition: SiStripFEDBufferComponents.h:934
sistrip::FEDAPVErrorHeader
Definition: SiStripFEDBufferComponents.h:502
sistrip::FEDBackendStatusRegister::setQDRMemoryState
FEDBackendStatusRegister & setQDRMemoryState(const FEDBufferState state)
Definition: SiStripFEDBufferComponents.h:1099
sistrip::TrackerSpecialHeader::setAPVEAddress
TrackerSpecialHeader & setAPVEAddress(const uint8_t address)
Definition: SiStripFEDBufferComponents.h:929
sistrip::FEDFullDebugHeader::setAPVError
void setAPVError(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool value)
Definition: SiStripFEDBufferComponents.h:1327
mps_update.status
status
Definition: mps_update.py:69
sistrip::FEDBufferBase::dumpOriginalBuffer
void dumpOriginalBuffer(std::ostream &os) const
Definition: SiStripFEDBufferComponents.h:1397
sistrip::FEDBufferBase::daqEventLengthIn64bitWords
uint32_t daqEventLengthIn64bitWords() const
Definition: SiStripFEDBufferComponents.h:1417
sistrip::READOUT_MODE_LEGACY_PROC_RAW_FAKE
Definition: SiStripFEDBufferComponents.h:70
sistrip::packetCodeFromString
uint8_t packetCodeFromString(const std::string &packetCodeString, FEDReadoutMode mode)
Definition: SiStripFEDBufferComponents.cc:464
sistrip::FEDDAQTrailer::fBit
bool fBit() const
Definition: SiStripFEDBufferComponents.h:1379
sistrip::READOUT_MODE_SCOPE
Definition: SiStripFEDBufferComponents.h:47
sistrip::FEDBufferBase::daqTTSState
FEDTTSBits daqTTSState() const
Definition: SiStripFEDBufferComponents.h:1423
sistrip::CHANNEL_STATUS_NO_PROBLEMS
Definition: SiStripFEDBufferComponents.h:135
sistrip::FEDBackendStatusRegister::BUFFER_POSITION_FRAME_ADDRESS_FIFO
Definition: SiStripFEDBufferComponents.h:455
sistrip::FEDFEHeader::setDAQRegister
virtual void setDAQRegister(const uint32_t daqRegister)=0
sistrip::FEDChannel::FEDChannel
FEDChannel(const uint8_t *const data, const uint32_t offset, const uint16_t length)
Definition: SiStripFEDBufferComponents.h:1562
sistrip::FEDStatusRegister::setBit
void setBit(const uint8_t num, const bool bitSet)
Definition: SiStripFEDBufferComponents.cc:599
sistrip::TrackerSpecialHeader::setFEEnableRegister
TrackerSpecialHeader & setFEEnableRegister(const uint8_t feEnableRegister)
Definition: SiStripFEDBufferComponents.h:939
sistrip::FEDDAQTrailer::eventLengthIn64BitWords
uint32_t eventLengthIn64BitWords() const
Definition: SiStripFEDBufferComponents.h:1369
sistrip::operator<<
std::ostream & operator<<(std::ostream &os, const FEDBufferFormat &value)
Definition: SiStripFEDBufferComponents.cc:79
sistrip::FEDBufferBase::daqEventLengthInBytes
uint32_t daqEventLengthInBytes() const
Definition: SiStripFEDBufferComponents.h:1419
sistrip::FEDBackendStatusRegister::ttcReadyFlag
bool ttcReadyFlag() const
Definition: SiStripFEDBufferComponents.h:1037
sistrip::FEDDAQHeader::eventTypeNibble
uint8_t eventTypeNibble() const
Definition: SiStripFEDBufferComponents.h:1345
sistrip::FEDBufferBase::~FEDBufferBase
virtual ~FEDBufferBase()
Definition: SiStripFEDBufferComponents.cc:1304
sistrip::FEDBufferStatusCode::CHANNEL_END_BEYOND_PAYLOAD
sistrip::FEDStatusRegister::l1aBxFIFOPartialFullFlag
bool l1aBxFIFOPartialFullFlag() const
Definition: SiStripFEDBufferComponents.h:975
sistrip::FEDTTSBits
FEDTTSBits
Definition: SiStripFEDBufferComponents.h:108
sistrip::FEDStatusRegister::qdrMemoryPartialFullFlag
bool qdrMemoryPartialFullFlag() const
Definition: SiStripFEDBufferComponents.h:969
ALCARECOPromptCalibProdSiPixelAli0T_cff.mode
mode
Definition: ALCARECOPromptCalibProdSiPixelAli0T_cff.py:96
sistrip::TrackerSpecialHeader::BUFFERFORMAT
Definition: SiStripFEDBufferComponents.h:386
sistrip::FEDFullDebugHeader::fePresent
bool fePresent(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:1218
sistrip::FEDStatusRegister::feDataMissingFlag
bool feDataMissingFlag(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:979
sistrip::FEDStatusRegister::setQDRMemoryEmptyFlag
void setQDRMemoryEmptyFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:999
sistrip::FEDFEHeader::setFEUnitMajorityAddress
virtual void setFEUnitMajorityAddress(const uint8_t internalFEUnitNum, const uint8_t address)=0
sistrip::FEDBackendStatusRegister::printFlagsForBuffer
void printFlagsForBuffer(const FEDBufferState bufferState, const std::string name, std::ostream &os) const
Definition: SiStripFEDBufferComponents.cc:667
sistrip::FEDFullDebugHeader::set32BitReservedRegister
void set32BitReservedRegister(const uint8_t internalFEUnitNum, const uint32_t reservedRegister) override
Definition: SiStripFEDBufferComponents.cc:1230
sistrip::FEDDAQTrailer::ttsNibble
uint8_t ttsNibble() const
Definition: SiStripFEDBufferComponents.h:1383
sistrip::TrackerSpecialHeader::feOverflow
bool feOverflow(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:901
sistrip::READOUT_MODE_SPY
Definition: SiStripFEDBufferComponents.h:60
sistrip::FEDBufferBase::getPointerToByteAfterEndOfPayload
const uint8_t * getPointerToByteAfterEndOfPayload() const
Definition: SiStripFEDBufferComponents.h:1552
sistrip::FEDStatusRegister::slinkFullFlag
bool slinkFullFlag() const
Definition: SiStripFEDBufferComponents.h:963
sistrip::FEDFullDebugHeader::checkStatusBits
bool checkStatusBits(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const override
Definition: SiStripFEDBufferComponents.cc:1129
sistrip::FEDBufferBase::channelGood
virtual bool channelGood(const uint8_t internalFEDChannelNum) const
Definition: SiStripFEDBufferComponents.cc:1351
sistrip::FEDAPVErrorHeader::checkChannelStatusBits
bool checkChannelStatusBits(const uint8_t internalFEDChannelNum) const override
Definition: SiStripFEDBufferComponents.cc:1063
sistrip::FEDBackendStatusRegister::trackerHeaderMonitorDataReadyFlag
bool trackerHeaderMonitorDataReadyFlag() const
Definition: SiStripFEDBufferComponents.h:1039
sistrip::FEDBufferBase::doChecks
bool doChecks() const
Definition: SiStripFEDBufferComponents.h:1433
sistrip::FEDStripOrdering::physicalOrderForStripInChannel
static uint8_t physicalOrderForStripInChannel(const uint8_t readoutOrderStripIndexInChannel)
Definition: SiStripFEDBufferComponents.h:812
sistrip::FEDBackendStatusRegister::BUFFER_POSITION_QDR_MEMORY
Definition: SiStripFEDBufferComponents.h:454
sistrip::calculateFEDBufferCRC
uint16_t calculateFEDBufferCRC(const uint8_t *buffer, const size_t lengthInBytes)
Definition: SiStripFEDBufferComponents.cc:62
sistrip::FEDBackendStatusRegister::getBit
bool getBit(const uint8_t num) const
Definition: SiStripFEDBufferComponents.h:1027
sistrip::TrackerSpecialHeader::bufferFormat
static FEDBufferFormat bufferFormat(const uint8_t *headerPointer)
Definition: SiStripFEDBufferComponents.h:362
sistrip::TrackerSpecialHeader::data
const uint8_t * data() const
Definition: SiStripFEDBufferComponents.h:917
sistrip::FEDDAQTrailer::slinkCRCError
bool slinkCRCError() const
Definition: SiStripFEDBufferComponents.h:253
sistrip::FEDAPVErrorHeader::setChannelStatus
void setChannelStatus(const uint8_t internalFEDChannelNum, const FEDChannelStatus status) override
Definition: SiStripFEDBufferComponents.cc:1090
sistrip::FEDDAQHeader::boeNibble
uint8_t boeNibble() const
Definition: SiStripFEDBufferComponents.h:1343
sistrip::FEDBackendStatusRegister::qdrMemoryState
FEDBufferState qdrMemoryState() const
Definition: SiStripFEDBufferComponents.h:1071
sistrip::FEDAPVErrorHeader::checkStatusBits
bool checkStatusBits(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const override
Definition: SiStripFEDBufferComponents.cc:1055
sistrip::fedReadoutModeFromString
FEDReadoutMode fedReadoutModeFromString(const std::string &readoutModeString)
Definition: SiStripFEDBufferComponents.cc:418
sistrip::FEDDAQTrailer::print
void print(std::ostream &os) const
Definition: SiStripFEDBufferComponents.h:1389
sistrip::TrackerSpecialHeader::wordSwapped_
bool wordSwapped_
Definition: SiStripFEDBufferComponents.h:391
sistrip::FEDBackendStatusRegister::BUFFER_POSITION_L1ABX_FIFO
Definition: SiStripFEDBufferComponents.h:458
sistrip::FEDBackendStatusRegister::setFrameAddressFIFOState
FEDBackendStatusRegister & setFrameAddressFIFOState(const FEDBufferState state)
Definition: SiStripFEDBufferComponents.h:1104
sistrip::FEDBufferBase::FEDBufferBase
FEDBufferBase(const FEDRawData &fedBuffer)
Definition: SiStripFEDBufferComponents.cc:1248
sistrip::FEDFEHeader::newFEFakeHeader
static std::unique_ptr< FEDFEHeader > newFEFakeHeader(const FEDHeaderType headerType)
Definition: SiStripFEDBufferComponents.h:1159
sistrip::FEDBufferBase::getPointerToDataAfterTrackerSpecialHeader
const uint8_t * getPointerToDataAfterTrackerSpecialHeader() const
Definition: SiStripFEDBufferComponents.h:1550
sistrip::PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT
Definition: SiStripFEDBufferComponents.h:91
sistrip::FEDStatusRegister::setSLinkFullFlag
FEDStatusRegister & setSLinkFullFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:985
sistrip::FEDBackendStatusRegister::setTrackerHeaderFIFOState
FEDBackendStatusRegister & setTrackerHeaderFIFOState(const FEDBufferState state)
Definition: SiStripFEDBufferComponents.h:1114
sistrip::FEDBackendStatusRegister::FEDBackendStatusRegister
FEDBackendStatusRegister(const uint32_t backendStatusRegister)
Definition: SiStripFEDBufferComponents.h:1020
sistrip::FEDBufferBase::daqTrailer
FEDDAQTrailer daqTrailer() const
Definition: SiStripFEDBufferComponents.h:1403
ConstantsForHardwareSystems.h
Constants and enumerated types for FED/FEC systems.
sistrip::PACKET_CODE_ZERO_SUPPRESSED
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED
Definition: SiStripFEDBufferComponents.h:88
sistrip::FEDFullDebugHeader::setBEStatusRegister
void setBEStatusRegister(const FEDBackendStatusRegister beStatusRegister) override
Definition: SiStripFEDBufferComponents.cc:1219
sistrip::FEDStatusRegister::l1aBxFIFOState
FEDBufferState l1aBxFIFOState() const
Definition: SiStripFEDBufferComponents.cc:588
sistrip::FEDStatusRegister::FEDStatusRegister
FEDStatusRegister(const uint16_t fedStatusRegister)
Definition: SiStripFEDBufferComponents.h:957
sistrip::FEDBufferBase::nFEUnitsEnabled
uint8_t nFEUnitsEnabled() const
Definition: SiStripFEDBufferComponents.cc:1328
sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_LITE_REAL
Definition: SiStripFEDBufferComponents.h:73
sistrip::FEDDAQHeader::header_
uint8_t header_[8]
Definition: SiStripFEDBufferComponents.h:226
FEDRawData.h
sistrip::TrackerSpecialHeader::fedStatusRegisterWord
uint16_t fedStatusRegisterWord() const
Definition: SiStripFEDBufferComponents.h:905
sistrip::FEDFullDebugHeader::get32BitWordFrom
static uint32_t get32BitWordFrom(const uint8_t *startOfWord)
Definition: SiStripFEDBufferComponents.h:1296
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT
Definition: SiStripFEDBufferComponents.h:51
relativeConstraints.error
error
Definition: relativeConstraints.py:53
sistrip::FEDFullDebugHeader::lengthInBytes
size_t lengthInBytes() const override
Definition: SiStripFEDBufferComponents.cc:1123
sistrip::TrackerSpecialHeader::setFEDStatusRegister
TrackerSpecialHeader & setFEDStatusRegister(const FEDStatusRegister fedStatusRegister)
Definition: SiStripFEDBufferComponents.h:949
sistrip::FEDStripOrdering::readoutOrderForStripInChannel
static uint8_t readoutOrderForStripInChannel(const uint8_t physicalOrderStripIndexInChannel)
Definition: SiStripFEDBufferComponents.h:817
sistrip::FEDChannel::data
const uint8_t * data() const
Definition: SiStripFEDBufferComponents.h:1577
sistrip::FEDBufferBase
Definition: SiStripFEDBufferComponents.h:643
FEDRawData::data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
sistrip::FEDBufferBase::checkSummary
virtual std::string checkSummary() const
Definition: SiStripFEDBufferComponents.cc:1356
sistrip::FEDStatusRegister::setL1ABXFIFOBufferState
FEDStatusRegister & setL1ABXFIFOBufferState(const FEDBufferState state)
Definition: SiStripFEDBufferComponents.cc:626
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:50
sistrip::HEADER_TYPE_INVALID
Definition: SiStripFEDBufferComponents.h:38
sistrip::FEDBufferBase::daqBXID
uint16_t daqBXID() const
Definition: SiStripFEDBufferComponents.h:1413
sistrip::FEDDAQHeader::l1ID
uint32_t l1ID() const
Definition: SiStripFEDBufferComponents.h:1347
FEDRawData
Definition: FEDRawData.h:19
sistrip::FEDBackendStatusRegister::data_
uint32_t data_
Definition: SiStripFEDBufferComponents.h:463
sistrip::TrackerSpecialHeader::apvAddressErrorRegister
uint8_t apvAddressErrorRegister() const
Definition: SiStripFEDBufferComponents.h:887
Utilities.operator
operator
Definition: Utilities.py:24
sistrip::PACKET_CODE_SCOPE
static const uint8_t PACKET_CODE_SCOPE
Definition: SiStripFEDBufferComponents.h:79
sistrip::FEDFEHeader::print
virtual void print(std::ostream &os) const =0
sistrip::PACKET_CODE_PROC_RAW10
static const uint8_t PACKET_CODE_PROC_RAW10
Definition: SiStripFEDBufferComponents.h:85
sistrip::FEDReadoutMode
FEDReadoutMode
Definition: SiStripFEDBufferComponents.h:45
edmScanValgrind.buffer
buffer
Definition: edmScanValgrind.py:171
sistrip::FEDDAQHeader::sourceID
uint16_t sourceID() const
Definition: SiStripFEDBufferComponents.h:1351
sistrip::FEDBackendStatusRegister::STATE_OFFSET_PARTIAL_FULL
Definition: SiStripFEDBufferComponents.h:462
sistrip::FEDFEHeader::data
virtual const uint8_t * data() const =0
sistrip::FEDFullDebugHeader::apvErrorFromBit
bool apvErrorFromBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
Definition: SiStripFEDBufferComponents.h:1275
sistrip::FEDFEHeader::~FEDFEHeader
virtual ~FEDFEHeader()
Definition: SiStripFEDBufferComponents.cc:1246
sistrip::FEDBufferBase::feEnabled
bool feEnabled(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:1492
sistrip::DAQ_EVENT_TYPE_TRACED
Definition: SiStripFEDBufferComponents.h:101
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
sistrip::TTS_OUT_OF_SYNC
Definition: SiStripFEDBufferComponents.h:111
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
sistrip::BUFFER_STATE_EMPTY
Definition: SiStripFEDBufferComponents.h:122
sistrip::FEDBufferBase::checkAPVEAddressValid
bool checkAPVEAddressValid() const
Definition: SiStripFEDBufferComponents.h:1534
sistrip::FEDBufferBase::readoutMode
FEDReadoutMode readoutMode() const
Definition: SiStripFEDBufferComponents.h:1431
sistrip::FEDDAQTrailer::setSLinkTransmissionErrorBit
FEDDAQTrailer & setSLinkTransmissionErrorBit(const bool bitSet)
Definition: SiStripFEDBufferComponents.cc:1013
sistrip::TTS_INVALID
Definition: SiStripFEDBufferComponents.h:116
sistrip::FEDAPVErrorHeader::setDAQRegister2
void setDAQRegister2(const uint32_t daqRegister2) override
Definition: SiStripFEDBufferComponents.cc:1115
sistrip::FEDFullDebugHeader::getBit
bool getBit(const uint8_t internalFEDChannelNum, const uint8_t bit) const
Definition: SiStripFEDBufferComponents.h:1290
sistrip::FEDBackendStatusRegister::print
void print(std::ostream &os) const
Definition: SiStripFEDBufferComponents.h:1025
sistrip::HEADER_TYPE_NONE
Definition: SiStripFEDBufferComponents.h:41
sistrip::FEDBufferStatusCode::CHANNEL_BEGIN_BEYOND_PAYLOAD
sistrip::FEDFEHeader::clone
virtual FEDFEHeader * clone() const =0
sistrip::APV_MAX_ADDRESS
static const uint8_t APV_MAX_ADDRESS
Definition: SiStripFEDBufferComponents.h:22
sistrip::TrackerSpecialHeader::APVEADDRESS
Definition: SiStripFEDBufferComponents.h:384
sistrip::FEDBufferBase::orderedBuffer_
const uint8_t * orderedBuffer_
Definition: SiStripFEDBufferComponents.h:735
sistrip::FEDBufferBase::daqTrailer_
FEDDAQTrailer daqTrailer_
Definition: SiStripFEDBufferComponents.h:738
sistrip::FEDDAQTrailer::ttsBits
FEDTTSBits ttsBits() const
Definition: SiStripFEDBufferComponents.cc:964
sistrip::FEDAPVErrorHeader::~FEDAPVErrorHeader
~FEDAPVErrorHeader() override
Definition: SiStripFEDBufferComponents.cc:1047
sistrip::FEDFullDebugHeader::daqRegister
uint32_t daqRegister() const
Definition: SiStripFEDBufferComponents.h:1210
sistrip::FEDFullDebugHeader::apvError
bool apvError(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
Definition: SiStripFEDBufferComponents.h:1240
sistrip::FEDDAQEventType
FEDDAQEventType
Definition: SiStripFEDBufferComponents.h:95
sistrip::TrackerSpecialHeader::majorityAddressErrorForFEUnit
bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:889
sistrip::READOUT_MODE_LEGACY_VIRGIN_RAW_REAL
Definition: SiStripFEDBufferComponents.h:67
sistrip::FEDDAQTrailer::eventStatusNibble
uint8_t eventStatusNibble() const
Definition: SiStripFEDBufferComponents.h:1381
sistrip::FEDFullDebugHeader::feWord
uint8_t * feWord(const uint8_t internalFEUnitNum)
Definition: SiStripFEDBufferComponents.h:1309
sistrip::FEDFullDebugHeader::print
void print(std::ostream &os) const override
Definition: SiStripFEDBufferComponents.cc:1125
sistrip::FEDBackendStatusRegister::slinkFullFlag
bool slinkFullFlag() const
Definition: SiStripFEDBufferComponents.h:1033
sistrip::READOUT_MODE_PROC_RAW
Definition: SiStripFEDBufferComponents.h:52
sistrip::FEDStatusRegister::setQDRMemoryFullFlag
void setQDRMemoryFullFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:995
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8
Definition: SiStripFEDBufferComponents.h:58
sistrip::TTS_READY
Definition: SiStripFEDBufferComponents.h:113
sistrip::PACKET_CODE_VIRGIN_RAW10
static const uint8_t PACKET_CODE_VIRGIN_RAW10
Definition: SiStripFEDBufferComponents.h:81
sistrip::FEDBufferBase::checkMajorityAddresses
bool checkMajorityAddresses() const
Definition: SiStripFEDBufferComponents.cc:1341
sistrip::FEDChannel::cmMedian
uint16_t cmMedian(const uint8_t apvIndex) const
Definition: SiStripFEDBufferComponents.h:1569
sistrip::FEDDAQTrailer::trailer_
uint8_t trailer_[8]
Definition: SiStripFEDBufferComponents.h:273
sistrip::TTS_DISCONNECTED1
Definition: SiStripFEDBufferComponents.h:115
sistrip::PACKET_CODE_ZERO_SUPPRESSED10
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED10
Definition: SiStripFEDBufferComponents.h:89
sistrip::FEDBackendStatusRegister::getBufferState
FEDBufferState getBufferState(const uint8_t bufferPosition) const
Definition: SiStripFEDBufferComponents.cc:680
sistrip::FEDBufferBase::checkReadoutMode
bool checkReadoutMode() const
Definition: SiStripFEDBufferComponents.h:1532
sistrip::DAQ_EVENT_TYPE_PHYSICS
Definition: SiStripFEDBufferComponents.h:96
sistrip::TrackerSpecialHeader::trackerEventTypeNibble
uint8_t trackerEventTypeNibble() const
Definition: SiStripFEDBufferComponents.h:852
sistrip::DAQ_EVENT_TYPE_CALIBRATION
Definition: SiStripFEDBufferComponents.h:97
sistrip::FEDBackendStatusRegister::feFPGABufferState
FEDBufferState feFPGABufferState() const
Definition: SiStripFEDBufferComponents.h:1095
sistrip::TrackerSpecialHeader::fedStatusRegister
FEDStatusRegister fedStatusRegister() const
Definition: SiStripFEDBufferComponents.h:911
sistrip::FEDBufferBase::doTrackerSpecialHeaderChecks
bool doTrackerSpecialHeaderChecks() const
Definition: SiStripFEDBufferComponents.h:1515
sistrip::FEDStatusRegister::data_
uint16_t data_
Definition: SiStripFEDBufferComponents.h:312
sistrip::fedBufferFormatFromString
FEDBufferFormat fedBufferFormatFromString(const std::string &bufferFormatString)
Definition: SiStripFEDBufferComponents.cc:386
sistrip::FEDBufferBase::daqHeader
FEDDAQHeader daqHeader() const
Definition: SiStripFEDBufferComponents.h:1401
sistrip::FEDStatusRegister::print
void print(std::ostream &os) const
Definition: SiStripFEDBufferComponents.h:983
sistrip::FEDStatusRegister::qdrMemoryState
FEDBufferState qdrMemoryState() const
Definition: SiStripFEDBufferComponents.cc:577
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:59
sistrip::BUFFER_FORMAT_NEW
Definition: SiStripFEDBufferComponents.h:30
sistrip::FEDBufferBase::checkNoExtraHeadersOrTrailers
bool checkNoExtraHeadersOrTrailers() const
Definition: SiStripFEDBufferComponents.h:1544
sistrip::FEDAPVErrorHeader::APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS
static const size_t APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS
Definition: SiStripFEDBufferComponents.h:530
sistrip::FEDFEHeader::setBEStatusRegister
virtual void setBEStatusRegister(const FEDBackendStatusRegister beStatusRegister)=0
sistrip::TrackerSpecialHeader
Definition: SiStripFEDBufferComponents.h:315
sistrip::FEDBufferBase::daqEventType
FEDDAQEventType daqEventType() const
Definition: SiStripFEDBufferComponents.h:1409
sistrip::FEDDAQTrailer::slinkTransmissionError
bool slinkTransmissionError() const
Definition: SiStripFEDBufferComponents.h:241
sistrip::FEDBackendStatusRegister::trackerHeaderFIFOState
FEDBufferState trackerHeaderFIFOState() const
Definition: SiStripFEDBufferComponents.h:1083
sistrip::BUFFER_STATE_FULL
Definition: SiStripFEDBufferComponents.h:124
sistrip::TrackerSpecialHeader::feOverflowRegister
uint8_t feOverflowRegister() const
Definition: SiStripFEDBufferComponents.h:899
sistrip::FEDBackendStatusRegister::slinkDownFlag
bool slinkDownFlag() const
Definition: SiStripFEDBufferComponents.h:1031
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
sistrip::FEDAPVErrorHeader::setDAQRegister
void setDAQRegister(const uint32_t daqRegister) override
Definition: SiStripFEDBufferComponents.cc:1114
sistrip::FEDAPVErrorHeader::setFEUnitMajorityAddress
void setFEUnitMajorityAddress(const uint8_t internalFEUnitNum, const uint8_t address) override
Definition: SiStripFEDBufferComponents.cc:1112
sistrip::FEDAPVErrorHeader::setAPVStatusBit
FEDAPVErrorHeader & setAPVStatusBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool apvGood)
Definition: SiStripFEDBufferComponents.cc:1077
sistrip::TrackerSpecialHeader::FEOVERFLOW
Definition: SiStripFEDBufferComponents.h:381
sistrip::FEDDAQTrailer::cBit
bool cBit() const
Definition: SiStripFEDBufferComponents.h:1377
sistrip::FEDBufferBase::daqCRC
uint16_t daqCRC() const
Definition: SiStripFEDBufferComponents.h:1421
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
sistrip::FEDFEHeader::newFEHeader
static std::unique_ptr< FEDFEHeader > newFEHeader(const FEDHeaderType headerType, const uint8_t *headerBuffer)
Definition: SiStripFEDBufferComponents.h:1136
sistrip::FEDLegacyReadoutMode
FEDLegacyReadoutMode
Definition: SiStripFEDBufferComponents.h:64
sistrip::TrackerSpecialHeader::bufferFormatByte
uint8_t bufferFormatByte() const
Definition: SiStripFEDBufferComponents.h:836
sistrip::FEDDAQTrailer::setEventLengthIn64BitWords
FEDDAQTrailer & setEventLengthIn64BitWords(const uint32_t eventLengthIn64BitWords)
Definition: SiStripFEDBufferComponents.cc:1000
sistrip::FEUNITS_PER_FED
static const uint16_t FEUNITS_PER_FED
Definition: ConstantsForHardwareSystems.h:29
sistrip::FEDDAQTrailer::setTTSBits
FEDDAQTrailer & setTTSBits(const FEDTTSBits ttsBits)
Definition: SiStripFEDBufferComponents.cc:1042
sistrip::FEDBufferBase::daqLvl1ID
uint32_t daqLvl1ID() const
Definition: SiStripFEDBufferComponents.h:1411
sistrip::FEDBufferBase::checkNoSlinkCRCError
bool checkNoSlinkCRCError() const
Definition: SiStripFEDBufferComponents.h:1538
sistrip::FEDBufferBase::bufferSize_
const size_t bufferSize_
Definition: SiStripFEDBufferComponents.h:736
sistrip::BUFFER_STATE_PARTIAL_FULL
Definition: SiStripFEDBufferComponents.h:123
sistrip::FEDDAQTrailer::eventLengthInBytes
uint32_t eventLengthInBytes() const
Definition: SiStripFEDBufferComponents.h:1373
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE10
Definition: SiStripFEDBufferComponents.h:49
sistrip::FEDBackendStatusRegister::STATE_OFFSET_EMPTY
Definition: SiStripFEDBufferComponents.h:462
sistrip::FEDBufferBase::headerType
FEDHeaderType headerType() const
Definition: SiStripFEDBufferComponents.h:1427
sistrip::FEDStatusRegister::setL1ABXFIFOPartialFullFlag
void setL1ABXFIFOPartialFullFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:1003
sistrip::FEDBackendStatusRegister::setTTCReadyFlag
FEDBackendStatusRegister & setTTCReadyFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:1061
sistrip::TrackerSpecialHeader::byteIndicies
byteIndicies
Definition: SiStripFEDBufferComponents.h:379
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_TOPBOT_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:53
sistrip::FEDBufferBase::calcCRC
uint16_t calcCRC() const
Definition: SiStripFEDBufferComponents.h:1399
sistrip::FEDBackendStatusRegister::l1aBxFIFOState
FEDBufferState l1aBxFIFOState() const
Definition: SiStripFEDBufferComponents.h:1087
sistrip::FEDDAQTrailer::setEventStatusNibble
FEDDAQTrailer & setEventStatusNibble(const uint8_t eventStatusNibble)
Definition: SiStripFEDBufferComponents.cc:1037
sistrip::FEDFullDebugHeader::setAPVAddressError
void setAPVAddressError(const uint8_t internalFEDChannelNum, const uint8_t apvNum, const bool value)
Definition: SiStripFEDBufferComponents.h:1321
sistrip::DAQ_EVENT_TYPE_TECHNICAL
Definition: SiStripFEDBufferComponents.h:99
sistrip::fedDAQEventTypeFromString
FEDDAQEventType fedDAQEventTypeFromString(const std::string &daqEventTypeString)
Definition: SiStripFEDBufferComponents.cc:521
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:233
sistrip::CHANNEL_STATUS_APV1_NO_ERROR_BIT
Definition: SiStripFEDBufferComponents.h:134
sistrip::FEDDAQHeader::version
uint8_t version() const
Definition: SiStripFEDBufferComponents.h:1353
sistrip::FEDBackendStatusRegister::bufferPositions
bufferPositions
Definition: SiStripFEDBufferComponents.h:453
sistrip::FEDBackendStatusRegister::setTotalLengthFIFOState
FEDBackendStatusRegister & setTotalLengthFIFOState(const FEDBufferState state)
Definition: SiStripFEDBufferComponents.h:1109
sistrip::FEDBufferStatusCode
FEDBufferStatusCode
Definition: SiStripFEDBufferComponents.h:140
sistrip::FEDDAQTrailer::setBadSourceIDBit
FEDDAQTrailer & setBadSourceIDBit(const bool bitSet)
Definition: SiStripFEDBufferComponents.cc:1021
sistrip::FEDHeaderType
FEDHeaderType
Definition: SiStripFEDBufferComponents.h:37
sistrip::FEDBufferBase::specialHeader_
TrackerSpecialHeader specialHeader_
Definition: SiStripFEDBufferComponents.h:739
sistrip::FEDAPVErrorHeader::FEDAPVErrorHeader
FEDAPVErrorHeader(const uint8_t *headerBuffer)
Definition: SiStripFEDBufferComponents.h:1187
sistrip::FEDStatusRegister::printFlags
void printFlags(std::ostream &os) const
Definition: SiStripFEDBufferComponents.cc:554
sistrip::TrackerSpecialHeader::feEnabled
bool feEnabled(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:895
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_BOTBOT
Definition: SiStripFEDBufferComponents.h:55
sistrip::FEDBufferStatusCode::CHANNEL_TOO_SHORT
sistrip::BUFFER_STATE_UNSET
Definition: SiStripFEDBufferComponents.h:121
sistrip::HEADER_TYPE_FULL_DEBUG
Definition: SiStripFEDBufferComponents.h:39
sistrip::FEDBufferBase::checkCRC
bool checkCRC() const
Definition: SiStripFEDBufferComponents.h:1526
sistrip::BUFFER_FORMAT_CODE_NEW
static const uint8_t BUFFER_FORMAT_CODE_NEW
Definition: SiStripFEDBufferComponents.h:34
sistrip::FEDFullDebugHeader::feUnitLength
uint16_t feUnitLength(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:1214
sistrip::TrackerSpecialHeader::setReadoutMode
TrackerSpecialHeader & setReadoutMode(const FEDReadoutMode readoutMode)
Definition: SiStripFEDBufferComponents.cc:836
sistrip::FEDStatusRegister
Definition: SiStripFEDBufferComponents.h:276
sistrip::TrackerSpecialHeader::legacyReadoutMode
FEDLegacyReadoutMode legacyReadoutMode() const
Definition: SiStripFEDBufferComponents.cc:775
sistrip::TrackerSpecialHeader::setHeaderTypeNibble
void setHeaderTypeNibble(const uint8_t value)
Definition: SiStripFEDBufferComponents.h:921
sistrip::FEDBufferBase::majorityAddressErrorForFEUnit
bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:1488
sistrip::FEDBufferBase::bufferFormat
FEDBufferFormat bufferFormat() const
Definition: SiStripFEDBufferComponents.h:1425
sistrip::FEDBufferStatusCode::BUFFER_TOO_SHORT
sistrip::FEDBufferBase::checkSourceIDs
bool checkSourceIDs() const
Definition: SiStripFEDBufferComponents.cc:1337
sistrip::FEDStatusRegister::qdrMemoryFullFlag
bool qdrMemoryFullFlag() const
Definition: SiStripFEDBufferComponents.h:967
sistrip::FEDChannel::length
uint16_t length() const
Definition: SiStripFEDBufferComponents.h:1565
sistrip::FEDDAQTrailer::rBit
bool rBit() const
Definition: SiStripFEDBufferComponents.h:1387
sistrip::PACKET_CODE_VIRGIN_RAW8_BOTBOT
static const uint8_t PACKET_CODE_VIRGIN_RAW8_BOTBOT
Definition: SiStripFEDBufferComponents.h:82
sistrip::FEDFullDebugHeader::checkChannelStatusBits
bool checkChannelStatusBits(const uint8_t internalFEDChannelNum) const override
Definition: SiStripFEDBufferComponents.cc:1134
sistrip::FEDFEHeader::checkStatusBits
bool checkStatusBits(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum, const uint8_t apvNum) const
Definition: SiStripFEDBufferComponents.h:1175
sistrip::FEDBufferBase::channels_
std::vector< FEDChannel > channels_
Definition: SiStripFEDBufferComponents.h:730
sistrip::FEDFullDebugHeader::setChannelStatus
void setChannelStatus(const uint8_t internalFEDChannelNum, const FEDChannelStatus status) override
Definition: SiStripFEDBufferComponents.cc:1206
sistrip::FEDFullDebugHeader::apvAddressErrorFromBit
bool apvAddressErrorFromBit(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
Definition: SiStripFEDBufferComponents.h:1285
sistrip::FEDFullDebugHeader::header_
uint8_t header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES]
Definition: SiStripFEDBufferComponents.h:612
sistrip::FEDAPVErrorHeader::set32BitReservedRegister
void set32BitReservedRegister(const uint8_t internalFEUnitNum, const uint32_t reservedRegister) override
Definition: SiStripFEDBufferComponents.cc:1116
sistrip::FEDDAQHeader::print
void print(std::ostream &os) const
Definition: SiStripFEDBufferComponents.h:1361
sistrip::FEDStatusRegister::getBit
bool getBit(const uint8_t num) const
Definition: SiStripFEDBufferComponents.h:961
sistrip::PACKET_CODE_PROC_RAW
static const uint8_t PACKET_CODE_PROC_RAW
Definition: SiStripFEDBufferComponents.h:84
sistrip::TTS_ERROR
Definition: SiStripFEDBufferComponents.h:114
sistrip::TrackerSpecialHeader::setBufferFormatByte
void setBufferFormatByte(const FEDBufferFormat newBufferFormat)
Definition: SiStripFEDBufferComponents.cc:804
sistrip::APVS_PER_FED
static const uint16_t APVS_PER_FED
Definition: ConstantsForHardwareSystems.h:36
sistrip::INVALID
static const uint8_t INVALID
Definition: SiStripFEDBufferComponents.h:20
sistrip::FEDBufferStatusCode::SUCCESS
value
Definition: value.py:1
sistrip::FEDBufferStatusCode::WRONG_HEADERTYPE
sistrip::FEDBackendStatusRegister::setTrackerHeaderMonitorDataReadyFlag
FEDBackendStatusRegister & setTrackerHeaderMonitorDataReadyFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:1066
sistrip::FEDBackendStatusRegister::BUFFER_POSITION_FE_EVENT_LENGTH_FIFO
Definition: SiStripFEDBufferComponents.h:459
sistrip::READOUT_MODE_VIRGIN_RAW
Definition: SiStripFEDBufferComponents.h:48
sistrip::FEDFullDebugHeader::setUnlocked
void setUnlocked(const uint8_t internalFEDChannelNum, const bool value)
Definition: SiStripFEDBufferComponents.h:1313
sistrip::FEDDAQHeader::lastHeader
bool lastHeader() const
Definition: SiStripFEDBufferComponents.h:1357
sistrip::FEDDAQHeader::FEDDAQHeader
FEDDAQHeader()
Definition: SiStripFEDBufferComponents.h:200
sistrip::printHex
void printHex(const void *pointer, const size_t length, std::ostream &os)
Definition: SiStripFEDBufferComponents.cc:26
sistrip::TrackerSpecialHeader::bufferFormat
FEDBufferFormat bufferFormat() const
Definition: SiStripFEDBufferComponents.cc:763
sistrip::TrackerSpecialHeader::setAPVAddressErrorForFEUnit
TrackerSpecialHeader & setAPVAddressErrorForFEUnit(const uint8_t internalFEUnitNum, const bool error)
Definition: SiStripFEDBufferComponents.cc:864
sistrip::FEDStatusRegister::setQDRMemoryBufferState
FEDStatusRegister & setQDRMemoryBufferState(const FEDBufferState state)
Definition: SiStripFEDBufferComponents.cc:607
sistrip::FEDBufferBase::print
virtual void print(std::ostream &os) const
Definition: SiStripFEDBufferComponents.cc:1310
sistrip::FEDBufferBase::bufferSize
size_t bufferSize() const
Definition: SiStripFEDBufferComponents.h:1405
sistrip::FEDFullDebugHeader
Definition: SiStripFEDBufferComponents.h:535
sistrip::PACKET_CODE_VIRGIN_RAW8_TOPBOT
static const uint8_t PACKET_CODE_VIRGIN_RAW8_TOPBOT
Definition: SiStripFEDBufferComponents.h:83
sistrip::FEDBackendStatusRegister::feEventLengthFIFOState
FEDBufferState feEventLengthFIFOState() const
Definition: SiStripFEDBufferComponents.h:1091
sistrip::FEDFEHeader::lengthInBytes
virtual size_t lengthInBytes() const =0
sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_LITE_FAKE
Definition: SiStripFEDBufferComponents.h:74
sistrip::FEDAPVErrorHeader::clone
FEDAPVErrorHeader * clone() const override
Definition: SiStripFEDBufferComponents.cc:1053
sistrip::FEDAPVErrorHeader::data
const uint8_t * data() const override
Definition: SiStripFEDBufferComponents.cc:1067
sistrip::FEDChannel::packetCode
uint8_t packetCode() const
Definition: SiStripFEDBufferComponents.h:1567
sistrip::DAQ_EVENT_TYPE_INVALID
Definition: SiStripFEDBufferComponents.h:103
sistrip::READOUT_MODE_INVALID
Definition: SiStripFEDBufferComponents.h:46
sistrip::FEDStatusRegister::qdrMemoryEmptyFlag
bool qdrMemoryEmptyFlag() const
Definition: SiStripFEDBufferComponents.h:971
sistrip::FEDBuffer
Definition: SiStripFEDBuffer.h:24
sistrip::FEDStatusRegister::setL1ABXFIFOFullFlag
void setL1ABXFIFOFullFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:1001
sistrip::FEDBackendStatusRegister::BUFFER_POSITION_FE_FPGA_BUFFER
Definition: SiStripFEDBufferComponents.h:460
sistrip::FEDFEHeader::set32BitReservedRegister
virtual void set32BitReservedRegister(const uint8_t internalFEUnitNum, const uint32_t reservedRegister)=0
sistrip::FEDBackendStatusRegister::frameAddressFIFOState
FEDBufferState frameAddressFIFOState() const
Definition: SiStripFEDBufferComponents.h:1075
sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_FAKE
Definition: SiStripFEDBufferComponents.h:72
FEDRawData::size
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
sistrip::FEDBufferBase::checkNoUnexpectedSourceID
bool checkNoUnexpectedSourceID() const
Definition: SiStripFEDBufferComponents.h:1542
sistrip::FEDBufferBase::channel
const FEDChannel & channel(const uint8_t internalFEDChannelNum) const
Definition: SiStripFEDBufferComponents.h:1506
sistrip::FEDBackendStatusRegister::setFEEventLengthFIFOState
FEDBackendStatusRegister & setFEEventLengthFIFOState(const FEDBufferState state)
Definition: SiStripFEDBufferComponents.h:1124
sistrip::FEDBackendStatusRegister
Definition: SiStripFEDBufferComponents.h:394
sistrip::FEDFullDebugHeader::FULL_DEBUG_HEADER_SIZE_IN_BYTES
static const size_t FULL_DEBUG_HEADER_SIZE_IN_BYTES
Definition: SiStripFEDBufferComponents.h:611
sistrip::FEDDAQHeader::setL1ID
FEDDAQHeader & setL1ID(const uint32_t l1ID)
Definition: SiStripFEDBufferComponents.cc:930
sistrip::CHANNEL_STATUS_APV1_ADDRESS_GOOD
Definition: SiStripFEDBufferComponents.h:131
sistrip::FEDAPVErrorHeader::setFEUnitLength
void setFEUnitLength(const uint8_t internalFEUnitNum, const uint16_t length) override
Definition: SiStripFEDBufferComponents.cc:1119
sistrip::FEDBackendStatusRegister::totalLengthFIFOState
FEDBufferState totalLengthFIFOState() const
Definition: SiStripFEDBufferComponents.h:1079
sistrip::preconstructCheckFEDBufferBase
FEDBufferStatusCode preconstructCheckFEDBufferBase(const FEDRawData &fedBuffer, bool checkRecognizedFormat=true)
Definition: SiStripFEDBufferComponents.h:757
sistrip::FEDBackendStatusRegister::setBufferSate
void setBufferSate(const uint8_t bufferPosition, const FEDBufferState state)
Definition: SiStripFEDBufferComponents.cc:691
sistrip::FEDDAQHeader::setSourceID
FEDDAQHeader & setSourceID(const uint16_t sourceID)
Definition: SiStripFEDBufferComponents.cc:943
sistrip::TrackerSpecialHeader::headerTypeNibble
uint8_t headerTypeNibble() const
Definition: SiStripFEDBufferComponents.h:838
sistrip::FEDBufferFormat
FEDBufferFormat
Definition: SiStripFEDBufferComponents.h:26
sistrip::BUFFER_FORMAT_OLD_SLINK
Definition: SiStripFEDBufferComponents.h:29
sistrip::TTS_WARN_OVERFLOW
Definition: SiStripFEDBufferComponents.h:110
sistrip::FEDBufferBase::checkHeaderType
bool checkHeaderType() const
Definition: SiStripFEDBufferComponents.h:1530
sistrip::FEDAPVErrorHeader::setBEStatusRegister
void setBEStatusRegister(const FEDBackendStatusRegister beStatusRegister) override
Definition: SiStripFEDBufferComponents.cc:1113
sistrip::TrackerSpecialHeader::feEnableRegister
uint8_t feEnableRegister() const
Definition: SiStripFEDBufferComponents.h:893
sistrip::FEDDAQHeader::hBit
bool hBit() const
Definition: SiStripFEDBufferComponents.h:1355
sistrip::FEDDAQHeader::setEventType
FEDDAQHeader & setEventType(const FEDDAQEventType evtType)
Definition: SiStripFEDBufferComponents.cc:925
sistrip::FEDBufferBase::originalBuffer_
const uint8_t * originalBuffer_
Definition: SiStripFEDBufferComponents.h:734
sistrip::READOUT_MODE_LEGACY_INVALID
Definition: SiStripFEDBufferComponents.h:65
sistrip::FEDFullDebugHeader::unlocked
bool unlocked(const uint8_t internalFEDChannelNum) const
Definition: SiStripFEDBufferComponents.h:1222
sistrip::TrackerSpecialHeader::FEDSTATUS
Definition: SiStripFEDBufferComponents.h:380
sistrip::TrackerSpecialHeader::setFEOverflowRegister
TrackerSpecialHeader & setFEOverflowRegister(const uint8_t feOverflowRegister)
Definition: SiStripFEDBufferComponents.h:944
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
sistrip::FEDChannelStatus
FEDChannelStatus
Definition: SiStripFEDBufferComponents.h:128
sistrip::FEDBackendStatusRegister::STATE_OFFSET_FULL
Definition: SiStripFEDBufferComponents.h:462
sistrip::STRIPS_PER_APV
static const uint16_t STRIPS_PER_APV
Definition: ConstantsForHardwareSystems.h:43
sistrip::READOUT_MODE_LEGACY_ZERO_SUPPRESSED_REAL
Definition: SiStripFEDBufferComponents.h:71
sistrip::FEDDAQHeader::eventType
FEDDAQEventType eventType() const
Definition: SiStripFEDBufferComponents.cc:910
sistrip::TrackerSpecialHeader::TrackerSpecialHeader
TrackerSpecialHeader()
Definition: SiStripFEDBufferComponents.h:834
sistrip::FEDBufferBase::feOverflow
bool feOverflow(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:1496
sistrip::FEDChannel::length_
uint16_t length_
Definition: SiStripFEDBufferComponents.h:639
sistrip::FEDBackendStatusRegister::backpressureFlag
bool backpressureFlag() const
Definition: SiStripFEDBufferComponents.h:1035
sistrip::TrackerSpecialHeader::BUFFERTYPE
Definition: SiStripFEDBufferComponents.h:385
sistrip::TrackerSpecialHeader::setFEOverflowForFEUnit
TrackerSpecialHeader & setFEOverflowForFEUnit(const uint8_t internalFEUnitNum, const bool overflow)
Definition: SiStripFEDBufferComponents.cc:880
sistrip::FEDBufferBase::doDAQHeaderAndTrailerChecks
bool doDAQHeaderAndTrailerChecks() const
Definition: SiStripFEDBufferComponents.h:1521
sistrip::FEDBackendStatusRegister::BUFFER_POSITION_TRACKER_HEADER_FIFO
Definition: SiStripFEDBufferComponents.h:457
sistrip::FEDBufferBase::checkNoSLinkTransmissionError
bool checkNoSLinkTransmissionError() const
Definition: SiStripFEDBufferComponents.h:1540
sistrip::FEDBackendStatusRegister::stateOffsets
stateOffsets
Definition: SiStripFEDBufferComponents.h:462
sistrip::DAQ_EVENT_TYPE_ERROR
Definition: SiStripFEDBufferComponents.h:102
sistrip::FEDFullDebugHeader::setBit
void setBit(const uint8_t internalFEDChannelNum, const uint8_t bit, const bool value)
Definition: SiStripFEDBufferComponents.cc:1239
sistrip::BUFFER_FORMAT_OLD_VME
Definition: SiStripFEDBufferComponents.h:28
sistrip::FEDDAQTrailer
Definition: SiStripFEDBufferComponents.h:230
sistrip::FEDBufferStatusCode::EXPECT_SPY
sistrip::FEDBackendStatusRegister::internalFreezeFlag
bool internalFreezeFlag() const
Definition: SiStripFEDBufferComponents.h:1029
sistrip::FEDFullDebugHeader::set32BitWordAt
static void set32BitWordAt(uint8_t *startOfWord, const uint32_t value)
Definition: SiStripFEDBufferComponents.h:1300
sistrip::FEDChannel::data_
const uint8_t * data_
Definition: SiStripFEDBufferComponents.h:637
sistrip::FEDDAQTrailer::eoeNibble
uint8_t eoeNibble() const
Definition: SiStripFEDBufferComponents.h:1367
sistrip::FEDBufferBase::trackerSpecialHeader
TrackerSpecialHeader trackerSpecialHeader() const
Definition: SiStripFEDBufferComponents.h:1407
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
sistrip::TrackerSpecialHeader::ADDRESSERROR
Definition: SiStripFEDBufferComponents.h:383
sistrip::FEDBackendStatusRegister::setSLinkFullFlag
FEDBackendStatusRegister & setSLinkFullFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:1051
sistrip::FEDFullDebugHeader::data
const uint8_t * data() const override
Definition: SiStripFEDBufferComponents.cc:1185
sistrip::TrackerSpecialHeader::headerType
FEDHeaderType headerType() const
Definition: SiStripFEDBufferComponents.h:840
sistrip::FEDFullDebugHeader::outOfSync
bool outOfSync(const uint8_t internalFEDChannelNum) const
Definition: SiStripFEDBufferComponents.h:1231
sistrip::TrackerSpecialHeader::wasSwapped
bool wasSwapped() const
Definition: SiStripFEDBufferComponents.h:919
sistrip::FEDDAQHeader::data
const uint8_t * data() const
Definition: SiStripFEDBufferComponents.h:1359
sistrip::FEDFullDebugHeader::apvAddressError
bool apvAddressError(const uint8_t internalFEDChannelNum, const uint8_t apvNum) const
Definition: SiStripFEDBufferComponents.h:1251
Exception.h
sistrip::FEDDAQTrailer::lastTrailer
bool lastTrailer() const
Definition: SiStripFEDBufferComponents.h:250
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
sistrip::TrackerSpecialHeader::readoutMode
FEDReadoutMode readoutMode() const
Definition: SiStripFEDBufferComponents.h:854
sistrip::TrackerSpecialHeader::setFEEnableForFEUnit
TrackerSpecialHeader & setFEEnableForFEUnit(const uint8_t internalFEUnitNum, const bool enabled)
Definition: SiStripFEDBufferComponents.cc:872
sistrip::FEDCH_PER_FED
static const uint16_t FEDCH_PER_FED
Definition: ConstantsForHardwareSystems.h:30
sistrip::FEDBackendStatusRegister::printFlags
void printFlags(std::ostream &os) const
Definition: SiStripFEDBufferComponents.cc:645
RecoTauValidation_cfi.header
header
Definition: RecoTauValidation_cfi.py:292
sistrip::FEDFEHeader
Definition: SiStripFEDBufferComponents.h:466
sistrip::FEDBufferStatusCode::BUFFER_NULL
sistrip::FEDCH_PER_FEUNIT
static const uint16_t FEDCH_PER_FEUNIT
Definition: ConstantsForHardwareSystems.h:28
sistrip::TTS_BUSY
Definition: SiStripFEDBufferComponents.h:112
sistrip::FEDAPVErrorHeader::print
void print(std::ostream &os) const override
Definition: SiStripFEDBufferComponents.cc:1051
sistrip::FEDBufferBase::checkBufferFormat
bool checkBufferFormat() const
Definition: SiStripFEDBufferComponents.h:1528
sistrip::FEDBackendStatusRegister::setInternalFreezeFlag
FEDBackendStatusRegister & setInternalFreezeFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:1041
sistrip::FEDDAQTrailer::data
const uint8_t * data() const
Definition: SiStripFEDBufferComponents.h:1391
mps_fire.result
result
Definition: mps_fire.py:311
sistrip::FEDFullDebugHeader::FULL_DEBUG_HEADER_SIZE_IN_64BIT_WORDS
static const size_t FULL_DEBUG_HEADER_SIZE_IN_64BIT_WORDS
Definition: SiStripFEDBufferComponents.h:610
sistrip::CHANNEL_STATUS_LOCKED
Definition: SiStripFEDBufferComponents.h:129
sistrip::FEDStatusRegister::setL1ABXFIFOEmptyFlag
void setL1ABXFIFOEmptyFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:1005
sistrip::FEDDAQTrailer::setCRC
FEDDAQTrailer & setCRC(const uint16_t crc)
Definition: SiStripFEDBufferComponents.cc:1007
sistrip::READOUT_MODE_LEGACY_PROC_RAW_REAL
Definition: SiStripFEDBufferComponents.h:69
sistrip::FEDBackendStatusRegister::setL1ABXFIFOState
FEDBackendStatusRegister & setL1ABXFIFOState(const FEDBufferState state)
Definition: SiStripFEDBufferComponents.h:1119
sistrip::FEDFullDebugHeader::daqRegister2
uint32_t daqRegister2() const
Definition: SiStripFEDBufferComponents.h:1212
sistrip
sistrip classes
Definition: SiStripQualityHelpers.h:14
sistrip::TrackerSpecialHeader::print
void print(std::ostream &os) const
Definition: SiStripFEDBufferComponents.h:915
sistrip::FEDBackendStatusRegister::setSLinkDownFlag
FEDBackendStatusRegister & setSLinkDownFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:1046
sistrip::PACKET_CODE_PROC_RAW8_TOPBOT
static const uint8_t PACKET_CODE_PROC_RAW8_TOPBOT
Definition: SiStripFEDBufferComponents.h:87
sistrip::FEDDAQHeader::setBXID
FEDDAQHeader & setBXID(const uint16_t bxID)
Definition: SiStripFEDBufferComponents.cc:937
sistrip::FEDBufferBase::init
void init()
Definition: SiStripFEDBufferComponents.cc:1262
sistrip::FEDBufferStatusCode::EXPECT_NOT_SPY
sistrip::PACKET_CODE_VIRGIN_RAW
static const uint8_t PACKET_CODE_VIRGIN_RAW
Definition: SiStripFEDBufferComponents.h:80
sistrip::FEDBufferBase::apveAddress
uint8_t apveAddress() const
Definition: SiStripFEDBufferComponents.h:1486
hltrates_dqm_sourceclient-live_cfg.offset
offset
Definition: hltrates_dqm_sourceclient-live_cfg.py:82
sistrip::FEDStripOrdering::physicalOrderForStripInAPV
static uint8_t physicalOrderForStripInAPV(const uint8_t readoutOrderStripIndexInAPV)
Definition: SiStripFEDBufferComponents.h:822
sistrip::FEDBufferStatusCode::UNRECOGNIZED_FORMAT
sistrip::FEDStatusRegister::l1aBxFIFOFullFlag
bool l1aBxFIFOFullFlag() const
Definition: SiStripFEDBufferComponents.h:973
sistrip::FEDDAQHeader
Definition: SiStripFEDBufferComponents.h:198
sistrip::FEDAPVErrorHeader::lengthInBytes
size_t lengthInBytes() const override
Definition: SiStripFEDBufferComponents.cc:1049
sistrip::BUFFER_FORMAT_CODE_OLD
static const uint8_t BUFFER_FORMAT_CODE_OLD
Definition: SiStripFEDBufferComponents.h:33
sistrip::FEDChannel
Definition: SiStripFEDBufferComponents.h:616
sistrip::FEDBackendStatusRegister::BUFFER_POSITION_TOTAL_LENGTH_FIFO
Definition: SiStripFEDBufferComponents.h:456
sistrip::FEDFEHeader::setDAQRegister2
virtual void setDAQRegister2(const uint32_t daqRegister2)=0
sistrip::FEDBackendStatusRegister::setBit
void setBit(const uint8_t num, const bool bitSet)
Definition: SiStripFEDBufferComponents.cc:709
sistrip::FEDFullDebugHeader::outOfSyncFromBit
bool outOfSyncFromBit(const uint8_t internalFEDChannelNum) const
Definition: SiStripFEDBufferComponents.h:1271
sistrip::FEDBufferState
FEDBufferState
Definition: SiStripFEDBufferComponents.h:120
sistrip::FEDBufferBase::packetCode
uint8_t packetCode(bool legacy=false, const uint8_t internalFEDChannelNum=0) const
Definition: SiStripFEDBufferComponents.h:1435
sistrip::READOUT_MODE_ZERO_SUPPRESSED_LITE8_CMOVERRIDE
Definition: SiStripFEDBufferComponents.h:54
sistrip::FEDFullDebugHeader::beStatusRegister
FEDBackendStatusRegister beStatusRegister() const
Definition: SiStripFEDBufferComponents.h:1206
sistrip::FEDFullDebugHeader::setOutOfSync
void setOutOfSync(const uint8_t internalFEDChannelNum, const bool value)
Definition: SiStripFEDBufferComponents.h:1317
sistrip::FEDStatusRegister::l1aBxFIFOEmptyFlag
bool l1aBxFIFOEmptyFlag() const
Definition: SiStripFEDBufferComponents.h:977
sistrip::FEDAPVErrorHeader::header_
uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES]
Definition: SiStripFEDBufferComponents.h:532
sistrip::TrackerSpecialHeader::apveAddress
uint8_t apveAddress() const
Definition: SiStripFEDBufferComponents.h:885
sistrip::BUFFER_FORMAT_INVALID
Definition: SiStripFEDBufferComponents.h:27
sistrip::FEDDAQTrailer::crc
uint16_t crc() const
Definition: SiStripFEDBufferComponents.h:1375
sistrip::READOUT_MODE_LEGACY_SCOPE
Definition: SiStripFEDBufferComponents.h:66
sistrip::FEDDAQTrailer::FEDDAQTrailer
FEDDAQTrailer()
Definition: SiStripFEDBufferComponents.h:232
sistrip::READOUT_MODE_ZERO_SUPPRESSED_FAKE
Definition: SiStripFEDBufferComponents.h:57
sistrip::FEDFEHeader::setChannelStatus
virtual void setChannelStatus(const uint8_t internalFEDChannelNum, const FEDChannelStatus status)=0
sistrip::CHANNEL_STATUS_APV0_NO_ERROR_BIT
Definition: SiStripFEDBufferComponents.h:132
sistrip::FEDStatusRegister::setQDRMemoryPartialFullFlag
void setQDRMemoryPartialFullFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:997
sistrip::SCOPE_MODE_MAX_SCOPE_LENGTH
static const uint16_t SCOPE_MODE_MAX_SCOPE_LENGTH
Definition: SiStripFEDBufferComponents.h:24
sistrip::FEDStatusRegister::setTrackerHeaderMonitorDataReadyFlag
FEDStatusRegister & setTrackerHeaderMonitorDataReadyFlag(const bool bitSet)
Definition: SiStripFEDBufferComponents.h:990
sistrip::FEDBufferBase::daqHeader_
FEDDAQHeader daqHeader_
Definition: SiStripFEDBufferComponents.h:737
sistrip::FEDFullDebugHeader::FEDFullDebugHeader
FEDFullDebugHeader(const uint8_t *headerBuffer)
Definition: SiStripFEDBufferComponents.h:1198
sistrip::PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT
Definition: SiStripFEDBufferComponents.h:90
sistrip::FEDDAQHeader::bxID
uint16_t bxID() const
Definition: SiStripFEDBufferComponents.h:1349
sistrip::HEADER_TYPE_APV_ERROR
Definition: SiStripFEDBufferComponents.h:40
sistrip::FEDFEHeader::setFEUnitLength
virtual void setFEUnitLength(const uint8_t internalFEUnitNum, const uint16_t length)=0
sistrip::PACKET_CODE_PROC_RAW8_BOTBOT
static const uint8_t PACKET_CODE_PROC_RAW8_BOTBOT
Definition: SiStripFEDBufferComponents.h:86
sistrip::TrackerSpecialHeader::setHeaderType
TrackerSpecialHeader & setHeaderType(const FEDHeaderType headerType)
Definition: SiStripFEDBufferComponents.cc:821
sistrip::FEDFullDebugHeader::setFEUnitLength
void setFEUnitLength(const uint8_t internalFEUnitNum, const uint16_t length) override
Definition: SiStripFEDBufferComponents.cc:1234
sistrip::FEDFullDebugHeader::setFEUnitMajorityAddress
void setFEUnitMajorityAddress(const uint8_t internalFEUnitNum, const uint8_t address) override
Definition: SiStripFEDBufferComponents.cc:1215
sistrip::READOUT_MODE_ZERO_SUPPRESSED
Definition: SiStripFEDBufferComponents.h:56
sistrip::FEDFullDebugHeader::feUnitMajorityAddress
uint8_t feUnitMajorityAddress(const uint8_t internalFEUnitNum) const
Definition: SiStripFEDBufferComponents.h:1202
sistrip::TTS_DISCONNECTED0
Definition: SiStripFEDBufferComponents.h:109
pixel_dqm_sourceclient-live_cfg.enabled
enabled
Definition: pixel_dqm_sourceclient-live_cfg.py:136
sistrip::FEDFullDebugHeader::getChannelStatus
FEDChannelStatus getChannelStatus(const uint8_t internalFEDChannelNum) const
Definition: SiStripFEDBufferComponents.cc:1144
sistrip::FEDAPVErrorHeader::APV_ERROR_HEADER_SIZE_IN_BYTES
static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES
Definition: SiStripFEDBufferComponents.h:531
sistrip::FEDStatusRegister::trackerHeaderMonitorDataReadyFlag
bool trackerHeaderMonitorDataReadyFlag() const
Definition: SiStripFEDBufferComponents.h:965