18#include "marley/Error.hh"
19#include "marley/JSON.hh"
20#include "marley/WeightCalculator.hh"
22marley::WeightCalculator::WeightCalculator(
const marley::JSON& config )
24 if ( !config.is_object() ) {
25 throw marley::Error(
"Non-object JSON configuration passed to constructor"
26 " of marley::WeightCalculator" );
29 if ( !config.has_key(
"name") ) {
30 throw marley::Error(
"Missing \"name\" key in weight calculator JSON"
34 name_ = config.at(
"name" ).to_string();
37marley::WeightCalculator::WeightCalculator(
const std::string& name )
std::string name_
Name used to label the output event weight.