mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-04-25 07:20:44 +02:00
Add n_bad_modules to Bernina format
This commit is contained in:
@@ -17,7 +17,7 @@ class BerninaFormat : public H5Format
|
||||
public:
|
||||
~BerninaFormat(){};
|
||||
|
||||
BerninaFormat(const string& dataset_name)
|
||||
BerninaFormat(const string& dataset_name, int n_bad_modules)
|
||||
{
|
||||
// Input values definition type.
|
||||
// Which type should be the parameters you receive over the REST api.
|
||||
@@ -30,7 +30,11 @@ class BerninaFormat : public H5Format
|
||||
}));
|
||||
|
||||
// Default values used in the file format.
|
||||
default_values.reset(new std::unordered_map<string, boost::any>({}));
|
||||
default_values.reset(new std::unordered_map<string, boost::any>(
|
||||
{
|
||||
{"general/n_bad_modules", n_bad_modules},
|
||||
{"general/detector_name", dataset_name}
|
||||
}));
|
||||
|
||||
// After format has been writen, where to move the raw datasets.
|
||||
dataset_move_mapping.reset(new std::unordered_map<string, string>(
|
||||
@@ -58,6 +62,8 @@ class BerninaFormat : public H5Format
|
||||
s_ptr(new h5_dataset("user", "general/user", NX_CHAR)),
|
||||
s_ptr(new h5_dataset("process", "general/process", NX_CHAR)),
|
||||
s_ptr(new h5_dataset("instrument", "general/instrument", NX_CHAR)),
|
||||
s_ptr(new h5_dataset("detector_name", "general/detector_name", NX_CHAR)),
|
||||
s_ptr(new h5_dataset("n_bad_modules", "general/n_bad_modules", NX_INT)),
|
||||
})),
|
||||
|
||||
s_ptr(new h5_group("data", {
|
||||
|
||||
@@ -45,7 +45,7 @@ int main (int argc, char *argv[])
|
||||
|
||||
writer_utils::create_destination_folder(output_file);
|
||||
|
||||
BerninaFormat format(detector_name,n_bad_modules);
|
||||
BerninaFormat format(detector_name, n_bad_modules);
|
||||
WriterManager manager(format.get_input_value_type(), output_file, n_frames);
|
||||
|
||||
auto header_values = shared_ptr<unordered_map<string, HeaderDataType>>(new unordered_map<string, HeaderDataType> {
|
||||
|
||||
Reference in New Issue
Block a user