1 #ifndef EventFilter_SiStripRawToDigi_SiStripFEDBufferComponents_H 2 #define EventFilter_SiStripRawToDigi_SiStripFEDBufferComponents_H 4 #include "boost/cstdint.hpp" 137 uint8_t
internalFEDChannelNum(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum);
138 void printHex(
const void* pointer,
const size_t length, std::ostream& os);
180 uint8_t boeNibble()
const;
181 uint8_t eventTypeNibble()
const;
183 uint32_t l1ID()
const;
184 uint16_t bxID()
const;
185 uint16_t sourceID()
const;
189 bool lastHeader()
const;
190 void print(std::ostream& os)
const;
192 const uint8_t*
data()
const;
197 FEDDAQHeader(
const uint32_t l1ID,
const uint16_t bxID,
const uint16_t sourceID,
210 uint8_t eoeNibble()
const;
211 uint32_t eventLengthIn64BitWords()
const;
212 uint32_t eventLengthInBytes()
const;
213 uint16_t crc()
const;
220 uint8_t eventStatusNibble()
const;
221 uint8_t ttsNibble()
const;
229 void print(std::ostream& os)
const;
231 const uint8_t*
data()
const;
232 FEDDAQTrailer& setEventLengthIn64BitWords(
const uint32_t eventLengthIn64BitWords);
234 FEDDAQTrailer& setSLinkTransmissionErrorBit(
const bool bitSet);
237 FEDDAQTrailer& setEventStatusNibble(
const uint8_t eventStatusNibble);
240 const bool slinkTransmissionError =
false,
const bool badFEDID =
false,
const bool slinkCRCError =
false,
241 const uint8_t eventStatusNibble = 0);
250 bool slinkFullFlag()
const;
251 bool trackerHeaderMonitorDataReadyFlag()
const;
252 bool qdrMemoryFullFlag()
const;
253 bool qdrMemoryPartialFullFlag()
const;
254 bool qdrMemoryEmptyFlag()
const;
255 bool l1aBxFIFOFullFlag()
const;
256 bool l1aBxFIFOPartialFullFlag()
const;
257 bool l1aBxFIFOEmptyFlag()
const;
260 bool feDataMissingFlag(
const uint8_t internalFEUnitNum)
const;
261 void print(std::ostream& os)
const;
262 void printFlags(std::ostream& os)
const;
263 operator uint16_t ()
const;
271 const bool trackerHeaderMonitorDataReadyFlagSet =
false,
272 const bool slinkFullFlagSet =
false);
275 void setBit(
const uint8_t num,
const bool bitSet);
276 void setQDRMemoryFullFlag(
const bool bitSet);
277 void setQDRMemoryPartialFullFlag(
const bool bitSet);
278 void setQDRMemoryEmptyFlag(
const bool bitSet);
279 void setL1ABXFIFOFullFlag(
const bool bitSet);
280 void setL1ABXFIFOPartialFullFlag(
const bool bitSet);
281 void setL1ABXFIFOEmptyFlag(
const bool bitSet);
291 uint8_t bufferFormatByte()
const;
293 uint8_t headerTypeNibble()
const;
295 uint8_t trackerEventTypeNibble()
const;
298 uint8_t apveAddress()
const;
299 uint8_t apvAddressErrorRegister()
const;
300 bool majorityAddressErrorForFEUnit(
const uint8_t internalFEUnitNum)
const;
301 uint8_t feEnableRegister()
const;
302 bool feEnabled(
const uint8_t internalFEUnitNum)
const;
303 uint8_t feOverflowRegister()
const;
304 bool feOverflow(
const uint8_t internalFEUnitNum)
const;
305 uint16_t fedStatusRegisterWord()
const;
307 void print(std::ostream& os)
const;
310 const uint8_t*
data()
const;
311 bool wasSwapped()
const;
321 TrackerSpecialHeader& setFEOverflowForFEUnit(
const uint8_t internalFEUnitNum,
const bool overflow);
324 const uint8_t address = 0x00,
const uint8_t addressErrorRegister = 0x00,
325 const uint8_t feEnableRegister = 0xFF,
const uint8_t feOverflowRegister = 0x00,
329 void setHeaderTypeNibble(
const uint8_t
value);
330 void setReadoutModeBits(
const uint8_t value);
331 enum byteIndicies { FEDSTATUS=0, FEOVERFLOW=2, FEENABLE=3, ADDRESSERROR=4, APVEADDRESS=5, BUFFERTYPE=6, BUFFERFORMAT=7 };
333 uint8_t specialHeader_[8];
342 bool internalFreezeFlag()
const;
343 bool slinkDownFlag()
const;
344 bool slinkFullFlag()
const;
345 bool backpressureFlag()
const;
346 bool ttcReadyFlag()
const;
347 bool trackerHeaderMonitorDataReadyFlag()
const;
355 void print(std::ostream& os)
const;
356 void printFlags(std::ostream& os)
const;
357 operator uint32_t ()
const;
379 const bool backpressure =
false,
const bool slinkFull =
false,
380 const bool slinkDown =
false,
const bool internalFreeze =
false,
381 const bool trackerHeaderMonitorDataReady =
false,
const bool ttcReady =
true);
384 void setBit(
const uint8_t num,
const bool bitSet);
386 FEDBufferState getBufferState(
const uint8_t bufferPosition)
const;
388 void setBufferSate(
const uint8_t bufferPosition,
const FEDBufferState state);
395 BUFFER_POSITION_FRAME_ADDRESS_FIFO=1,
396 BUFFER_POSITION_TOTAL_LENGTH_FIFO=2,
397 BUFFER_POSITION_TRACKER_HEADER_FIFO=3,
398 BUFFER_POSITION_L1ABX_FIFO=4,
399 BUFFER_POSITION_FE_EVENT_LENGTH_FIFO=5,
400 BUFFER_POSITION_FE_FPGA_BUFFER=6 };
402 STATE_OFFSET_PARTIAL_FULL=16,
403 STATE_OFFSET_EMPTY=24 };
411 static std::unique_ptr<FEDFEHeader> newFEHeader(
const FEDHeaderType headerType,
const uint8_t* headerBuffer);
413 static std::unique_ptr<FEDFEHeader> newFEHeader(
const FEDHeaderType headerType);
415 static std::unique_ptr<FEDFEHeader> newFEFakeHeader(
const FEDHeaderType headerType);
418 virtual size_t lengthInBytes()
const = 0;
421 bool checkChannelStatusBits(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum)
const;
424 bool checkStatusBits(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum,
const uint8_t apvNum)
const;
425 virtual bool checkStatusBits(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const = 0;
426 virtual void print(std::ostream& os)
const = 0;
429 virtual const uint8_t*
data()
const = 0;
431 virtual void setFEUnitMajorityAddress(
const uint8_t internalFEUnitNum,
const uint8_t address) = 0;
433 virtual void setDAQRegister(
const uint32_t daqRegister) = 0;
434 virtual void setDAQRegister2(
const uint32_t daqRegister2) = 0;
435 virtual void set32BitReservedRegister(
const uint8_t internalFEUnitNum,
const uint32_t reservedRegister) = 0;
436 virtual void setFEUnitLength(
const uint8_t internalFEUnitNum,
const uint16_t length) = 0;
437 void setChannelStatus(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum,
const FEDChannelStatus status);
445 size_t lengthInBytes()
const override;
447 bool checkStatusBits(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const override;
448 void print(std::ostream& os)
const override;
451 const uint8_t*
data()
const override;
452 FEDAPVErrorHeader& setAPVStatusBit(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum,
const bool apvGood);
453 FEDAPVErrorHeader& setAPVStatusBit(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum,
const uint8_t apvNum,
const bool apvGood);
458 void setFEUnitMajorityAddress(
const uint8_t internalFEUnitNum,
const uint8_t address)
override;
460 void setDAQRegister(
const uint32_t daqRegister)
override;
461 void setDAQRegister2(
const uint32_t daqRegister2)
override;
462 void set32BitReservedRegister(
const uint8_t internalFEUnitNum,
const uint32_t reservedRegister)
override;
463 void setFEUnitLength(
const uint8_t internalFEUnitNum,
const uint16_t length)
override;
465 static const size_t APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS = 3;
466 static const size_t APV_ERROR_HEADER_SIZE_IN_BYTES = APV_ERROR_HEADER_SIZE_IN_64BIT_WORDS*8;
467 uint8_t header_[APV_ERROR_HEADER_SIZE_IN_BYTES];
475 size_t lengthInBytes()
const override;
477 bool checkStatusBits(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const override;
478 void print(std::ostream& os)
const override;
481 uint8_t feUnitMajorityAddress(
const uint8_t internalFEUnitNum)
const;
483 uint32_t daqRegister()
const;
484 uint32_t daqRegister2()
const;
485 uint16_t feUnitLength(
const uint8_t internalFEUnitNum)
const;
486 bool fePresent(
const uint8_t internalFEUnitNum)
const;
488 FEDChannelStatus getChannelStatus(
const uint8_t internalFEDChannelNum)
const;
489 FEDChannelStatus getChannelStatus(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum)
const;
494 bool unlocked(
const uint8_t internalFEDChannelNum)
const;
495 bool unlocked(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum)
const;
497 bool outOfSync(
const uint8_t internalFEDChannelNum)
const;
498 bool outOfSync(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum)
const;
500 bool apvError(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const;
501 bool apvError(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum,
const uint8_t apvNum)
const;
503 bool apvAddressError(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const;
504 bool apvAddressError(
const uint8_t internalFEUnitNum,
const uint8_t internalFEUnitChannelNum,
const uint8_t apvNum)
const;
507 const uint8_t*
data()
const override;
509 void setFEUnitMajorityAddress(
const uint8_t internalFEUnitNum,
const uint8_t address)
override;
511 void setDAQRegister(
const uint32_t daqRegister)
override;
512 void setDAQRegister2(
const uint32_t daqRegister2)
override;
513 void set32BitReservedRegister(
const uint8_t internalFEUnitNum,
const uint32_t reservedRegister)
override;
514 void setFEUnitLength(
const uint8_t internalFEUnitNum,
const uint16_t length)
override;
515 static uint32_t get32BitWordFrom(
const uint8_t* startOfWord);
516 const uint8_t* feWord(
const uint8_t internalFEUnitNum)
const;
517 uint8_t* feWord(
const uint8_t internalFEUnitNum);
519 const std::vector<uint8_t>& feMajorityAddresses = std::vector<uint8_t>(
FEUNITS_PER_FED,0),
522 const uint32_t daqRegister = 0,
const uint32_t daqRegister2 = 0);
524 bool getBit(
const uint8_t internalFEDChannelNum,
const uint8_t bit)
const;
525 static void set32BitWordAt(uint8_t* startOfWord,
const uint32_t
value);
526 void setBit(
const uint8_t internalFEDChannelNum,
const uint8_t bit,
const bool value);
531 bool unlockedFromBit(
const uint8_t internalFEDChannelNum)
const;
532 bool outOfSyncFromBit(
const uint8_t internalFEDChannelNum)
const;
533 bool apvErrorFromBit(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const;
534 bool apvAddressErrorFromBit(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum)
const;
537 void setUnlocked(
const uint8_t internalFEDChannelNum,
const bool value);
538 void setOutOfSync(
const uint8_t internalFEDChannelNum,
const bool value);
539 void setAPVAddressError(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum,
const bool value);
540 void setAPVError(
const uint8_t internalFEDChannelNum,
const uint8_t apvNum,
const bool value);
542 static const size_t FULL_DEBUG_HEADER_SIZE_IN_BYTES = FULL_DEBUG_HEADER_SIZE_IN_64BIT_WORDS*8;
543 uint8_t header_[FULL_DEBUG_HEADER_SIZE_IN_BYTES];
552 FEDChannel(
const uint8_t*
const data,
const size_t offset);
553 uint16_t length()
const;
554 const uint8_t*
data()
const;
556 uint16_t cmMedian(
const uint8_t apvIndex)
const;
558 uint8_t packetCode()
const;
570 FEDBufferBase(
const uint8_t* fedBuffer,
const size_t fedBufferSize,
const bool allowUnrecognizedFormat =
false);
573 void dump(std::ostream& os)
const;
575 void dumpOriginalBuffer(std::ostream& os)
const;
576 virtual void print(std::ostream& os)
const;
583 size_t bufferSize()
const;
587 uint32_t daqLvl1ID()
const;
588 uint16_t daqBXID()
const;
589 uint16_t daqSourceID()
const;
590 uint16_t sourceID()
const;
592 uint32_t daqEventLengthIn64bitWords()
const;
593 uint32_t daqEventLengthInBytes()
const;
594 uint16_t daqCRC()
const;
602 uint8_t apveAddress()
const;
603 bool majorityAddressErrorForFEUnit(
const uint8_t internalFEUnitNum)
const;
604 bool feEnabled(
const uint8_t internalFEUnitNum)
const;
605 uint8_t nFEUnitsEnabled()
const;
606 bool feOverflow(
const uint8_t internalFEUnitNum)
const;
611 bool channelGood(
const uint8_t internalFEUnitNum,
const uint8_t internalChannelNum)
const;
613 const FEDChannel& channel(
const uint8_t internalFEDChannelNum)
const;
614 const FEDChannel& channel(
const uint8_t internalFEUnitNum,
const uint8_t internalChannelNum)
const;
618 bool doTrackerSpecialHeaderChecks()
const;
620 bool doDAQHeaderAndTrailerChecks()
const;
622 virtual bool doChecks()
const;
627 bool checkCRC()
const;
628 bool checkMajorityAddresses()
const;
630 bool checkBufferFormat()
const;
631 bool checkHeaderType()
const;
632 bool checkReadoutMode()
const;
633 bool checkAPVEAddressValid()
const;
634 bool checkNoFEOverflows()
const;
636 bool checkNoSlinkCRCError()
const;
637 bool checkNoSLinkTransmissionError()
const;
638 bool checkSourceIDs()
const;
639 bool checkNoUnexpectedSourceID()
const;
640 bool checkNoExtraHeadersOrTrailers()
const;
641 bool checkLengthFromTrailer()
const;
643 const uint8_t* getPointerToDataAfterTrackerSpecialHeader()
const;
644 const uint8_t* getPointerToByteAfterEndOfPayload()
const;
645 FEDBufferBase(
const uint8_t* fedBuffer,
const size_t fedBufferSize,
const bool allowUnrecognizedFormat,
const bool fillChannelVector);
648 void init(
const uint8_t* fedBuffer,
const size_t fedBufferSize,
const bool allowUnrecognizedFormat);
688 return ( (32 * (readout_order%4)) +
689 (8 * static_cast<uint16_t>(static_cast<float>(readout_order)/4.0)) -
690 (31 * static_cast<uint16_t>(static_cast<float>(readout_order)/16.0))
696 return ( 4*((static_cast<uint16_t>((static_cast<float>(physical_order)/8.0)))%4) +
697 static_cast<uint16_t>(static_cast<float>(physical_order)/32.0) +
698 16*(physical_order%8)
705 : wordSwapped_(
false)
749 return statusRegister;
812 : data_(fedStatusRegister) { }
818 {
return ( (0
x1<<num) & (
data_) ); }
846 return getBit(8+internalFEUnitNum);
853 {
setBit(0,bitSet);
return *
this; }
856 {
setBit(1,bitSet);
return *
this; }
877 const bool trackerHeaderMonitorDataReadyFlagSet,
const bool slinkFullFlagSet)
889 :
data_(backendStatusRegister) { }
898 {
return ( (0
x1<<num) & (
data_) ); }
919 {
setBit(1,bitSet);
return *
this; }
922 {
setBit(2,bitSet);
return *
this; }
925 {
setBit(3,bitSet);
return *
this; }
928 {
setBit(4,bitSet);
return *
this; }
931 {
setBit(6,bitSet);
return *
this; }
934 {
setBit(7,bitSet);
return *
this; }
1017 switch (headerType) {
1023 return std::unique_ptr<FEDFEHeader>();
1029 switch (headerType) {
1035 return std::unique_ptr<FEDFEHeader>();
1041 switch (headerType) {
1047 return std::unique_ptr<FEDFEHeader>();
1068 memcpy(header_,headerBuffer,APV_ERROR_HEADER_SIZE_IN_BYTES);
1072 const uint8_t apvNum,
const bool apvGood)
1074 return setAPVStatusBit(
internalFEDChannelNum(internalFEUnitNum,internalFEUnitChannelNum),apvNum,apvGood);
1079 memcpy(header_,headerBuffer,FULL_DEBUG_HEADER_SIZE_IN_BYTES);
1084 return feWord(internalFEUnitNum)[9];
1094 return get32BitWordFrom(feWord(7)+10);
1099 return get32BitWordFrom(feWord(6)+10);
1104 return ( (feWord(internalFEUnitNum)[15]<<8) | (feWord(internalFEUnitNum)[14]) );
1109 return (feUnitLength(internalFEUnitNum) != 0);
1114 return unlockedFromBit(internalFEDChannelNum);
1124 return ( !unlocked(internalFEDChannelNum) && outOfSyncFromBit(internalFEDChannelNum) );
1134 return ( !unlockedFromBit(internalFEDChannelNum) &&
1135 !outOfSyncFromBit(internalFEDChannelNum) &&
1136 apvErrorFromBit(internalFEDChannelNum,apvNum) );
1146 return ( !unlockedFromBit(internalFEDChannelNum) &&
1147 !outOfSyncFromBit(internalFEDChannelNum) &&
1148 apvAddressErrorFromBit(internalFEDChannelNum,apvNum) );
1163 return !
getBit(internalFEDChannelNum,5);
1168 return !
getBit(internalFEDChannelNum,4);
1179 return !
getBit(internalFEDChannelNum,0+2*(1-apvNum));
1184 return !
getBit(internalFEDChannelNum,1+2*apvNum);
1191 return ( pFEWord[bitInFeWord/8] & (0
x1 << (bitInFeWord%8)) );
1196 return ( startOfWord[0] | (startOfWord[1]<<8) | (startOfWord[2]<<16) | (startOfWord[3]<<24) );
1201 memcpy(startOfWord,&value,4);
1206 return header_+internalFEUnitNum*2*8;
1212 return const_cast<uint8_t*
>(
static_cast<const FEDFullDebugHeader*
>(
this)->feWord(internalFEUnitNum));
1217 setBit(internalFEDChannelNum,5,!value);
1222 setBit(internalFEDChannelNum,4,!value);
1227 setBit(internalFEDChannelNum,1+2*apvNum,!value);
1238 setBit(internalFEDChannelNum,0+2*(1-apvNum),!value);
1245 memcpy(header_,header,8);
1250 return ( (header_[7] & 0xF0) >> 4 );
1255 return (header_[7] & 0x0F);
1260 return ( header_[4] | (header_[5]<<8) | (header_[6]<<16) );
1265 return ( (header_[3]<<4) | ((header_[2]&0xF0)>>4) );
1270 return ( ((header_[2]&0x0F)<<8) | header_[1] );
1275 return ( (header_[0] & 0xF0) >> 4 );
1280 return (header_[0] & 0x8);
1302 memcpy(trailer_,trailer,8);
1307 return ( (trailer_[7] & 0xF0) >> 4 );
1312 return ( trailer_[4] | (trailer_[5]<<8) | (trailer_[6]<<16) );
1317 return eventLengthIn64BitWords()*8;
1322 return ( trailer_[2] | (trailer_[3]<<8) );
1327 return (trailer_[1] & 0x80);
1332 return (trailer_[1] & 0x40);
1337 return (trailer_[1] & 0x0F);
1342 return ( (trailer_[0] & 0xF0) >> 4);
1347 return (trailer_[0] & 0x08);
1352 return (trailer_[0] & 0x04);
1369 printHex(orderedBuffer_,bufferSize_,os);
1374 printHex(originalBuffer_,bufferSize_,os);
1399 return specialHeader_;
1404 return daqHeader_.eventType();
1409 return daqHeader_.l1ID();
1414 return daqHeader_.bxID();
1419 return daqHeader_.sourceID();
1424 return daqTrailer_.eventLengthIn64BitWords();
1429 return daqTrailer_.eventLengthInBytes();
1434 return daqTrailer_.crc();
1439 return daqTrailer_.ttsBits();
1444 return specialHeader_.bufferFormat();
1449 return specialHeader_.headerType();
1454 return specialHeader_.legacyReadoutMode();
1459 return specialHeader_.readoutMode();
1492 return channel(internalFEDChannelNum).packetCode();
1496 return channel(internalFEDChannelNum).packetCode();
1516 return specialHeader_.apveAddress();
1521 return (specialHeader_.majorityAddressErrorForFEUnit(internalFEUnitNum) && (specialHeader_.apveAddress() != 0x00));
1526 return specialHeader_.feEnabled(internalFEUnitNum);
1531 return specialHeader_.feOverflow(internalFEUnitNum);
1536 return specialHeader_.fedStatusRegister();
1556 return ( checkBufferFormat() &&
1557 checkHeaderType() &&
1558 checkReadoutMode() &&
1560 checkNoFEOverflows() );
1565 return ( checkNoSLinkTransmissionError() &&
1567 checkNoUnexpectedSourceID() &&
1568 checkNoExtraHeadersOrTrailers() &&
1569 checkLengthFromTrailer() );
1574 return ( checkNoSlinkCRCError() && (
calcCRC()==daqCRC()) );
1594 return (apveAddress() <= APV_MAX_ADDRESS);
1599 return !specialHeader_.feOverflowRegister();
1604 return !daqTrailer_.slinkCRCError();
1609 return !daqTrailer_.slinkTransmissionError();
1614 return !daqTrailer_.badSourceID();
1619 return ( (daqHeader_.boeNibble() == 0x5) && (daqTrailer_.eoeNibble() == 0xA) );
1624 return (bufferSize() == daqEventLengthInBytes());
1629 return orderedBuffer_+16;
1634 return orderedBuffer_+bufferSize_-8;
1675 #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