10 : buffer_(fedBuffer), bufferSize_(fedBufferSize) {
11 LogTrace(
"Phase2TrackerFEDBuffer") <<
"content of buffer with size: " <<
int(fedBufferSize) << std::endl;
12 for (
size_t i = 0;
i < fedBufferSize;
i += 8) {
14 LogTrace(
"Phase2TrackerFEDBuffer") <<
" word " << std::setfill(
' ') << std::setw(2) <<
i / 8 <<
" | " << std::hex
15 << std::setw(16) << std::setfill(
'0') <<
word <<
std::dec << std::endl;
17 LogTrace(
"Phase2TrackerFEDBuffer") << std::endl;
43 size_t offsetBeginningOfChannel = 0;
46 std::vector<bool>::iterator FE_it;
50 for (FE_it =
status.begin(); FE_it <
status.end(); FE_it++) {
54 uint16_t cbc_status =
static_cast<uint16_t
>(*(
payloadPointer_ + (offsetBeginningOfChannel ^ 7)) << 8);
55 cbc_status +=
static_cast<uint16_t
>(*(
payloadPointer_ + ((offsetBeginningOfChannel + 1) ^ 7)));
61 if ((cbc_status >>
i) & 0x1) {
76 for (FE_it =
status.begin(); FE_it <
status.end(); FE_it++) {
80 uint8_t n_clusters =
static_cast<uint8_t
>(*(
payloadPointer_ + offsetBeginningOfChannel));
81 offsetBeginningOfChannel += 1;
85 offsetBeginningOfChannel += 2 * n_clusters;
97 int words64 = (offsetBeginningOfChannel + 8 - 1) / 8;
98 int payloadSize = words64 * 8;
109 if (bufferDiff <= 0) {
110 std::ostringstream
ss;
111 ss <<
"[Phase2Tracker::Phase2TrackerFEDBuffer::" << __func__ <<
"] " 113 ss <<
"FED Buffer Size does not match data => missing condition data? : " 117 ss <<
"Computed Buffer Size " <<
bufferSize_ + bufferDiff <<
" bytes" 125 if (bufferDiff != 0) {
126 std::ostringstream
ss;
127 ss <<
"[Phase2Tracker::Phase2TrackerFEDBuffer::" << __func__ <<
"] " 129 ss <<
"FED Buffer Size does not match data => corrupted buffer? : " 133 ss <<
"Computed Buffer Size " <<
bufferSize_ + bufferDiff <<
" bytes" 141 std::map<uint32_t, uint32_t> cdata;
150 size = *
reinterpret_cast<const uint32_t*
>(pointer);
151 LogTrace(
"Phase2TrackerFEDBuffer") <<
"Condition Data size = " << size << std::endl;
154 while (pointer < stop) {
159 data = *
reinterpret_cast<const uint32_t*
>(pointer);
163 for (
int i = 0,
j = 3;
i < 4;
i++,
j--) {
164 key += (*(pointer +
i) <<
j * 8);
171 if (cdata.size() != size) {
172 std::ostringstream
ss;
173 ss <<
"[Phase2Tracker::Phase2TrackerFEDBuffer::" << __func__ <<
"] " 175 ss <<
"Number of condition data does not match the announced value!" 177 ss <<
"Expected condition data Size " << size <<
" entries" 179 ss <<
"Computed condition data Size " << cdata.size() <<
" entries"
const uint8_t * condDataPointer_
static const int TRIGGER_SIZE
const uint8_t * getPointerToPayload() const
const uint8_t * payloadPointer_
Phase2TrackerFEDHeader trackerHeader_
static const int MAX_CBC_PER_FE
key
prepare the HTCondor submission files and eventually submit them
const uint8_t * triggerPointer_
std::vector< Phase2TrackerFEDChannel > channels_
unsigned long long uint64_t
Phase2TrackerFEDBuffer(const uint8_t *fedBuffer, const size_t fedBufferSize)
~Phase2TrackerFEDBuffer()
char data[epos_bytes_allocation]
FEDDAQTrailer daqTrailer_
std::map< uint32_t, uint32_t > conditionData() const
static const int STRIPS_PER_CBC
FEDReadoutMode readoutMode() const
static const int MAX_FE_PER_FED
static const int STRIPS_PADDING
uint64_t read64(int offset, const uint8_t *buffer)