33 std::regex subjet_match(hk::subjet +
"[0-9]+");
34 std::string first_match;
35 for (
const auto&
node: graph_cfg.inputs) {
36 for (
const auto& var:
node.variables) {
37 const std::string& name = var.name;
41 for (
const auto& var:
node.variables) {
42 k.fatjet.insert(var.name);
44 }
else if (std::regex_match(
node.
name, subjet_match)) {
45 std::set<std::string> subjet_set;
46 for (
const auto& var:
node.variables) {
47 subjet_set.insert(var.name);
49 if (k.n_subjets == 0) {
50 k.subjet = std::move(subjet_set);
52 }
else if (k.subjet != subjet_set) {
53 std::string
error =
"mismatch in subjet keys: we expect the same"
54 " variables to be read from each subjet. ";
55 error.append(
"first subjet (" + first_match +
") "
56 + formatSet(k.subjet) +
", match "
57 + std::to_string(k.n_subjets)
58 +
", (" +
node.
name +
") " + formatSet(subjet_set));
59 throw std::runtime_error(
error);
63 throw std::runtime_error(
"no way to match '" +
node.
name +
"'");