30 std::cout <<
"Got infos? " << infoHandle <<
std::endl;
32 const std::string & toplevel_groupname = infoHandle->GetEventGroupName();
34 hid_t file_id = infoHandle->GetHDF5FileHandle();
36 std::cout <<
"Top-Level Group Name: " << toplevel_groupname <<
std::endl;
37 std::cout <<
"HDF5 FileName: " << file_name <<
std::endl;
44 for (
auto& detectorTypeName : detectorTypeNames)
46 if (detectorTypeName ==
"TPC" && detectorTypeName !=
"TriggerRecordHeader")
48 std::cout <<
" Detector type: " << detectorTypeName <<
std::endl;
49 std::string geoPath = toplevel_groupname +
"/" + detectorTypeName;
54 for (
auto& apaName : apaNames)
57 std::cout <<
" Geo path: " << apaGroupPath <<
std::endl;
62 for (
auto& linkName : linkNames)
64 std::string dataSetPath = apaGroupPath +
"/" + linkName;
65 std::cout <<
" Data Set Path: " << dataSetPath <<
std::endl;
66 hid_t datasetid = H5Dopen(linkGroup,linkName.data(),H5P_DEFAULT);
67 hsize_t ds_size = H5Dget_storage_size(datasetid);
68 std::cout <<
" Data Set Size (bytes): " << ds_size <<
std::endl;
70 if (ds_size < 80)
continue;
72 size_t narray = ds_size /
sizeof(char);
73 size_t rdr = ds_size %
sizeof(char);
74 if (rdr > 0 || narray == 0) narray++;
75 char *ds_data =
new char[narray];
76 herr_t ecode = H5Dread(datasetid, H5T_STD_I8LE, H5S_ALL, H5S_ALL, H5P_DEFAULT, ds_data);
77 int firstbyte = ds_data[0];
79 int lastbyte = ds_data[narray-1];
82 std::cout <<
std::hex <<
" Retrieved data: ecode: " << ecode <<
" first byte: " << firstbyte
87 memcpy(&magic_word,&ds_data[0],4);
91 memcpy(&version, &ds_data[4],4);
95 memcpy(&fragsize, &ds_data[8],8);
99 memcpy(&trignum, &ds_data[16],8);
102 uint64_t trig_timestamp=0;
103 memcpy(&trig_timestamp, &ds_data[24],8);
106 uint64_t windowbeg=0;
107 memcpy(&windowbeg, &ds_data[32],8);
110 uint64_t windowend=0;
111 memcpy(&windowend, &ds_data[40],8);
115 memcpy(&runno, &ds_data[48], 4);
119 memcpy(&errbits, &ds_data[52], 4);
123 memcpy(&fragtype, &ds_data[56], 4);
127 memcpy(&fragtype, &ds_data[60], 4);
131 memcpy(&geoidversion, &ds_data[64], 4);
134 unsigned short geoidtype;
135 memcpy(&geoidtype, &ds_data[70], 1);
136 std::cout <<
" GeoID type: " << geoidtype <<
std::endl;
138 unsigned short geoidregion=0;
139 memcpy(&geoidregion, &ds_data[71], 1);
143 memcpy(&geoidelement, &ds_data[72], 4);
147 memcpy(&geoidpadding, &ds_data[76], 4);
Handle< PROD > getHandle(SelectorBase const &) const
std::deque< std::string > getMidLevelGroupNames(hid_t grp)
QTextStream & hex(QTextStream &s)
QTextStream & dec(QTextStream &s)
hid_t getGroupFromPath(hid_t fd, const std::string &path)
QTextStream & endl(QTextStream &s)