DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
HDF5FileLayoutParameters.hpp
Go to the documentation of this file.
1
11#ifndef HDF5LIBS_INCLUDE_HDF5LIBS_HDF5FILELAYOUTPARAMETERS_HPP_
12#define HDF5LIBS_INCLUDE_HDF5LIBS_HDF5FILELAYOUTPARAMETERS_HPP_
13
16
17#include "nlohmann/json.hpp"
18
19#include <vector>
20
21namespace dunedaq {
22
23namespace hdf5libs {
24
26{
27 std::string detector_group_type = "unspecified";
28 std::string detector_group_name = "unspecified";
29 std::string element_name_prefix = "Element";
31
32 HDF5PathParameters() = default;
40 HDF5PathParameters(nlohmann::json from_json)
41 {
42 detector_group_type = from_json["detector_group_type"];
43 detector_group_name = from_json["detector_group_name"];
44 element_name_prefix = from_json["element_name_prefix"];
45 digits_for_element_number = from_json["digits_for_element_number"];
46 }
47
48 nlohmann::json to_json()
49 {
50 nlohmann::json output;
51
52 output["detector_group_type"] = detector_group_type;
53 output["detector_group_name"] = detector_group_name;
54 output["element_name_prefix"] = element_name_prefix;
55 output["digits_for_element_number"] = digits_for_element_number;
56
57 return output;
58 }
59};
60
62{
63 std::string record_name_prefix = "TriggerRecord";
66 std::string record_header_dataset_name = "TriggerRecordHeader";
67 std::string raw_data_group_name = "RawData";
68 std::string view_group_name = "Views";
69 std::vector<HDF5PathParameters> path_params_list;
70
85 HDF5FileLayoutParameters(nlohmann::json from_json)
86 {
87 record_name_prefix = from_json["record_name_prefix"];
88 digits_for_record_number = from_json["digits_for_record_number"];
89 digits_for_sequence_number = from_json["digits_for_sequence_number"];
90 record_header_dataset_name = from_json["record_header_dataset_name"];
91 raw_data_group_name = from_json["raw_data_group_name"];
92 view_group_name = from_json["view_group_name"];
93
94 for (auto& pp : from_json["path_param_list"]) {
95 path_params_list.emplace_back(pp);
96 }
97
98 }
99
100 nlohmann::json to_json() {
101
102 nlohmann::json output;
103
104 output["record_name_prefix"] = record_name_prefix;
105 output["digits_for_record_number"] = digits_for_record_number;
106 output["digits_for_sequence_number"] = digits_for_sequence_number;
107 output["record_header_dataset_name"] = record_header_dataset_name;
108 output["raw_data_group_name"] = raw_data_group_name;
109 output["view_group_name"] = view_group_name;
110 output["path_param_list"] = nlohmann::json::array();
111
112 for (auto& pp : path_params_list) {
113 output["path_param_list"].push_back(pp.to_json());
114 }
115
116 return output;
117 }
118};
119
120} // namespace hdf5libs
121
122} // namespace dunedaq
123
124#endif // HDF5LIBS_INCLUDE_HDF5LIBS_HDF5FILELAYOUTPARAMETERS_HPP_
const std::string & get_record_header_dataset_name() const
Get "record_header_dataset_name" attribute value.
const std::string & get_view_group_name() const
Get "view_group_name" attribute value.
const std::vector< const dunedaq::appmodel::HDF5PathParams * > & get_path_params_list() const
Get "path_params_list" relationship value.
const std::string & get_record_name_prefix() const
Get "record_name_prefix" attribute value.
const std::string & get_raw_data_group_name() const
Get "raw_data_group_name" attribute value.
int32_t get_digits_for_sequence_number() const
Get "digits_for_sequence_number" attribute value.
int32_t get_digits_for_record_number() const
Get "digits_for_record_number" attribute value.
const std::string & get_detector_group_name() const
Get "detector_group_name" attribute value.
const std::string & get_detector_group_type() const
Get "detector_group_type" attribute value.
const std::string & get_element_name_prefix() const
Get "element_name_prefix" attribute value.
int32_t get_digits_for_element_number() const
Get "digits_for_element_number" attribute value.
Including Qt Headers.
HDF5FileLayoutParameters(appmodel::HDF5FileLayoutParams const *from_conf)
HDF5PathParameters(appmodel::HDF5PathParams const *from_conf)