DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::hdf5libs::python Namespace Reference

Functions

void register_hdf5rawdatafile (py::module &m)
 PYBIND11_MODULE (_daq_hdf5libs_py, m)

Function Documentation

◆ PYBIND11_MODULE()

dunedaq::hdf5libs::python::PYBIND11_MODULE ( _daq_hdf5libs_py ,
m  )

Definition at line 21 of file module.cpp.

22{
23
24 m.doc() = "c++ implementation of the dunedaq hdf5libs modules"; // optional module docstring
25
27}
void register_hdf5rawdatafile(py::module &m)

◆ register_hdf5rawdatafile()

void dunedaq::hdf5libs::python::register_hdf5rawdatafile ( py::module & m)

Definition at line 25 of file hdf5rawdatafile.cpp.

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