4std::unordered_map<std::string, InterpretedParam>
6 std::unordered_map<std::string, InterpretedParam> out;
9 throw std::runtime_error(
"JsonParamMappingAdapter: parser is null");
12 auto root = parser_->readFromFile(filePath);
14 throw std::runtime_error(
"JsonParamMappingAdapter: root DBNode is null");
17 auto keys = root->get_keys();
18 for (
const auto& paramName : keys) {
20 const auto blockV = root->get(paramName,
"block");
21 const auto codeV = root->get(paramName,
"pdgCode");
23 const std::string block = asString(blockV);
24 const std::string code = asString(codeV);
29 }
catch (
const std::exception& e) {
30 LOG_ERROR(
"JSON mapping", std::string(
"Key '") +
static_cast<std::string
>(paramName) +
"': " + e.what());
Adapter to load parameter mappings from a JSON/YAML-like DBNode tree.
#define LOG_ERROR(type,...)
Macro for logging error messages and terminating the application.
std::unordered_map< std::string, InterpretedParam > loadFromFile(const std::string &filePath) const override
Loads parameter mappings from a file.
Identifies a single interpreted parameter from an LHA block.
Represents an identifier of a LHA element, possibly containing several sub-ids.