Skip to content

Commit 1dce0ee

Browse files
committed
remove redundant #ifdef EDM_ML_DEBUG blocks
1 parent 5828fec commit 1dce0ee

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed

EventFilter/HGCalRawToDigi/src/HGCalUnpacker.cc

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
5252
// Others: big endianness
5353
const auto* const header = reinterpret_cast<const uint64_t*>(fed_data.data());
5454
const auto* const trailer = reinterpret_cast<const uint64_t*>(fed_data.data() + fed_data.size());
55-
#ifdef EDM_ML_DEBUG
5655
LogDebug("[HGCalUnpacker]") << "fedId = " << fedId << ", nwords (64b) = " << std::distance(header, trailer);
57-
#endif
5856
const auto* ptr = header;
5957

6058
// read L1A number from the SLink header
@@ -81,7 +79,6 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
8179
LogDebug("[HGCalUnpacker]") << "@@@\n";
8280
ptr = header;
8381
#endif
84-
8582
// check SLink header (128b)
8683
// sanity check
8784
auto slink_header = *(ptr + 1);
@@ -109,17 +106,12 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
109106
captureblockIdx++) {
110107
// check capture block header (64b)
111108

112-
#ifdef EDM_ML_DEBUG
113109
LogDebug("[HGCalUnpacker]") << "@" << std::setw(8) << std::distance(header, ptr) << ": 0x" << std::hex
114110
<< std::setfill('0') << std::setw(16) << *ptr << std::dec;
115-
#endif
116111
auto cb_header = *ptr;
117-
#ifdef EDM_ML_DEBUG
118112
LogDebug("[HGCalUnpacker]") << "fedId = " << fedId << ", captureblockIdx = " << captureblockIdx
119113
<< ", cb_header = " << std::hex << std::setfill('0') << std::setw(16) << cb_header
120114
<< std::dec;
121-
#endif
122-
123115
// sanity check
124116
if (((cb_header >> (BACKEND_FRAME::CAPTUREBLOCK_RESERVED_POS + 32)) & BACKEND_FRAME::CAPTUREBLOCK_RESERVED_MASK) !=
125117
fedConfig.cbHeaderMarker) {
@@ -131,12 +123,10 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
131123
auto nToEnd = (fed_data.size() / 8 - 2) - std::distance(header, ptr);
132124
if (nToEnd == 1) {
133125
ptr++;
134-
#ifdef EDM_ML_DEBUG
135126
LogDebug("[HGCalUnpacker]")
136127
<< "fedId = " << fedId
137128
<< ", 64b padding word caught before parsing all max capture blocks, captureblockIdx = "
138129
<< captureblockIdx;
139-
#endif
140130
econdPacketInfo.view()[ECONDdenseIdx].exception() = 7;
141131
return (0x1 << hgcaldigi::FEDUnpackingFlags::ErrorCaptureBlockHeader);
142132
}
@@ -156,19 +146,15 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
156146
((cb_header >> (BACKEND_FRAME::CAPTUREBLOCK_EC_POS + 32)) & BACKEND_FRAME::CAPTUREBLOCK_EC_MASK);
157147
uint8_t OrbitCaptureBlock =
158148
((cb_header >> (BACKEND_FRAME::CAPTUREBLOCK_OC_POS + 32)) & BACKEND_FRAME::CAPTUREBLOCK_OC_MASK);
159-
#ifdef EDM_ML_DEBUG
160149
LogDebug("[HGCalUnpacker]") << "CB BX number:" << std::dec << BXCaptureBlock << ", L1A number:" << std::dec
161150
<< (int)L1ACaptureBlock << ", Orbit number:" << std::dec << (int)OrbitCaptureBlock;
162-
#endif
163151
++ptr;
164152

165153
// parse Capture Block body (ECON-Ds)
166154
for (uint32_t econdIdx = 0; econdIdx < HGCalMappingModuleIndexer::maxECONDperCB_; econdIdx++) {
167155
auto econd_pkt_status = (cb_header >> (3 * econdIdx)) & 0b111;
168-
#ifdef EDM_ML_DEBUG
169156
LogDebug("[HGCalUnpacker]") << "fedId = " << fedId << ", captureblockIdx = " << captureblockIdx
170157
<< ", econdIdx = " << econdIdx << ", econd_pkt_status = " << econd_pkt_status;
171-
#endif
172158
if (econd_pkt_status != backend::ECONDPacketStatus::InactiveECOND) {
173159
// always increment the global ECON-D index (unless inactive/unconnected)
174160
globalECONDIdx++;
@@ -188,10 +174,8 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
188174
}
189175

190176
// ECON-D header (two 32b words)
191-
#ifdef EDM_ML_DEBUG
192177
LogDebug("[HGCalUnpacker]") << "@" << std::setw(8) << std::distance(header, ptr) << ": 0x" << std::hex
193178
<< std::setfill('0') << std::setw(16) << *ptr << std::dec;
194-
#endif
195179
auto econd_headers = to_32b_words(ptr);
196180
uint32_t ECONDdenseIdx = moduleIndexer.getIndexForModule(fedId, globalECONDIdx);
197181
econdPacketInfo.view()[ECONDdenseIdx].location() = (uint32_t)(ptr - header);
@@ -207,10 +191,8 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
207191
econdPacketInfo.view()[ECONDdenseIdx].CBBX() = BXCaptureBlock;
208192
econdPacketInfo.view()[ECONDdenseIdx].CBL1A() = L1ACaptureBlock;
209193
econdPacketInfo.view()[ECONDdenseIdx].CBOrbit() = OrbitCaptureBlock;
210-
#ifdef EDM_ML_DEBUG
211194
LogDebug("[HGCalUnpacker]") << "ECON-D BX number:" << std::dec << BXECOND << ", L1A number:" << std::dec
212195
<< (int)L1AECOND << ", Orbit number:" << std::dec << (int)OrbitECOND;
213-
#endif
214196
// sanity check
215197
// ECON-D header marker check
216198
if (((econd_headers[0] >> ECOND_FRAME::HEADER_POS) & ECOND_FRAME::HEADER_MASK) !=
@@ -228,9 +210,7 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
228210

229211
// Compute ECON-D trailer CRC
230212
bool crcvalid = hgcal::econdCRCAnalysis(ptr, 0, econd_payload_length);
231-
#ifdef EDM_ML_DEBUG
232213
LogDebug("[HGCalUnpacker]") << "CRC valid = " << crcvalid;
233-
#endif
234214
++ptr;
235215

236216
if (!crcvalid) {
@@ -261,7 +241,6 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
261241
// forward ptr to the next ECON-D; use integer division with (... + 1) / 2 to round up
262242
ptr += (econd_payload_length + 1) / 2;
263243

264-
#ifdef EDM_ML_DEBUG
265244
LogDebug("[HGCalUnpacker]") << "fedId = " << fedId << ", captureblockIdx = " << captureblockIdx
266245
<< ", econdIdx = " << econdIdx << ", econd_headers = " << std::hex
267246
<< std::setfill('0') << std::setw(8) << econd_headers[0] << " " << econd_headers[1]
@@ -271,7 +250,6 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
271250
<< ", E/B/O = 0b"
272251
<< std::bitset<2>((econd_headers[0] >> ECOND_FRAME::EBO_POS) & ECOND_FRAME::EBO_MASK)
273252
<< ", M = " << ((econd_headers[0] >> ECOND_FRAME::BITM_POS) & 0b1);
274-
#endif
275253
//quality check for ECON-D (check econd_pkt_status here for error in trailer CRC)
276254
if ((((econd_headers[0] >> ECOND_FRAME::HT_POS) & ECOND_FRAME::HT_MASK) >= 0b10) ||
277255
(((econd_headers[0] >> ECOND_FRAME::EBO_POS) & ECOND_FRAME::EBO_MASK) >= 0b10) ||
@@ -289,28 +267,22 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
289267
unsigned iword = 0;
290268
if (!pass_through_mode) {
291269
// Standard ECON-D
292-
#ifdef EDM_ML_DEBUG
293270
LogDebug("[HGCalUnpacker]") << "Standard ECON-D, erxMax = " << erxMax << ", enabledErx = 0b"
294271
<< std::bitset<12>(enabledErx);
295-
#endif
296272
for (uint32_t erxIdx = 0; erxIdx < erxMax; erxIdx++) {
297273
// check if the eRx is enabled
298274
if ((enabledErx >> erxIdx & 1) == 0) {
299275
continue;
300276
}
301-
#ifdef EDM_ML_DEBUG
302277
LogDebug("[HGCalUnpacker]") << "fedId = " << fedId << ", captureblockIdx = " << captureblockIdx
303278
<< ", econdIdx = " << econdIdx << ", erxIdx = " << erxIdx;
304-
#endif
305279
econdPacketInfo.view()[ECONDdenseIdx].cm()(erxIdx, 0) =
306280
(econd_payload[iword] >> ECOND_FRAME::COMMONMODE0_POS) & ECOND_FRAME::COMMONMODE0_MASK;
307281
econdPacketInfo.view()[ECONDdenseIdx].cm()(erxIdx, 1) =
308282
(econd_payload[iword] >> ECOND_FRAME::COMMONMODE1_POS) & ECOND_FRAME::COMMONMODE1_MASK;
309283
// check if the eRx sub-packet is empty (the "F" flag in the eRx sub-packet header)
310284
if (((econd_payload[iword] >> ECOND_FRAME::ERXFORMAT_POS) & ECOND_FRAME::ERXFORMAT_MASK) == 1) {
311-
#ifdef EDM_ML_DEBUG
312285
LogDebug("[HGCalUnpacker]") << "eRxIdx = " << erxIdx << " is empty";
313-
#endif
314286
iword += 1; // length of an empty eRx header (32 bits)
315287
continue; // go to the next eRx
316288
}
@@ -319,10 +291,8 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
319291
uint16_t cmSum = ((econd_payload[iword] >> ECOND_FRAME::COMMONMODE0_POS) & ECOND_FRAME::COMMONMODE0_MASK) +
320292
((econd_payload[iword] >> ECOND_FRAME::COMMONMODE1_POS) & ECOND_FRAME::COMMONMODE1_MASK);
321293
uint64_t erxHeader = ((uint64_t)econd_payload[iword] << 32) | ((uint64_t)econd_payload[iword + 1]);
322-
#ifdef EDM_ML_DEBUG
323294
LogDebug("[HGCalUnpacker]") << "erx_headers = 0x" << std::hex << std::setfill('0') << std::setw(16)
324295
<< erxHeader << ", cmSum = " << std::dec << cmSum;
325-
#endif
326296
iword += 2;
327297

328298
// parse erx body (channel data)
@@ -366,19 +336,15 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
366336
}
367337
} else {
368338
// Passthrough ECON-D
369-
#ifdef EDM_ML_DEBUG
370339
LogDebug("[HGCalUnpacker]") << "Passthrough ECON-D, erxMax = " << erxMax << ", enabledErx = 0b"
371340
<< std::bitset<12>(enabledErx);
372-
#endif
373341
for (uint32_t erxIdx = 0; erxIdx < erxMax; erxIdx++) {
374342
// check if the eRx is enabled
375343
if ((enabledErx >> erxIdx & 1) == 0) {
376344
continue;
377345
}
378-
#ifdef EDM_ML_DEBUG
379346
LogDebug("[HGCalUnpacker]") << "fedId = " << fedId << ", captureblockIdx = " << captureblockIdx
380347
<< ", econdIdx = " << econdIdx << ", erxIdx=" << erxIdx;
381-
#endif
382348

383349
econdPacketInfo.view()[ECONDdenseIdx].cm()(erxIdx, 0) =
384350
(econd_payload[iword] >> ECOND_FRAME::COMMONMODE0_POS) & ECOND_FRAME::COMMONMODE0_MASK;
@@ -395,10 +361,8 @@ uint16_t HGCalUnpacker::parseFEDData(unsigned fedId,
395361
uint16_t cmSum = ((econd_payload[iword] >> ECOND_FRAME::COMMONMODE0_POS) & ECOND_FRAME::COMMONMODE0_MASK) +
396362
((econd_payload[iword] >> ECOND_FRAME::COMMONMODE1_POS) & ECOND_FRAME::COMMONMODE1_MASK);
397363
uint64_t erxHeader = ((uint64_t)econd_payload[iword] << 32) | ((uint64_t)econd_payload[iword + 1]);
398-
#ifdef EDM_ML_DEBUG
399364
LogDebug("[HGCalUnpacker]") << "erx_headers = 0x" << std::hex << std::setfill('0') << std::setw(16)
400365
<< erxHeader << ", cmSum = " << std::dec << cmSum;
401-
#endif
402366
iword += 2;
403367

404368
// parse erx body (channel data)

0 commit comments

Comments
 (0)