7 #include "lwtnn/LightweightGraph.hh"
8 #include "lwtnn/NanReplacer.hh"
13 const std::string jetLinkName =
"jetLink";
23 const std::vector<FTagInputConfig>&
inputs,
24 const std::vector<ConstituentsInputConfig>& tracks_configs,
26 m_jetLink(jetLinkName),
27 m_input_node_name(
""),
29 m_variable_cleaner(nullptr),
30 m_defaultValue(
options.default_output_value)
33 if (graph_config.inputs.size() > 1) {
34 throw std::logic_error(
"We don't currently support graphs with "
35 "more than one input");
36 }
else if (graph_config.inputs.size() == 1){
39 graph_config.inputs.at(0).defaults,
48 for (
auto config : tracks_configs){
66 rd.merge(loader->getUsedRemap());
75 if (!jetLink.isValid()) {
76 throw std::runtime_error(
"invalid jetLink");
87 for (
const auto&
node: dec.second) {
95 using namespace internal;
96 std::vector<NamedVar> vvec;
98 vvec.push_back(getter(btag));
101 vvec.push_back(getter(
jet));
103 std::map<std::string, std::map<std::string, double> > nodes;
105 std::map<std::string, double>
variables(vvec.begin(), vvec.end());
116 std::map<std::string, std::map<std::string, std::vector<double>>> seqs;
119 std::map<std::string, std::vector<double>> feats;
121 seqs[loader->getName()] = feats;
135 auto out_vals =
m_graph->compute(nodes, seqs, dec.first);
136 for (
const auto&
node: dec.second) {
137 node.second(btag) = out_vals.at(
node.first);