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 (lwt::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 ( lwt::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|sumPt|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"_r, EDMType::CUSTOM_GETTER},
129  };
130 
131  StringRegexes default_flag_regexes{
132  {"ntrk|sumPt2|sumPt|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)"_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  for (const auto& var: node.variables) {
139  input_names.push_back(var.name);
140  }
141  input_config = get_input_config(input_names, type_regexes, default_flag_regexes);
142  }
143 
144  // build the constituents inputs
145  std::vector<std::pair<std::string, std::vector<std::string>>> constituent_names;
146  for (auto& node: config.input_sequences) {
147 
148  std::vector<std::string> names;
149  for (const auto& var: node.variables) {
150  names.push_back(var.name);
151  }
152  constituent_names.emplace_back(node.name, names);
153  }
154 
155  std::vector<ConstituentsInputConfig> constituent_configs;
156  for (auto el: constituent_names){
157  constituent_configs.push_back(
158  createConstituentsLoaderConfig(el.first, el.second));
159  }
160 
161  return std::make_tuple(input_config, constituent_configs);
162  }

◆ createVertexVarGetters()

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

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

170  {
171  std::vector<internal::VarFromVertex> varsFromVertex;
172 
173  for (const auto& input: inputs) {
174  if (input.type != EDMType::CUSTOM_GETTER) {
175  auto filler = internal::get::varFromVertex(input.name, input.type,
176  input.default_flag);
177  varsFromVertex.push_back(filler);
178  } else {
179  varsFromVertex.push_back(getter_utils::customGetterAndName(input.name));
180  }
181  }
182 
183  return varsFromVertex;
184  }
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
InDetGNNHardScatterSelection::createConstituentsLoaderConfig
ConstituentsInputConfig createConstituentsLoaderConfig(std::string name, 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
plotIsoValidation.el
el
Definition: plotIsoValidation.py:197
InDetGNNHardScatterSelection::dataprep::StringRegexes
std::vector< std::pair< std::regex, std::string > > StringRegexes
Definition: InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/InDetGNNHardScatterSelection/DataPrepUtilities.h:127
node::name
void name(const std::string &n)
Definition: node.h:38
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:196
node
Definition: memory_hooks-stdcmalloc.h:74