26{
27
28 py::class_<HDF5RawDataFile>(m, "_HDF5RawDataFile")
29 .def(py::init<std::filesystem::path>())
30
31 .def("get_attribute_names",
32 &HDF5RawDataFile::get_attribute_names,
33 "Get a list of attribute names")
34
35 .def("get_attribute",
36 py::overload_cast<const std::string&>
37 (&HDF5RawDataFile::get_attribute<std::string>),
38 "Get attribute")
39
40 .def("get_int_attribute",
41 py::overload_cast<const std::string&>
42 (&HDF5RawDataFile::get_attribute<size_t>),
43 "Get integer attribute")
44
45 .def("get_file_name",
46 &HDF5RawDataFile::get_file_name,"Get file name")
47 .def("get_recorded_size",
48 &HDF5RawDataFile::get_recorded_size,"Get recorded size")
49 .def("get_record_type",
50 &HDF5RawDataFile::get_record_type,"Get record type")
51 .def("is_trigger_record_type",
52 &HDF5RawDataFile::is_trigger_record_type,"Is record type TriggerRecord")
53 .def("is_timeslice_type",
54 &HDF5RawDataFile::is_timeslice_type,"Is record type TimeSlice")
55 .def("get_version",
56 &HDF5RawDataFile::get_version,"FileLayout version number")
57
58 .def("get_dataset_paths",
59 &HDF5RawDataFile::get_dataset_paths,
60 "Get all dataset paths under specified top group in file",
61 py::arg("top_level_group_name")="")
62
63 .def("get_all_record_ids",
64 &HDF5RawDataFile::get_all_record_ids,"Get all record/sequence number pairs.")
65 .def("get_all_trigger_record_ids",
66 &HDF5RawDataFile::get_all_trigger_record_ids,"Get all trigger record/sequence number pairs.")
67 .def("get_all_timeslice_ids",
68 &HDF5RawDataFile::get_all_timeslice_ids,"Get all timeslice/sequence number pairs.")
69
70 .def("get_record_header_dataset_paths",
71 &HDF5RawDataFile::get_record_header_dataset_paths,"Get all paths to record header datasets")
72 .def("get_trigger_record_header_dataset_paths",
73 &HDF5RawDataFile::get_trigger_record_header_dataset_paths,"Get all paths to TriggerRecordHeader datasets")
74 .def("get_timeslice_header_dataset_paths",
75 &HDF5RawDataFile::get_timeslice_header_dataset_paths,"Get all paths to TimeSliceHeader datasets")
76
77 .def("get_record_header_dataset_path",
78 py::overload_cast<const HDF5RawDataFile::record_id_t&>(&HDF5RawDataFile::get_record_header_dataset_path),
79 "Get record header path for record id")
80 .def("get_record_header_dataset_path",
81 py::overload_cast<const uint64_t,const daqdataformats::sequence_number_t>
82 (&HDF5RawDataFile::get_record_header_dataset_path),
83 "Get record header path for record number and sequence number",
84 py::arg("rec_num"),py::arg("seq_num")=0)
85
86 .def("get_trigger_record_header_dataset_path",
87 py::overload_cast<const HDF5RawDataFile::record_id_t&>(&HDF5RawDataFile::get_trigger_record_header_dataset_path),
88 "Get record header path for trigger record id")
89 .def("get_trigger_record_header_dataset_path",
90 py::overload_cast<const daqdataformats::trigger_number_t,const daqdataformats::sequence_number_t>
91 (&HDF5RawDataFile::get_trigger_record_header_dataset_path),
92 "Get record header path for trigger record number and sequence number",
93 py::arg("trig_num"),py::arg("seq_num")=0)
94
95 .def("get_timeslice_header_dataset_path",
96 py::overload_cast<const HDF5RawDataFile::record_id_t&>(&HDF5RawDataFile::get_timeslice_header_dataset_path),
97 "Get record header path for timeslice record id")
98 .def("get_timeslice_header_dataset_path",
99 py::overload_cast<const daqdataformats::timeslice_number_t>
100 (&HDF5RawDataFile::get_timeslice_header_dataset_path),
101 "Get record header path for timeslice number")
102
103 .def("get_all_fragment_dataset_paths",
104 &HDF5RawDataFile::get_all_fragment_dataset_paths,
105 "Get all paths to Fragment datasets")
106 .def("get_fragment_dataset_paths",
107 py::overload_cast<const HDF5RawDataFile::record_id_t&>(&HDF5RawDataFile::get_fragment_dataset_paths),
108 "Get fragment datasets for record ID")
109 .def("get_fragment_dataset_paths",
110 py::overload_cast<const uint64_t,const daqdataformats::sequence_number_t>
111 (&HDF5RawDataFile::get_fragment_dataset_paths),
112 "Get fragment datasets for record number and sequence number",
113 py::arg("rec_num"),py::arg("seq_num")=0)
114 .def("get_fragment_dataset_paths",
115 py::overload_cast<const HDF5RawDataFile::record_id_t&,const daqdataformats::SourceID::Subsystem>
116 (&HDF5RawDataFile::get_fragment_dataset_paths),
117 "Get fragment datasets for record ID and SourceID Subsystem")
118 .def("get_fragment_dataset_paths",
119 py::overload_cast<const HDF5RawDataFile::record_id_t&,const std::string&>
120 (&HDF5RawDataFile::get_fragment_dataset_paths),
121 "Get fragment datasets for record ID and SourceID Subsystem string")
122#if 0
123 .def("get_fragment_dataset_paths",
124 py::overload_cast<const daqdataformats::SourceID::Subsystem>(&HDF5RawDataFile::get_fragment_dataset_paths),
125 "Get fragment datasets for SourceID Subsystem")
126 .def("get_fragment_dataset_paths",
127 py::overload_cast<const std::string&>(&HDF5RawDataFile::get_fragment_dataset_paths),
128 "Get fragment datasets for SourceID Subsystem string")
129 .def("get_fragment_dataset_paths",
130 py::overload_cast<const daqdataformats::SourceID>(&HDF5RawDataFile::get_fragment_dataset_paths),
131 "Get fragment datasets for SourceID")
132 .def("get_fragment_dataset_paths",
133 py::overload_cast<const daqdataformats::SourceID::Subsystem,const uint32_t>
134 (&HDF5RawDataFile::get_fragment_dataset_paths),
135 "Get fragment datasets for SourceID Subsystem")
136 .def("get_fragment_dataset_paths",
137 py::overload_cast<const std::string&,const uint32_t>
138 (&HDF5RawDataFile::get_fragment_dataset_paths),
139 "Get fragment datasets for SourceID Subsystem string")
140#endif
141 .def("get_geo_ids",
142 py::overload_cast<const HDF5RawDataFile::record_id_t&>
143 (&HDF5RawDataFile::get_geo_ids),
144 "Get all GeoIDs in a record id")
145 .def("get_geo_ids",
146 py::overload_cast<const uint64_t,const daqdataformats::sequence_number_t>
147 (&HDF5RawDataFile::get_geo_ids),
148 "Get all GeoIDs in a record/sequence number")
149 .def("get_geo_ids_for_subdetector",
150 py::overload_cast<const HDF5RawDataFile::record_id_t&,const detdataformats::DetID::Subdetector>
151 (&HDF5RawDataFile::get_geo_ids_for_subdetector),
152 "Get all GeoIDs in a record id with the specified Subdetector type")
153 .def("get_source_ids",
154 py::overload_cast<const HDF5RawDataFile::record_id_t&>
155 (&HDF5RawDataFile::get_source_ids),
156 "Get all source IDs in a record id")
157 .def("get_source_ids",
158 py::overload_cast<const uint64_t,const daqdataformats::sequence_number_t>
159 (&HDF5RawDataFile::get_source_ids),
160 "Get all source IDs in a record/sequence number")
161 .def("get_source_ids_for_fragment_type",
162 py::overload_cast<const HDF5RawDataFile::record_id_t&,const std::string&>
163 (&HDF5RawDataFile::get_source_ids_for_fragment_type),
164 "Get all source IDs in a record id with a given fragment type")
165 .def("get_source_ids_for_fragtype_and_subdetector",
166 py::overload_cast<const HDF5RawDataFile::record_id_t&,const std::string&,const std::string&>
167 (&HDF5RawDataFile::get_source_ids_for_fragtype_and_subdetector),
168 "Get all source IDs in a record id matching the specified fragment and subdetector types")
169#if 0
170 .def("get_source_ids",
171 py::overload_cast<const HDF5RawDataFile::record_id_t&,const daqdataformats::SourceID::Subsystem>
172 (&HDF5RawDataFile::get_source_ids),
173 "Get all source IDs in a record id with a given SourceID Subsystem")
174 .def("get_source_ids",
177 (&HDF5RawDataFile::get_source_ids),
178 "Get all source IDs in a record/sequence number with a given SourceID Subsystem")
179 .def("get_source_ids",
180 py::overload_cast<const HDF5RawDataFile::record_id_t&,const std::string&>
181 (&HDF5RawDataFile::get_source_ids),
182 "Get all source IDs in a record id with a given SourceID Subsystem string")
183 .def("get_source_ids",
185 const std::string&>
186 (&HDF5RawDataFile::get_source_ids),
187 "Get all source IDs in a record/sequence number with a given SourceID Subsystem string")
188 .def("get_source_ids",
189 py::overload_cast<const daqdataformats::SourceID::Subsystem>
190 (&HDF5RawDataFile::get_source_ids),
191 "Get all source IDs with a given SourceID Subsystem")
192 .def("get_source_ids",
193 py::overload_cast<const std::string&>
194 (&HDF5RawDataFile::get_source_ids),
195 "Get all source IDs with a given SourceID Subsystem string")
196#endif
197
198
199
200
201 .def("get_frag",
202 py::overload_cast<const std::string & >
203 (&HDF5RawDataFile::get_frag_ptr),
204 "Get Fragment from dataset")
205 .def("get_frag",
206 py::overload_cast<const uint64_t,
209 (&HDF5RawDataFile::get_frag_ptr),
210 "Get Fragment from record/sequence number and SourceID")
211 .def("get_frag",
212 py::overload_cast<const HDF5RawDataFile::record_id_t&,
214 (&HDF5RawDataFile::get_frag_ptr),
215 "Get Fragment from record id and SourceID")
216
217 .def("get_frag",
218 py::overload_cast<const uint64_t,
221 const uint32_t>
222 (&HDF5RawDataFile::get_frag_ptr),
223 "Get Fragment from record/sequence number and SourceID elements")
224 .def("get_frag",
225 py::overload_cast<const HDF5RawDataFile::record_id_t&,
227 const uint32_t>
228 (&HDF5RawDataFile::get_frag_ptr),
229 "Get Fragment from record id and SourceID elements")
230
231 .def("get_frag",
232 py::overload_cast<const uint64_t,
234 const std::string&,
235 const uint32_t>
236 (&HDF5RawDataFile::get_frag_ptr),
237 "Get Fragment from record/sequence number and SourceID elements")
238 .def("get_frag",
239 py::overload_cast<const HDF5RawDataFile::record_id_t&,
240 const std::string&,
241 const uint32_t>
242 (&HDF5RawDataFile::get_frag_ptr),
243 "Get Fragment from record id and SourceID elements")
244
245 .def("get_frag",
246 py::overload_cast<const HDF5RawDataFile::record_id_t&,
247 const uint64_t>
248 (&HDF5RawDataFile::get_frag_ptr),
249 "Get Fragment from record id and GeoID")
250 .def("get_frag",
251 py::overload_cast<const uint64_t,
253 const uint64_t>
254 (&HDF5RawDataFile::get_frag_ptr),
255 "Get Fragment from record/sequence number and GeoID")
256
257
258
259
260 .def("get_trh",
261 py::overload_cast<const std::string & >
262 (&HDF5RawDataFile::get_trh_ptr),
263 "Get TriggerRecordHeader from dataset")
264 .def("get_trh",
265 py::overload_cast<const HDF5RawDataFile::record_id_t&>
266 (&HDF5RawDataFile::get_trh_ptr),
267 "Get TriggerRecordHeader from record id")
268 .def("get_trh",
269 py::overload_cast<const daqdataformats::trigger_number_t,daqdataformats::sequence_number_t>
270 (&HDF5RawDataFile::get_trh_ptr),
271 "Get TriggerRecordHeader from record/sequence number")
272
273
274 .def("get_tsh",
275 py::overload_cast<const std::string & >
276 (&HDF5RawDataFile::get_tsh_ptr),
277 "Get TimeSliceHeader from datset")
278 .def("get_tsh",
279 py::overload_cast<const HDF5RawDataFile::record_id_t&>
280 (&HDF5RawDataFile::get_tsh_ptr),
281 "Get TimeSliceHeader from record id")
282 .def("get_tsh",
283 py::overload_cast<const daqdataformats::timeslice_number_t>
284 (&HDF5RawDataFile::get_tsh_ptr),
285 "Get TimeSliceHeader from timeslince number")
286
287 .def("get_trigger_record",
288 py::overload_cast<const HDF5RawDataFile::record_id_t&>
289 (&HDF5RawDataFile::get_trigger_record),
290 "Get TriggerRecord object from record id")
291 .def("get_trigger_record",
294 (&HDF5RawDataFile::get_trigger_record),
295 "Get TriggerRecord object from record/sequence number")
296 .def("get_timeslice",
297 py::overload_cast<const HDF5RawDataFile::record_id_t&>
298 (&HDF5RawDataFile::get_timeslice),
299 "Get TimeSlice object from record id")
300 .def("get_timeslice",
301 py::overload_cast<const daqdataformats::timeslice_number_t>
302 (&HDF5RawDataFile::get_timeslice),
303 "Get TimeSlice object from timeslice number")
304 ;
305
306}