ATLAS Offline Software
Typedefs | Functions
InDetGNNHardScatterSelection::dataprep Namespace Reference

Typedefs

typedef std::vector< std::pair< std::regex, std::string > > StringRegexes
 

Functions

std::tuple< std::vector< HSGNNInputConfig >, std::vector< ConstituentsInputConfig > > createGetterConfig (FlavorTagInference::SaltModelGraphConfig::GraphConfig &graph_config)
 
std::vector< internal::VarFromVertexcreateVertexVarGetters (const std::vector< HSGNNInputConfig > &inputs)
 

Typedef Documentation

◆ StringRegexes

typedef std::vector<std::pair<std::regex, std::string> > InDetGNNHardScatterSelection::dataprep::StringRegexes

Function Documentation

◆ createGetterConfig()

std::tuple< std::vector< HSGNNInputConfig >, std::vector< ConstituentsInputConfig > > InDetGNNHardScatterSelection::dataprep::createGetterConfig ( FlavorTagInference::SaltModelGraphConfig::GraphConfig graph_config)

Definition at line 118 of file InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/Root/DataPrepUtilities.cxx.

119  {
120 
121  // build the standard inputs
122 
123  // type and default value-finding regexes are hardcoded for now
124  TypeRegexes type_regexes = {
125  {".*_isDefaults"_r, EDMType::CHAR},
126  {"sumPt2|chi2Over_ndf|z_asymmetry|weighted_z_asymmetry|z_kurtosis|z_skewness|photon_deltaz|photon_deltaPhi|actualIntPerXing"_r, EDMType::FLOAT},
127  {"ntrk"_r, EDMType::INT},
128  {"(log_)?pt|abs_eta|eta|phi|energy|mass|sumPt"_r, EDMType::CUSTOM_GETTER},
129  };
130 
131  StringRegexes default_flag_regexes{
132  {"ntrk|sumPt2|chi2Over_ndf|z_asymmetry|weighted_z_asymmetry|z_kurtosis|z_skewness|photon_deltaz|photon_deltaPhi|actualIntPerXing"_r, ""},
133  {"((log_)?pt|abs_eta|eta|phi|energy|mass|sumPt)"_r, ""}}; // no default for custom cases
134 
135  std::vector<HSGNNInputConfig> input_config;
136  for (auto& node: config.inputs){
137  std::vector<std::string> input_names;
138  input_names.reserve(node.variables.size());
139 for (const auto& var: node.variables) {
140  input_names.push_back(var.name);
141  }
142  input_config = get_input_config(input_names, type_regexes, default_flag_regexes);
143  }
144 
145  // build the constituents inputs
146  std::vector<std::pair<std::string, std::vector<std::string>>> constituent_names;
147  for (auto& node: config.input_sequences) {
148 
149  std::vector<std::string> names;
150  names.reserve(node.variables.size());
151 for (const auto& var: node.variables) {
152  names.push_back(var.name);
153  }
154  constituent_names.emplace_back(node.name, names);
155  }
156 
157  std::vector<ConstituentsInputConfig> constituent_configs;
158  constituent_configs.reserve(constituent_names.size());
159 for (const auto& el: constituent_names){
160  constituent_configs.push_back(
161  createConstituentsLoaderConfig(el.first, el.second));
162  }
163 
164  return std::make_tuple(input_config, constituent_configs);
165  }

◆ createVertexVarGetters()

std::vector< internal::VarFromVertex > InDetGNNHardScatterSelection::dataprep::createVertexVarGetters ( const std::vector< HSGNNInputConfig > &  inputs)

Definition at line 171 of file InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/Root/DataPrepUtilities.cxx.

173  {
174  std::vector<internal::VarFromVertex> varsFromVertex;
175 
176  for (const auto& input: inputs) {
177  if (input.type != EDMType::CUSTOM_GETTER) {
178  auto filler = internal::get::varFromVertex(input.name, input.type,
179  input.default_flag);
180  varsFromVertex.push_back(filler);
181  } else {
182  varsFromVertex.push_back(getter_utils::customGetterAndName(input.name));
183  }
184  }
185 
186  return varsFromVertex;
187  }
beamspotnt.var
var
Definition: bin/beamspotnt.py:1393
InDetGNNHardScatterSelection::createConstituentsLoaderConfig
ConstituentsInputConfig createConstituentsLoaderConfig(const std::string &name, const std::vector< std::string > &input_variables)
Definition: InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/Root/ConstituentsLoader.cxx:49
postInclude.inputs
inputs
Definition: postInclude.SortInput.py:15
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
InDetGNNHardScatterSelection::internal::get::varFromVertex
VarFromVertex varFromVertex(const std::string &name, EDMType, const std::string &defaultflag)
Definition: InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/Root/DataPrepUtilities.cxx:71
python.subdetectors.mmg.names
names
Definition: mmg.py:8
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
python.getProblemFolderFromLogs.el
dictionary el
Definition: getProblemFolderFromLogs.py:48
InDetGNNHardScatterSelection::dataprep::StringRegexes
std::vector< std::pair< std::regex, std::string > > StringRegexes
Definition: InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/InDetGNNHardScatterSelection/DataPrepUtilities.h:126
node::name
void name(const std::string &n)
Definition: node.h:37
InDetGNNHardScatterSelection::getter_utils::customGetterAndName
std::function< std::pair< std::string, double >const xAOD::Vertex &)> customGetterAndName(const std::string &)
Definition: InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/Root/CustomGetterUtils.cxx:206
node
Definition: node.h:21