1 #ifndef UCTDAQRawData_hh
2 #define UCTDAQRawData_hh
15 if ((
d[0] & 0x5000000000000000) != 0x5000000000000000) {
16 edm::LogError(
"UCTDAQRawData") <<
"CDF Header does not seem to be correct" << std::showbase << std::internal
17 << std::setfill(
'0') << std::setw(10) << std::hex <<
d[0] <<
"; but continuing!"
31 uint32_t
FOV() {
return ((
myDataPtr[0] & 0x00000000000000F0) >> 4); }
44 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch board ID for AMC = " <<
amc
45 <<
"; Max AMC = " <<
nAMCs() << std::endl;
51 return ((
myDataPtr[2 +
amc] & 0x00000000000F0000) >> 16);
53 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch amc no for AMC = " <<
amc
54 <<
"; Max AMC = " <<
nAMCs() << std::endl;
60 return ((
myDataPtr[2 +
amc] & 0x000000000FF00000) >> 20);
62 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch amc block no for AMC = " <<
amc
63 <<
"; Max AMC = " <<
nAMCs() << std::endl;
69 return ((
myDataPtr[2 +
amc] & 0x00FFFFFF00000000) >> 32);
71 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch amc size for AMC = " <<
amc
72 <<
"; Max AMC = " <<
nAMCs() << std::endl;
80 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch crcError-bit for AMC = " <<
amc
81 <<
"; Max AMC = " <<
nAMCs() << std::endl;
89 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch isValid-bit for AMC = " <<
amc
90 <<
"; Max AMC = " <<
nAMCs() << std::endl;
98 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch isPresent-bit for AMC = " <<
amc
99 <<
"; Max AMC = " <<
nAMCs() << std::endl;
105 return ((
myDataPtr[2 +
amc] & 0x0800000000000000) != 0);
107 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch isEnabled-bit for AMC = " <<
amc
108 <<
"; Max AMC = " <<
nAMCs() << std::endl;
114 return ((
myDataPtr[2 +
amc] & 0x1000000000000000) != 0);
116 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch isSegmented-bit for AMC = " <<
amc
117 <<
"; Max AMC = " <<
nAMCs() << std::endl;
123 return ((
myDataPtr[2 +
amc] & 0x2000000000000000) != 0);
125 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch more-bit for AMC = " <<
amc
126 <<
"; Max AMC = " <<
nAMCs() << std::endl;
132 return ((
myDataPtr[2 +
amc] & 0x4000000000000000) != 0);
134 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch length error bit for AMC = " <<
amc
135 <<
"; Max AMC = " <<
nAMCs() << std::endl;
143 for (uint32_t
i = 0;
i <
amc;
i++) {
148 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch payload location for AMC = " <<
amc
149 <<
"; Max AMC = " <<
nAMCs() << std::endl;
155 for (uint32_t
i = 0;
i <
nAMCs();
i++) {
163 return (
data[0] & 0x0000000000000FFF);
168 return ((
data[0] & 0x00000000000FF000) >> 12);
173 return ((
data[0] & 0x000000000FF00000) >> 20);
178 return ((
data[0] & 0xFFFFFFFF00000000) >> 32);
183 for (uint32_t
i = 0;
i <
nAMCs();
i++) {
188 if ((
data[0] & 0xF000000000000000) != 0xA000000000000000) {
189 edm::LogError(
"UCTDAQRawData") <<
"CDF Trailer seems to be wrong : " << std::showbase << std::internal
190 << std::setfill(
'0') << std::setw(10) << std::hex <<
data[1] << std::endl;
197 return ((
data[0] & 0x0000000000000004) != 0);
202 return ((
data[0] & 0x0000000000000008) != 0);
207 return ((
data[0] & 0x00000000000000F0) >> 4);
212 return ((
data[0] & 0x0000000000000F00) >> 8);
217 return ((
data[0] & 0x0000000000004000) != 0);
222 return ((
data[0] & 0x0000000000008000) != 0);
227 return ((
data[0] & 0x00000000FFFF0000) >> 16);
232 return ((
data[0] & 0x00FFFFFF00000000) >> 32);
237 LogDebug(
"UCTDAQRawData") <<
"Common cDAQ/AMC13 Data Header:" << endl;
238 LogDebug(
"UCTDAQRawData") <<
"Framework Version = " <<
internal << setfill(
'0') << setw(3) << hex <<
FOV() << endl;
240 LogDebug(
"UCTDAQRawData") <<
"BXID............. = " <<
dec <<
BXID() << endl;
241 LogDebug(
"UCTDAQRawData") <<
"L1ID............. = " <<
internal << setfill(
'0') << setw(8) << hex <<
L1ID() << endl;
242 LogDebug(
"UCTDAQRawData") <<
"eventType........ = " <<
internal << setfill(
'0') << setw(3) << hex <<
eventType()
245 LogDebug(
"UCTDAQRawData") <<
"uFOV............. = " <<
internal << setfill(
'0') << setw(8) << hex <<
uFOV() << endl;
246 LogDebug(
"UCTDAQRawData") <<
"# of CTP7s....... = " <<
dec <<
nAMCs() << endl;
248 <<
"Phi SlotNo BlockNo Size CRC? Valid? Present? Enabled? Segmented? More? LengthError?" << endl;
249 for (uint32_t
i = 0;
i <
nAMCs();
i++) {
250 LogDebug(
"UCTDAQRawData") <<
dec << setfill(
' ') << setw(3) <<
boardID(
i) <<
" " <<
dec << setfill(
' ') << setw(6)
252 << setfill(
' ') << setw(8) <<
amcSize(
i) <<
" "
258 <<
" " <<
more(
i) <<
" "
261 LogDebug(
"UCTDAQRawData") <<
"AMC13 Trailer:" << endl;
265 LogDebug(
"UCTDAQRawData") <<
"AMC13 CRC32...... = " <<
internal << setfill(
'0') << setw(10) << hex <<
amc13BXID()
267 LogDebug(
"UCTDAQRawData") <<
"Common DAQ Trailer:" << endl;
270 LogDebug(
"UCTDAQRawData") <<
"ttsBits.......... = " <<
internal << setfill(
'0') << setw(3) << hex <<
ttsBits()
272 LogDebug(
"UCTDAQRawData") <<
"Event Status..... = " <<
internal << setfill(
'0') << setw(3) << hex <<
eventStatus()
276 LogDebug(
"UCTDAQRawData") <<
"CRC 16........... = " <<
internal << setfill(
'0') << setw(6) << hex <<
crc16()