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!"
35 uint32_t
FOV() {
return ((
myDataPtr[0] & 0x00000000000000F0) >> 4); }
48 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch board ID for AMC = " <<
amc
49 <<
"; Max AMC = " <<
nAMCs() << std::endl;
55 return ((
myDataPtr[2 +
amc] & 0x00000000000F0000) >> 16);
57 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch amc no for AMC = " <<
amc
58 <<
"; Max AMC = " <<
nAMCs() << std::endl;
64 return ((
myDataPtr[2 +
amc] & 0x000000000FF00000) >> 20);
66 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch amc block no for AMC = " <<
amc
67 <<
"; Max AMC = " <<
nAMCs() << std::endl;
73 return ((
myDataPtr[2 +
amc] & 0x00FFFFFF00000000) >> 32);
75 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch amc size for AMC = " <<
amc
76 <<
"; Max AMC = " <<
nAMCs() << std::endl;
84 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch crcError-bit for AMC = " <<
amc
85 <<
"; Max AMC = " <<
nAMCs() << std::endl;
93 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch isValid-bit for AMC = " <<
amc
94 <<
"; Max AMC = " <<
nAMCs() << std::endl;
100 return ((
myDataPtr[2 +
amc] & 0x0400000000000000) != 0);
102 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch isPresent-bit for AMC = " <<
amc
103 <<
"; Max AMC = " <<
nAMCs() << std::endl;
109 return ((
myDataPtr[2 +
amc] & 0x0800000000000000) != 0);
111 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch isEnabled-bit for AMC = " <<
amc
112 <<
"; Max AMC = " <<
nAMCs() << std::endl;
118 return ((
myDataPtr[2 +
amc] & 0x1000000000000000) != 0);
120 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch isSegmented-bit for AMC = " <<
amc
121 <<
"; Max AMC = " <<
nAMCs() << std::endl;
127 return ((
myDataPtr[2 +
amc] & 0x2000000000000000) != 0);
129 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch more-bit for AMC = " <<
amc
130 <<
"; Max AMC = " <<
nAMCs() << std::endl;
136 return ((
myDataPtr[2 +
amc] & 0x4000000000000000) != 0);
138 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch length error bit for AMC = " <<
amc
139 <<
"; Max AMC = " <<
nAMCs() << std::endl;
147 for (uint32_t
i = 0;
i <
amc;
i++) {
152 edm::LogError(
"UCTDAQRawData") <<
"UCTDAQRawData: Failed to fetch payload location for AMC = " << amc
153 <<
"; Max AMC = " <<
nAMCs() << std::endl;
159 for (uint32_t
i = 0;
i <
nAMCs();
i++) {
167 return (data[0] & 0x0000000000000FFF);
172 return ((data[0] & 0x00000000000FF000) >> 12);
177 return ((data[0] & 0x000000000FF00000) >> 20);
182 return ((data[0] & 0xFFFFFFFF00000000) >> 32);
187 for (uint32_t
i = 0;
i <
nAMCs();
i++) {
192 if ((data[0] & 0xF000000000000000) != 0xA000000000000000) {
193 edm::LogError(
"UCTDAQRawData") <<
"CDF Trailer seems to be wrong : " << std::showbase << std::internal
194 << std::setfill(
'0') << std::setw(10) << std::hex << data[1] << std::endl;
201 return ((data[0] & 0x0000000000000004) != 0);
206 return ((data[0] & 0x0000000000000008) != 0);
211 return ((data[0] & 0x00000000000000F0) >> 4);
216 return ((data[0] & 0x0000000000000F00) >> 8);
221 return ((data[0] & 0x0000000000004000) != 0);
226 return ((data[0] & 0x0000000000008000) != 0);
231 return ((data[0] & 0x00000000FFFF0000) >> 16);
236 return ((data[0] & 0x00FFFFFF00000000) >> 32);
241 LogDebug(
"UCTDAQRawData") <<
"Common cDAQ/AMC13 Data Header:" << endl;
242 LogDebug(
"UCTDAQRawData") <<
"Framework Version = " <<
internal << setfill(
'0') << setw(3) << hex <<
FOV() << endl;
244 LogDebug(
"UCTDAQRawData") <<
"BXID............. = " <<
dec <<
BXID() << endl;
245 LogDebug(
"UCTDAQRawData") <<
"L1ID............. = " <<
internal << setfill(
'0') << setw(8) << hex <<
L1ID() << endl;
246 LogDebug(
"UCTDAQRawData") <<
"eventType........ = " <<
internal << setfill(
'0') << setw(3) << hex <<
eventType()
249 LogDebug(
"UCTDAQRawData") <<
"uFOV............. = " <<
internal << setfill(
'0') << setw(8) << hex <<
uFOV() << endl;
250 LogDebug(
"UCTDAQRawData") <<
"# of CTP7s....... = " <<
dec <<
nAMCs() << endl;
252 <<
"Phi SlotNo BlockNo Size CRC? Valid? Present? Enabled? Segmented? More? LengthError?" << endl;
253 for (uint32_t
i = 0;
i <
nAMCs();
i++) {
254 LogDebug(
"UCTDAQRawData") <<
dec << setfill(
' ') << setw(3) <<
boardID(
i) <<
" " <<
dec << setfill(
' ') << setw(6)
256 << setfill(
' ') << setw(8) <<
amcSize(
i) <<
" "
262 <<
" " <<
more(
i) <<
" "
265 LogDebug(
"UCTDAQRawData") <<
"AMC13 Trailer:" << endl;
269 LogDebug(
"UCTDAQRawData") <<
"AMC13 CRC32...... = " <<
internal << setfill(
'0') << setw(10) << hex <<
amc13BXID()
271 LogDebug(
"UCTDAQRawData") <<
"Common DAQ Trailer:" << endl;
274 LogDebug(
"UCTDAQRawData") <<
"ttsBits.......... = " <<
internal << setfill(
'0') << setw(3) << hex <<
ttsBits()
276 LogDebug(
"UCTDAQRawData") <<
"Event Status..... = " <<
internal << setfill(
'0') << setw(3) << hex <<
eventStatus()
280 LogDebug(
"UCTDAQRawData") <<
"CRC 16........... = " <<
internal << setfill(
'0') << setw(6) << hex <<
crc16()
const uint64_t * cdfHeader() const
UCTDAQRawData(const uint64_t *d)
bool isPresent(uint32_t amc=0)
const uint64_t * myDataPtr
bool crcError(uint32_t amc=0)
const uint64_t * cdfTrailerPtr()
const uint64_t * amc13TrailerPtr()
Log< level::Error, false > LogError
uint32_t boardID(uint32_t amc=0)
bool isEnabled(uint32_t amc=0)
const UCTDAQRawData & operator=(const UCTDAQRawData &i)=delete
uint32_t amcSize(uint32_t amc=0)
bool isSegmented(uint32_t amc=0)
uint32_t amcBlkNo(uint32_t amc=0)
const uint64_t * dataPtr() const
const uint32_t * amcPayload(uint32_t amc)
unsigned long long uint64_t
bool isSLinkErrorDetectedByFRL()
bool lengthError(uint32_t amc=0)
char data[epos_bytes_allocation]
uint32_t amcNo(uint32_t amc=0)
bool isValid(uint32_t amc=0)
bool more(uint32_t amc=0)