10 payloadPointer_(getPointerToDataAfterTrackerSpecialHeader()+16),
11 payloadLength_(getPointerToByteAfterEndOfPayload()-payloadPointer_),
12 versionId_(*(getPointerToDataAfterTrackerSpecialHeader()+3))
16 throw cms::Exception(
"FEDSpyBuffer") <<
"Buffer is not from spy channel";
31 size_t delayChipStartByteIndex = 0;
35 throw cms::Exception(
"FEDSpyBuffer") <<
"Delay chip " << uint16_t(iDelayChip) <<
" does not fit into buffer. "
36 <<
"Buffer size is " <<
bufferSize() <<
" delay chip data starts at " << delayChipStartByteIndex+8+8+8+8 <<
". ";
40 const uint8_t fedCh = iDelayChip*FEDCH_PER_DELAY_CHIP +
i;
55 result |= runNumberPointer[0];
56 result |= (uint32_t(runNumberPointer[1]) << 8);
57 result |= (uint32_t(runNumberPointer[2]) << 16);
58 result |= (uint32_t(runNumberPointer[3]) << 24);
69 result |= spyCounters[4];
70 result |= (uint32_t(spyCounters[5]) << 8);
71 result |= (uint32_t(spyCounters[6]) << 16);
72 result |= (uint32_t(spyCounters[7]) << 24);
83 result |= spyCounters[0];
84 result |= (uint32_t(spyCounters[1]) << 8);
85 result |= (uint32_t(spyCounters[2]) << 16);
86 result |= (uint32_t(spyCounters[3]) << 24);
94 result |= delayChipCounters[4];
95 result |= (uint32_t(delayChipCounters[5]) << 8);
96 result |= (uint32_t(delayChipCounters[6]) << 16);
97 result |= (uint32_t(delayChipCounters[7]) << 24);
105 result |= delayChipCounters[0];
106 result |= (uint32_t(delayChipCounters[1]) << 8);
107 result |= (uint32_t(delayChipCounters[2]) << 16);
108 result |= (uint32_t(delayChipCounters[3]) << 24);
121 if (delayChip == 0)
return true;
123 uint32_t l1CountBefore = 0;
124 uint32_t totalEventCountBefore = 0;
125 if (delayChip == 0) {
134 const bool eventMatches = ( (l1CountBefore == l1CountAfter) && (totalEventCountBefore == totalEventCountAfter) );
136 std::ostringstream ss;
137 ss <<
"Delay chip data was overwritten on chip " << uint16_t(delayChip)
138 <<
" L1A before: " << l1CountBefore <<
" after: " << l1CountAfter
139 <<
" Total event count before: " << totalEventCountBefore <<
" after: " << totalEventCountAfter << std::endl;
158 if (offsetBits < 23) {
159 return ( (
data_[offsetWords]>>(32-10-offsetBits)) & 0x3FF );
161 return ( ((
data_[offsetWords]<<(10-32+offsetBits))&0x3FF) | ((
data_[offsetWords+1]&(0xFFC00000<<(32-offsetBits)))>>(64-10-offsetBits)) );
FEDReadoutMode readoutMode() const
uint8_t internalFEDChannelNum(const uint8_t internalFEUnitNum, const uint8_t internalFEUnitChannelNum)
static const uint16_t SPY_SAMPLES_PER_CHANNEL
const uint8_t * getPointerToDataAfterTrackerSpecialHeader() const
virtual void print(std::ostream &os) const
uint32_t globalRunNumber() const
static const uint16_t DELAY_CHIPS_PER_FED
void dump(std::ostream &os) const
uint32_t delayChipTotalEventCount(const uint8_t delayChip) const
uint32_t spyHeaderL1ID() const
std::vector< FEDChannel > channels_
static const uint16_t FEDCH_PER_DELAY_CHIP
static const uint16_t SPY_DELAY_CHIP_BUFFER_SIZE_IN_BYTES
const uint8_t * payloadPointer_
static const uint8_t channelPositionsInData_[FEDCH_PER_DELAY_CHIP]
FEDSpyBuffer(const uint8_t *fedBuffer, const size_t fedBufferSize)
uint32_t spyHeaderTotalEventCount() const
size_t bufferSize() const
virtual void print(std::ostream &os) const
uint32_t delayChipL1ID(const uint8_t delayChip) const
volatile std::atomic< bool > shutdown_flag false
bool delayChipGood(const uint8_t delayChip) const
static const uint16_t SPY_DELAYCHIP_DATA_OFFSET_IN_BITS
virtual bool channelGood(const uint8_t internalFEDannelNum) const