21#include <fairlogger/Logger.h>
26#include <boost/property_tree/ptree.hpp>
47 void configure(
const boost::property_tree::ptree& config)
override
49 std::string libraryName =
"lib" + config.get<std::string>(
"moduleName");
50 std::string className = config.get<std::string>(
"className");
52 int libLoaded = gSystem->Load(libraryName.c_str(),
"",
true);
54 throw std::runtime_error(
"Failed to load the library: " + libraryName);
59 TClass* dictionary = TClass::GetClass(className.c_str());
61 throw std::runtime_error(
"Failed to load the dictionary of the class: " + className +
" from the library: " + libraryName);
65 if (mCondition ==
nullptr) {
66 throw std::runtime_error(
"Failed to instantiate the class: " + className +
" from the library: " + libraryName);
69 mCondition->configure(config);
75 return mCondition->decide(dataRef);
79 std::unique_ptr<DataSamplingCondition> mCondition;
84 return std::make_unique<DataSamplingConditionCustom>();
A definition of DataSamplingConditionFactory.
A standarised data sampling condition, to decide if given data sample should be passed forward.
A DataSamplingCondition which makes decisions based on payload size.
~DataSamplingConditionCustom() override=default
Default destructor.
DataSamplingConditionCustom()
Constructor.
bool decide(const o2::framework::DataRef &dataRef) override
Invokes decide() of a custom condition.
void configure(const boost::property_tree::ptree &config) override
Instantiates and configures a custom condition based on configuration.
static std::unique_ptr< DataSamplingCondition > createDataSamplingConditionCustom()
Getter for DataSamplingConditionCustom.
A standardised data sampling condition, to decide if given data sample should be passed forward.
Defining PrimaryVertex explicitly as messageable.
A header which contains some meta-data generated by Data Sampling.