29 off_t offset =
fs.tellg();
30 ERS_DEBUG_3(
"Current stream position is 0x%lx", offset);
33 if (
fs &&
fs.good() && !
fs.eof()) {
36 if (!
fs.good() ||
fs.eof())
return 0;
46 std::cout <<
"Word at offset " <<
HEX(offset) <<
" is not one of "
51 <<
HEX(
ROS) <<
". Stopping execution..." << std::endl;
58 ERS_DEBUG_3(
"Resetting stream position to 0x%lx...", offset);
60 if (addr && (size >= (
data[1]*4))) {
63 fs.read((
char*)addr,
data[1]*4);
69 std::cout <<
"The fragment at offset " <<
HEX(offset) <<
" has "
70 <<
data[1]*4 <<
" bytes and you provided only "
71 << size <<
" bytes in your buffer. Stopping execution..."
77 ERS_DEBUG_3(
"Allocating fragment data storage of size %ud bytes", 4*
data[1]);
78 uint32_t* retval =
new uint32_t[
data[1]];
80 fs.read((
char*)retval,
data[1]*4);
87 const uint32_t** rod, uint32_t* rod_size,
90 const uint32_t* block_end = block_start + block_size;
92 while (block_end > block_start) {
93 uint32_t curr_rod_size = 12;
94 curr_rod_size += *(block_end-3) + *(block_end-2);
95 block_end -= curr_rod_size;
96 if (rod && counter < max_count) {
99 rod_size[counter] = curr_rod_size;
100 rod[counter] = block_end;
111 ERS_DEBUG_1(
"Getting all ROB's from 0x%x...", fragment[0]);
119 if ( max_count > 0 ) {
129 counter += ros.
children(rob, max_count);
136 const uint32_t* ros[256];
137 size_t ros_counter = sd.
children(ros, 256);
138 for (
size_t i=0; i<ros_counter; ++i)
139 counter +=
get_robs(ros[i], &rob[counter], max_count - counter);
147 const uint32_t* sd[64];
148 size_t sd_counter = fe.
children(sd, 64);
149 for (
size_t i=0; i<sd_counter; ++i)
150 counter +=
get_robs(sd[i], &rob[counter], max_count - counter);
Defines the Event Fragment entity. The definition is based on the update of ATL-DAQ-98-129,...
Defines the ROB fragment entity as described in the Event Format note.
Describes the ROS fragment as defined in the Event Format note.
Defines the subdetector fragment entity. The definition is based on the update of ATL-DAQ-98-129,...
Defines the wrong-marker exception, to be used when the wrong marker is found on the event stream.
#define EFORMAT_WRONG_MARKER(current, expected)
Defines a set of utilities common to many event operations.