ATLAS Offline Software
SaltModelGraphConfig.cxx
Go to the documentation of this file.
1 /*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 namespace FlavorTagInference {
8  namespace SaltModelGraphConfig {
10  std::string name = v.at("name").get<std::string>();
11  auto offset = v.at("offset").get<double>();
12  auto scale = v.at("scale").get<double>();
13  return {std::move(name), offset, scale};
14  }
15 
18  cfg.name = v.at("name").get<std::string>();
19  for (const auto& var: v.at("variables")) {
20  cfg.variables.push_back(get_input(var));
21  if (var.contains("default")) {
22  std::string name = var.at("name").get<std::string>();
23  cfg.defaults.emplace(name, var.at("default").get<double>());
24  }
25  }
26  return cfg;
27  }
28 
31  for (const auto& lab: v.at("labels")) {
32  cfg.labels.push_back(lab.get<std::string>());
33  }
34  int idx = v.at("node_index").get<int>();
35  if (idx < 0) throw std::logic_error("output node index is negative");
36  cfg.node_index = idx;
37  return cfg;
38  }
39 
42  for (const auto& v: metadata.at("inputs")) {
43  cfg.inputs.push_back(get_input_node(v));
44  }
45  for (const auto& v: metadata.at("input_sequences")) {
46  cfg.input_sequences.push_back(get_input_node(v));
47  }
48  if (metadata.contains("outputs")) {
49  for (const auto& v: metadata.at("outputs").items()) {
50  std::string name = v.key();
51  cfg.outputs.emplace(name, get_output_node(v.value()));
52  }
53  }
54  return cfg;
55  }
56  }
57 }
beamspotnt.var
var
Definition: bin/beamspotnt.py:1393
FlavorTagInference::SaltModelGraphConfig::OutputNodeConfig
Definition: SaltModelGraphConfig.h:30
FlavorTagInference::SaltModelGraphConfig::get_input
Input get_input(const nlohmann::json &v)
Definition: SaltModelGraphConfig.cxx:9
FlavorTagInference::SaltModelGraphConfig::Input
Definition: SaltModelGraphConfig.h:15
FlavorTagInference
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition: PhysicsAnalysis/JetTagging/FlavorTagInference/FlavorTagInference/ConstituentsLoader.h:27
json
nlohmann::json json
Definition: HistogramDef.cxx:9
FlavorTagInference::SaltModelGraphConfig::parse_json_graph
GraphConfig parse_json_graph(const nlohmann::json &metadata)
Definition: SaltModelGraphConfig.cxx:40
FlavorTagInference::SaltModelGraphConfig::get_input_node
InputNodeConfig get_input_node(const nlohmann::json &v)
Definition: SaltModelGraphConfig.cxx:16
yodamerge_tmp.scale
scale
Definition: yodamerge_tmp.py:138
python.checkMetadata.metadata
metadata
Definition: checkMetadata.py:175
FlavorTagInference::SaltModelGraphConfig::InputNodeConfig
Definition: SaltModelGraphConfig.h:22
FlavorTagInference::SaltModelGraphConfig::get_output_node
OutputNodeConfig get_output_node(const nlohmann::json &v)
Definition: SaltModelGraphConfig.cxx:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
python.PyAthena.v
v
Definition: PyAthena.py:154
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
FlavorTagInference::SaltModelGraphConfig::GraphConfig
Definition: SaltModelGraphConfig.h:36
SaltModelGraphConfig.h