1 #include "artdaq-demo-hdf5/HDF5/MakeDatasetPlugin.hh"
2 #include "artdaq-core/Utilities/ExceptionHandler.hh"
4 #include "cetlib/BasicPluginFactory.h"
5 #include "fhiclcpp/ParameterSet.h"
11 std::unique_ptr<artdaq::hdf5::FragmentDataset>
12 MakeDatasetPlugin(
const fhicl::ParameterSet& pset,
13 const std::string& plugin_label)
15 static cet::BasicPluginFactory bpf(
"dataset",
"make");
17 fhicl::ParameterSet dataset_pset;
21 dataset_pset = pset.get<fhicl::ParameterSet>(plugin_label);
25 std::stringstream errmsg;
27 <<
"Error in artdaq::MakeDatasetPlugin: Unable to find the Dataset plugin parameters in the FHiCL code \"" << dataset_pset.to_string()
28 <<
"\"; FHiCL table with label \"" << plugin_label
29 <<
"\" may not exist, or if it does, one or more parameters may be missing.";
30 ExceptionHandler(ExceptionHandlerRethrow::yes, errmsg.str());
36 bpf.makePlugin<std::unique_ptr<FragmentDataset>,
37 const fhicl::ParameterSet&>(
38 dataset_pset.get<std::string>(
"datasetPluginType"),
45 std::stringstream errmsg;
47 <<
"Unable to create Dataset plugin using the FHiCL parameters \""
48 << dataset_pset.to_string()
50 ExceptionHandler(ExceptionHandlerRethrow::yes, errmsg.str());