1 #ifndef EventFilter_SiStripRawToDigi_SiStripFEDBufferComponents_H 2 #define EventFilter_SiStripRawToDigi_SiStripFEDBufferComponents_H 4 #include "boost/cstdint.hpp" 136 uint8_t
internalFEDChannelNum(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum);
137 void printHex(
const void* pointer,
const size_t length, std::ostream& os);
179 uint8_t boeNibble()
const;
180 uint8_t eventTypeNibble()
const;
182 uint32_t l1ID()
const;
183 uint16_t bxID()
const;
184 uint16_t sourceID()
const;
188 bool lastHeader()
const;
189 void print(std::ostream& os)
const;
191 const uint8_t*
data()
const;
196 FEDDAQHeader(
const uint32_t l1ID,
const uint16_t bxID,
const uint16_t sourceID,
209 uint8_t eoeNibble()
const;
210 uint32_t eventLengthIn64BitWords()
const;
211 uint32_t eventLengthInBytes()
const;
212 uint16_t crc()
const;
219 uint8_t eventStatusNibble()
const;
220 uint8_t ttsNibble()
const;
228 void print(std::ostream& os)
const;
230 const uint8_t*
data()
const;
231 FEDDAQTrailer& setEventLengthIn64BitWords(
const uint32_t eventLengthIn64BitWords);
233 FEDDAQTrailer& setSLinkTransmissionErrorBit(
const bool bitSet);
236 FEDDAQTrailer& setEventStatusNibble(
const uint8_t eventStatusNibble);
239 const bool slinkTransmissionError =
false,
const bool badFEDID =
false,
const bool slinkCRCError =
false,
240 const uint8_t eventStatusNibble = 0);
249 bool slinkFullFlag()
const;
250 bool trackerHeaderMonitorDataReadyFlag()
const;
251 bool qdrMemoryFullFlag()
const;
252 bool qdrMemoryPartialFullFlag()
const;
253 bool qdrMemoryEmptyFlag()
const;
254 bool l1aBxFIFOFullFlag()
const;
255 bool l1aBxFIFOPartialFullFlag()
const;
256 bool l1aBxFIFOEmptyFlag()
const;
259 bool feDataMissingFlag(
const uint8_t internalFEUnitNum)
const;
260 void print(std::ostream& os)
const;
261 void printFlags(std::ostream& os)
const;
262 operator uint16_t ()
const;
270 const bool trackerHeaderMonitorDataReadyFlagSet =
false,
271 const bool slinkFullFlagSet =
false);
274 void setBit(
const uint8_t num,
const bool bitSet);
275 void setQDRMemoryFullFlag(
const bool bitSet);
276 void setQDRMemoryPartialFullFlag(
const bool bitSet);
277 void setQDRMemoryEmptyFlag(
const bool bitSet);
278 void setL1ABXFIFOFullFlag(
const bool bitSet);
279 void setL1ABXFIFOPartialFullFlag(
const bool bitSet);
280 void setL1ABXFIFOEmptyFlag(
const bool bitSet);
290 uint8_t bufferFormatByte()
const;
292 uint8_t headerTypeNibble()
const;
294 uint8_t trackerEventTypeNibble()
const;
297 uint8_t apveAddress()
const;
298 uint8_t apvAddressErrorRegister()
const;
299 bool majorityAddressErrorForFEUnit(
const uint8_t internalFEUnitNum)
const;
300 uint8_t feEnableRegister()
const;
301 bool feEnabled(
const uint8_t internalFEUnitNum)
const;
302 uint8_t feOverflowRegister()
const;
303 bool feOverflow(
const uint8_t internalFEUnitNum)
const;
304 uint16_t fedStatusRegisterWord()
const;
306 void print(std::ostream& os)
const;
309 const uint8_t*
data()
const;
310 bool wasSwapped()
const;
320 TrackerSpecialHeader& setFEOverflowForFEUnit(
const uint8_t internalFEUnitNum,
const bool overflow);
323 const uint8_t address = 0x00,
const uint8_t addressErrorRegister = 0x00,
324 const uint8_t feEnableRegister = 0xFF,
const uint8_t feOverflowRegister = 0x00,
328 void setHeaderTypeNibble(
const uint8_t
value);
329 void setReadoutModeBits(
const uint8_t value);
330 enum byteIndicies { FEDSTATUS=0, FEOVERFLOW=2, FEENABLE=3, ADDRESSERROR=4, APVEADDRESS=5, BUFFERTYPE=6, BUFFERFORMAT=7 };
332 uint8_t specialHeader_[8];
341 bool internalFreezeFlag()
const;
342 bool slinkDownFlag()
const;
343 bool slinkFullFlag()
const;
344 bool backpressureFlag()
const;
345 bool ttcReadyFlag()
const;
346 bool trackerHeaderMonitorDataReadyFlag()
const;
354 void print(std::ostream& os)
const;
355 void printFlags(std::ostream& os)
const;
356 operator uint32_t ()
const;
378 const bool backpressure =
false,
const bool slinkFull =
false,
379 const bool slinkDown =
false,
const bool internalFreeze =
false,
380 const bool trackerHeaderMonitorDataReady =
false,
const bool ttcReady =
true);
383 void setBit(
const uint8_t num,
const bool bitSet);
385 FEDBufferState getBufferState(
const uint8_t bufferPosition)
const;
387 void setBufferSate(
const uint8_t bufferPosition,
const FEDBufferState state);
394 BUFFER_POSITION_FRAME_ADDRESS_FIFO=1,
395 BUFFER_POSITION_TOTAL_LENGTH_FIFO=2,
396 BUFFER_POSITION_TRACKER_HEADER_FIFO=3,
397 BUFFER_POSITION_L1ABX_FIFO=4,
398 BUFFER_POSITION_FE_EVENT_LENGTH_FIFO=5,
399 BUFFER_POSITION_FE_FPGA_BUFFER=6 };
401 STATE_OFFSET_PARTIAL_FULL=16,
402 STATE_OFFSET_EMPTY=24 };
410 static std::unique_ptr<FEDFEHeader> newFEHeader(
const FEDHeaderType headerType,
const uint8_t* headerBuffer);
412 static std::unique_ptr<FEDFEHeader> newFEHeader(
const FEDHeaderType headerType);
414 static std::unique_ptr<FEDFEHeader> newFEFakeHeader(
const FEDHeaderType headerType);
417 virtual size_t lengthInBytes()
const = 0;
420 bool checkChannelStatusBits(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum)
const;
423 bool checkStatusBits(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum,
const uint8_t apvNum)
const;
424 virtual bool checkStatusBits(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const = 0;
425 virtual void print(std::ostream& os)
const = 0;
428 virtual const uint8_t*
data()
const = 0;
430 virtual void setFEUnitMajorityAddress(
const uint8_t internalFEUnitNum,
const uint8_t address) = 0;
432 virtual void setDAQRegister(
const uint32_t daqRegister) = 0;
433 virtual void setDAQRegister2(
const uint32_t daqRegister2) = 0;
434 virtual void set32BitReservedRegister(
const uint8_t internalFEUnitNum,
const uint32_t reservedRegister) = 0;
435 virtual void setFEUnitLength(
const uint8_t internalFEUnitNum,
const uint16_t length) = 0;
436 void setChannelStatus(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum,
const FEDChannelStatus status);
444 size_t lengthInBytes()
const override;
446 bool checkStatusBits(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const override;
447 void print(std::ostream& os)
const override;
450 const uint8_t*
data()
const override;
451 FEDAPVErrorHeader& setAPVStatusBit(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum,
const bool apvGood);
452 FEDAPVErrorHeader& setAPVStatusBit(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum,
const uint8_t apvNum,
const bool apvGood);
457 void setFEUnitMajorityAddress(
const uint8_t internalFEUnitNum,
const uint8_t address)
override;
459 void setDAQRegister(
const uint32_t daqRegister)
override;
460 void setDAQRegister2(
const uint32_t daqRegister2)
override;
461 void set32BitReservedRegister(
const uint8_t internalFEUnitNum,
const uint32_t reservedRegister)
override;
462 void setFEUnitLength(
const uint8_t internalFEUnitNum,
const uint16_t length)
override;
464 static const size_t APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS = 3;
465 static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES = APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS*8;
466 uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES];
474 size_t lengthInBytes()
const override;
476 bool checkStatusBits(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const override;
477 void print(std::ostream& os)
const override;
480 uint8_t feUnitMajorityAddress(
const uint8_t internalFEUnitNum)
const;
482 uint32_t daqRegister()
const;
483 uint32_t daqRegister2()
const;
484 uint16_t feUnitLength(
const uint8_t internalFEUnitNum)
const;
485 bool fePresent(
const uint8_t internalFEUnitNum)
const;
487 FEDChannelStatus getChannelStatus(
const uint8_t internalFEDChannelNum)
const;
488 FEDChannelStatus getChannelStatus(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum)
const;
493 bool unlocked(
const uint8_t internalFEDChannelNum)
const;
494 bool unlocked(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum)
const;
496 bool outOfSync(
const uint8_t internalFEDChannelNum)
const;
497 bool outOfSync(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum)
const;
499 bool apvError(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const;
500 bool apvError(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum,
const uint8_t apvNum)
const;
502 bool apvAddressError(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const;
503 bool apvAddressError(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum,
const uint8_t apvNum)
const;
506 const uint8_t*
data()
const override;
508 void setFEUnitMajorityAddress(
const uint8_t internalFEUnitNum,
const uint8_t address)
override;
510 void setDAQRegister(
const uint32_t daqRegister)
override;
511 void setDAQRegister2(
const uint32_t daqRegister2)
override;
512 void set32BitReservedRegister(
const uint8_t internalFEUnitNum,
const uint32_t reservedRegister)
override;
513 void setFEUnitLength(
const uint8_t internalFEUnitNum,
const uint16_t length)
override;
514 static uint32_t get32BitWordFrom(
const uint8_t* startOfWord);
515 const uint8_t* feWord(
const uint8_t internalFEUnitNum)
const;
516 uint8_t* feWord(
const uint8_t internalFEUnitNum);
518 const std::vector<uint8_t>& feMajorityAddresses = std::vector<uint8_t>(
FEUNITS_PER_FED,0),
521 const uint32_t daqRegister = 0,
const uint32_t daqRegister2 = 0);
523 bool getBit(
const uint8_t internalFEDChannelNum,
const uint8_t bit)
const;
524 static void set32BitWordAt(uint8_t* startOfWord,
const uint32_t
value);
525 void setBit(
const uint8_t internalFEDChannelNum,
const uint8_t bit,
const bool value);
530 bool unlockedFromBit(
const uint8_t internalFEDChannelNum)
const;
531 bool outOfSyncFromBit(
const uint8_t internalFEDChannelNum)
const;
532 bool apvErrorFromBit(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const;
533 bool apvAddressErrorFromBit(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const;
536 void setUnlocked(
const uint8_t internalFEDChannelNum,
const bool value);
537 void setOutOfSync(
const uint8_t internalFEDChannelNum,
const bool value);
538 void setAPVAddressError(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum,
const bool value);
539 void setAPVError(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum,
const bool value);
541 static const size_t FULL_DEBUG_HEADER_SIZE_IN_BYTES = FULL_DEBUG_HEADER_SIZE_IN_64BIT_WORDS*8;
542 uint8_t header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES];
551 FEDChannel(
const uint8_t*
const data,
const size_t offset);
552 uint16_t length()
const;
553 const uint8_t*
data()
const;
555 uint16_t cmMedian(
const uint8_t apvIndex)
const;
557 uint8_t packetCode()
const;
569 FEDBufferBase(
const uint8_t* fedBuffer,
const size_t fedBufferSize,
const bool allowUnrecognizedFormat =
false);
572 void dump(std::ostream& os)
const;
574 void dumpOriginalBuffer(std::ostream& os)
const;
575 virtual void print(std::ostream& os)
const;
582 size_t bufferSize()
const;
586 uint32_t daqLvl1ID()
const;
587 uint16_t daqBXID()
const;
588 uint16_t daqSourceID()
const;
589 uint16_t sourceID()
const;
591 uint32_t daqEventLengthIn64bitWords()
const;
592 uint32_t daqEventLengthInBytes()
const;
593 uint16_t daqCRC()
const;
601 uint8_t apveAddress()
const;
602 bool majorityAddressErrorForFEUnit(
const uint8_t internalFEUnitNum)
const;
603 bool feEnabled(
const uint8_t internalFEUnitNum)
const;
604 uint8_t nFEUnitsEnabled()
const;
605 bool feOverflow(
const uint8_t internalFEUnitNum)
const;
610 bool channelGood(
const uint8_t internalFEUnitNum,
const uint8_t internalChannelNum)
const;
612 const FEDChannel& channel(
const uint8_t internalFEDChannelNum)
const;
613 const FEDChannel& channel(
const uint8_t internalFEUnitNum,
const uint8_t internalChannelNum)
const;
617 bool doTrackerSpecialHeaderChecks()
const;
619 bool doDAQHeaderAndTrailerChecks()
const;
621 virtual bool doChecks()
const;
626 bool checkCRC()
const;
627 bool checkMajorityAddresses()
const;
629 bool checkBufferFormat()
const;
630 bool checkHeaderType()
const;
631 bool checkReadoutMode()
const;
632 bool checkAPVEAddressValid()
const;
633 bool checkNoFEOverflows()
const;
635 bool checkNoSlinkCRCError()
const;
636 bool checkNoSLinkTransmissionError()
const;
637 bool checkSourceIDs()
const;
638 bool checkNoUnexpectedSourceID()
const;
639 bool checkNoExtraHeadersOrTrailers()
const;
640 bool checkLengthFromTrailer()
const;
642 const uint8_t* getPointerToDataAfterTrackerSpecialHeader()
const;
643 const uint8_t* getPointerToByteAfterEndOfPayload()
const;
644 FEDBufferBase(
const uint8_t* fedBuffer,
const size_t fedBufferSize,
const bool allowUnrecognizedFormat,
const bool fillChannelVector);
647 void init(
const uint8_t* fedBuffer,
const size_t fedBufferSize,
const bool allowUnrecognizedFormat);
687 return ( (32 * (readout_order%4)) +
688 (8 * static_cast<uint16_t>(static_cast<float>(readout_order)/4.0)) -
689 (31 * static_cast<uint16_t>(static_cast<float>(readout_order)/16.0))
695 return ( 4*((static_cast<uint16_t>((static_cast<float>(physical_order)/8.0)))%4) +
696 static_cast<uint16_t>(static_cast<float>(physical_order)/32.0) +
697 16*(physical_order%8)
704 : wordSwapped_(
false)
748 return statusRegister;
811 : data_(fedStatusRegister) { }
817 {
return ( (0
x1<<num) & (
data_) ); }
845 return getBit(8+internalFEUnitNum);
852 {
setBit(0,bitSet);
return *
this; }
855 {
setBit(1,bitSet);
return *
this; }
876 const bool trackerHeaderMonitorDataReadyFlagSet,
const bool slinkFullFlagSet)
888 :
data_(backendStatusRegister) { }
897 {
return ( (0
x1<<num) & (
data_) ); }
918 {
setBit(1,bitSet);
return *
this; }
921 {
setBit(2,bitSet);
return *
this; }
924 {
setBit(3,bitSet);
return *
this; }
927 {
setBit(4,bitSet);
return *
this; }
930 {
setBit(6,bitSet);
return *
this; }
933 {
setBit(7,bitSet);
return *
this; }
1016 switch (headerType) {
1022 return std::unique_ptr<FEDFEHeader>();
1028 switch (headerType) {
1034 return std::unique_ptr<FEDFEHeader>();
1040 switch (headerType) {
1046 return std::unique_ptr<FEDFEHeader>();
1067 memcpy(header_,headerBuffer,APV_ERROR_HEADER_SIZE_IN_BYTES);
1071 const uint8_t apvNum,
const bool apvGood)
1073 return setAPVStatusBit(
internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum),apvNum,apvGood);
1078 memcpy(header_,headerBuffer,FULL_DEBUG_HEADER_SIZE_IN_BYTES);
1083 return feWord(internalFEUnitNum)[9];
1093 return get32BitWordFrom(feWord(7)+10);
1098 return get32BitWordFrom(feWord(6)+10);
1103 return ( (feWord(internalFEUnitNum)[15]<<8) | (feWord(internalFEUnitNum)[14]) );
1108 return (feUnitLength(internalFEUnitNum) != 0);
1113 return unlockedFromBit(internalFEDChannelNum);
1123 return ( !unlocked(internalFEDChannelNum) && outOfSyncFromBit(internalFEDChannelNum) );
1133 return ( !unlockedFromBit(internalFEDChannelNum) &&
1134 !outOfSyncFromBit(internalFEDChannelNum) &&
1135 apvErrorFromBit(internalFEDChannelNum,apvNum) );
1145 return ( !unlockedFromBit(internalFEDChannelNum) &&
1146 !outOfSyncFromBit(internalFEDChannelNum) &&
1147 apvAddressErrorFromBit(internalFEDChannelNum,apvNum) );
1162 return !
getBit(internalFEDChannelNum,5);
1167 return !
getBit(internalFEDChannelNum,4);
1178 return !
getBit(internalFEDChannelNum,0+2*(1-apvNum));
1183 return !
getBit(internalFEDChannelNum,1+2*apvNum);
1190 return ( pFEWord[bitInFeWord/8] & (0
x1 << (bitInFeWord%8)) );
1195 return ( startOfWord[0] | (startOfWord[1]<<8) | (startOfWord[2]<<16) | (startOfWord[3]<<24) );
1200 memcpy(startOfWord,&value,4);
1205 return header_+internalFEUnitNum*2*8;
1211 return const_cast<uint8_t*
>(
static_cast<const FEDFullDebugHeader*
>(
this)->feWord(internalFEUnitNum));
1216 setBit(internalFEDChannelNum,5,!value);
1221 setBit(internalFEDChannelNum,4,!value);
1226 setBit(internalFEDChannelNum,1+2*apvNum,!value);
1237 setBit(internalFEDChannelNum,0+2*(1-apvNum),!value);
1244 memcpy(header_,header,8);
1249 return ( (header_[7] & 0xF0) >> 4 );
1254 return (header_[7] & 0x0F);
1259 return ( header_[4] | (header_[5]<<8) | (header_[6]<<16) );
1264 return ( (header_[3]<<4) | ((header_[2]&0xF0)>>4) );
1269 return ( ((header_[2]&0x0F)<<8) | header_[1] );
1274 return ( (header_[0] & 0xF0) >> 4 );
1279 return (header_[0] & 0x8);
1301 memcpy(trailer_,trailer,8);
1306 return ( (trailer_[7] & 0xF0) >> 4 );
1311 return ( trailer_[4] | (trailer_[5]<<8) | (trailer_[6]<<16) );
1316 return eventLengthIn64BitWords()*8;
1321 return ( trailer_[2] | (trailer_[3]<<8) );
1326 return (trailer_[1] & 0x80);
1331 return (trailer_[1] & 0x40);
1336 return (trailer_[1] & 0x0F);
1341 return ( (trailer_[0] & 0xF0) >> 4);
1346 return (trailer_[0] & 0x08);
1351 return (trailer_[0] & 0x04);
1368 printHex(orderedBuffer_,bufferSize_,os);
1373 printHex(originalBuffer_,bufferSize_,os);
1398 return specialHeader_;
1403 return daqHeader_.eventType();
1408 return daqHeader_.l1ID();
1413 return daqHeader_.bxID();
1418 return daqHeader_.sourceID();
1423 return daqTrailer_.eventLengthIn64BitWords();
1428 return daqTrailer_.eventLengthInBytes();
1433 return daqTrailer_.crc();
1438 return daqTrailer_.ttsBits();
1443 return specialHeader_.bufferFormat();
1448 return specialHeader_.headerType();
1453 return specialHeader_.legacyReadoutMode();
1458 return specialHeader_.readoutMode();
1491 return channel(internalFEDChannelNum).packetCode();
1495 return channel(internalFEDChannelNum).packetCode();
1515 return specialHeader_.apveAddress();
1520 return (specialHeader_.majorityAddressErrorForFEUnit(internalFEUnitNum) && (specialHeader_.apveAddress() != 0x00));
1525 return specialHeader_.feEnabled(internalFEUnitNum);
1530 return specialHeader_.feOverflow(internalFEUnitNum);
1535 return specialHeader_.fedStatusRegister();
1555 return ( checkBufferFormat() &&
1556 checkHeaderType() &&
1557 checkReadoutMode() &&
1559 checkNoFEOverflows() );
1564 return ( checkNoSLinkTransmissionError() &&
1566 checkNoUnexpectedSourceID() &&
1567 checkNoExtraHeadersOrTrailers() &&
1568 checkLengthFromTrailer() );
1573 return ( checkNoSlinkCRCError() && (
calcCRC()==daqCRC()) );
1593 return (apveAddress() <= APV_MAX_ADDRESS);
1598 return !specialHeader_.feOverflowRegister();
1603 return !daqTrailer_.slinkCRCError();
1608 return !daqTrailer_.slinkTransmissionError();
1613 return !daqTrailer_.badSourceID();
1618 return ( (daqHeader_.boeNibble() == 0x5) && (daqTrailer_.eoeNibble() == 0xA) );
1623 return (bufferSize() == daqEventLengthInBytes());
1628 return orderedBuffer_+16;
1633 return orderedBuffer_+bufferSize_-8;
1674 #endif //ndef EventFilter_SiStripRawToDigi_FEDBufferComponents_H
static uint8_t physicalOrderForStripInChannel(const uint8_t readoutOrderStripIndexInChannel)
bool checkNoUnexpectedSourceID() const
FEDBackendStatusRegister & setFEFPGABufferState(const FEDBufferState state)
FEDBackendStatusRegister & setQDRMemoryState(const FEDBufferState state)
FEDBackendStatusRegister & setL1ABXFIFOState(const FEDBufferState state)
bool checkNoExtraHeadersOrTrailers() const
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_BOTBOT
bool feDataMissingFlag(const uint8_t internalFEUnitNum) const
bool qdrMemoryPartialFullFlag() const
void setBit(const uint8_t num, const bool bitSet)
bool ttcReadyFlag() const
bool checkReadoutMode() const
bool getBit(const uint8_t num) const
void setQDRMemoryEmptyFlag(const bool bitSet)
uint32_t daqEventLengthIn64bitWords() const
virtual std::string checkSummary() const
uint8_t apveAddress() const
FEDStatusRegister & setTrackerHeaderMonitorDataReadyFlag(const bool bitSet)
FEDBackendStatusRegister & setFrameAddressFIFOState(const FEDBufferState state)
uint32_t daqEventLengthInBytes() const
const uint8_t * getPointerToByteAfterEndOfPayload() const
FEDDAQTrailer daqTrailer() const
static const uint8_t PACKET_CODE_SCOPE
FEDBackendStatusRegister & setTrackerHeaderFIFOState(const FEDBufferState state)
bool slinkDownFlag() const
bool l1aBxFIFOPartialFullFlag() const
void print(std::ostream &os) const
static const uint8_t PACKET_CODE_PROC_RAW10
bool checkHeaderType() const
bool doDAQHeaderAndTrailerChecks() const
uint8_t eoeNibble() const
bool trackerHeaderMonitorDataReadyFlag() const
FEDReadoutMode readoutMode() const
bool getBit(const uint8_t num) const
FEDStatusRegister(const uint16_t fedStatusRegister)
FEDStatusRegister & setSLinkFullFlag(const bool bitSet)
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
void print(std::ostream &os) const
bool checkNoFEOverflows() const
const uint8_t * getPointerToDataAfterTrackerSpecialHeader() const
FEDHeaderType fedHeaderTypeFromString(const std::string &headerTypeString)
uint32_t eventLengthIn64BitWords() const
uint16_t calculateFEDBufferCRC(const uint8_t *buffer, const size_t lengthInBytes)
bool backpressureFlag() const
FEDChannel(const uint8_t *const data, const size_t offset, const uint16_t length)
uint8_t packetCodeFromString(const std::string &packetCodeString, FEDReadoutMode mode)
S & print(S &os, JobReport::InputFile const &f)
std::ostream & operator<<(std::ostream &os, const FEDBufferFormat &value)
bool slinkCRCError() const
FEDBufferFormat fedBufferFormatFromString(const std::string &bufferFormatString)
void setBit(const uint8_t num, const bool bitSet)
FEDDAQEventType daqEventType() const
const uint8_t * orderedBuffer_
void dumpOriginalBuffer(std::ostream &os) const
FEDTTSBits daqTTSState() const
bool checkNoSlinkCRCError() const
bool checkNoSLinkTransmissionError() const
FEDReadoutMode fedReadoutModeFromString(const std::string &readoutModeString)
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED8_TOPBOT
FEDBufferState qdrMemoryState() const
static uint8_t readoutOrderForStripInChannel(const uint8_t physicalOrderStripIndexInChannel)
FEDBufferState frameAddressFIFOState() const
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED10
FEDBackendStatusRegister(const uint32_t backendStatusRegister)
FEDDAQTrailer daqTrailer_
static const uint8_t PACKET_CODE_VIRGIN_RAW10
bool slinkFullFlag() const
const uint8_t * data() const
static const uint8_t PACKET_CODE_ZERO_SUPPRESSED
uint8_t ttsNibble() const
FEDBackendStatusRegister & setTotalLengthFIFOState(const FEDBufferState state)
bool qdrMemoryEmptyFlag() const
bool majorityAddressErrorForFEUnit(const uint8_t internalFEUnitNum) const
FEDBackendStatusRegister & setTTCReadyFlag(const bool bitSet)
FEDStatusRegister & setL1ABXFIFOBufferState(const FEDBufferState state)
static const uint16_t FEUNITS_PER_FED
void print(std::ostream &os) const
FEDLegacyReadoutMode legacyReadoutMode() const
void setQDRMemoryFullFlag(const bool bitSet)
bool feEnabled(const uint8_t internalFEUnitNum) const
FEDBufferState trackerHeaderFIFOState() const
void dump(std::ostream &os) const
void setL1ABXFIFOFullFlag(const bool bitSet)
static const uint8_t BUFFER_FORMAT_CODE_NEW
bool qdrMemoryFullFlag() const
bool internalFreezeFlag() const
FEDHeaderType headerType() const
const uint8_t * originalBuffer_
bool checkAPVEAddressValid() const
static const uint8_t APV_MAX_ADDRESS
uint8_t packetCode(bool legacy=false, const uint8_t internalFEDChannelNum=0) const
void setL1ABXFIFOPartialFullFlag(const bool bitSet)
bool slinkTransmissionError() const
static const uint8_t INVALID
const FEDChannel & channel(const uint8_t internalFEDChannelNum) const
static const uint8_t PACKET_CODE_VIRGIN_RAW8_TOPBOT
FEDDAQEventType fedDAQEventTypeFromString(const std::string &daqEventTypeString)
std::vector< FEDChannel > channels_
void setBit(int &_bitArray, unsigned _iBit)
FEDBufferState getBufferState(const uint8_t bufferPosition) const
bool l1aBxFIFOFullFlag() const
bool l1aBxFIFOEmptyFlag() const
static const uint8_t PACKET_CODE_PROC_RAW
static const uint16_t APVS_PER_FED
static const uint8_t PACKET_CODE_VIRGIN_RAW8_BOTBOT
void printHex(const void *pointer, const size_t length, std::ostream &os)
bool checkBufferFormat() const
static uint8_t physicalOrderForStripInAPV(const uint8_t readoutOrderStripIndexInAPV)
static const uint16_t FEDCH_PER_FEUNIT
Constants and enumerated types for FED/FEC systems.
bool trackerHeaderMonitorDataReadyFlag() const
FEDBackendStatusRegister & setTrackerHeaderMonitorDataReadyFlag(const bool bitSet)
const uint8_t * data() const
TrackerSpecialHeader trackerSpecialHeader() const
size_t bufferSize() const
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
FEDBackendStatusRegister & setSLinkFullFlag(const bool bitSet)
FEDBufferState feFPGABufferState() const
uint8_t packetCode() const
uint32_t daqLvl1ID() const
void setBufferSate(const uint8_t bufferPosition, const FEDBufferState state)
FEDBufferState l1aBxFIFOState() const
TrackerSpecialHeader specialHeader_
void calcCRC(long, int &)
virtual void print(std::ostream &os) const
char data[epos_bytes_allocation]
bool doTrackerSpecialHeaderChecks() const
static const uint16_t FEDCH_PER_FED
static const uint16_t STRIPS_PER_APV
FEDBufferState totalLengthFIFOState() const
bool checkLengthFromTrailer() const
virtual bool channelGood(const uint8_t internalFEDChannelNum) const
bool slinkFullFlag() const
FEDBackendStatusRegister & setFEEventLengthFIFOState(const FEDBufferState state)
static const uint8_t PACKET_CODE_PROC_RAW8_BOTBOT
static const uint8_t BUFFER_FORMAT_CODE_OLD
uint8_t eventStatusNibble() const
static const uint16_t SCOPE_MODE_MAX_SCOPE_LENGTH
static uint8_t readoutOrderForStripInAPV(const uint8_t physicalOrderStripIndexInAPV)
uint16_t daqSourceID() const
FEDStatusRegister & setQDRMemoryBufferState(const FEDBufferState state)
FEDBackendStatusRegister & setInternalFreezeFlag(const bool bitSet)
static const uint8_t PACKET_CODE_PROC_RAW8_TOPBOT
void setL1ABXFIFOEmptyFlag(const bool bitSet)
bool getBit(int &_bitArray, unsigned _iBit)
FEDDAQHeader daqHeader() const
FEDBackendStatusRegister & setBackpressureFlag(const bool bitSet)
static const uint8_t PACKET_CODE_VIRGIN_RAW
bool feOverflow(const uint8_t internalFEUnitNum) const
uint32_t eventLengthInBytes() const
FEDBufferState feEventLengthFIFOState() const
FEDStatusRegister fedStatusRegister() const
void setQDRMemoryPartialFullFlag(const bool bitSet)
FEDBackendStatusRegister & setSLinkDownFlag(const bool bitSet)
FEDBufferFormat bufferFormat() const