ATLAS Offline Software
Classes | Typedefs | Functions
InDetGNNHardScatterSelection::getter_utils Namespace Reference

Utils to produce Constituent -> vector<double> functions. More...

Classes

class  CustomSequenceGetter
 Template class to extract features from sequence of constituents. More...
 

Typedefs

using IParticles = std::vector< const xAOD::IParticle * >
 
using Tracks = std::vector< const xAOD::TrackParticle * >
 
using SequenceFromIParticles = std::function< std::vector< double >(const xAOD::Vertex &, const IParticles &)>
 
using SequenceFromTracks = std::function< std::vector< double >(const xAOD::Vertex &, const Tracks &)>
 

Functions

std::function< std::pair< std::string, double >const xAOD::Vertex &)> customGetterAndName (const std::string &)
 
template<typename T >
std::pair< std::function< std::vector< double > const xAOD::Vertex &, const std::vector< const T * > &)>, std::set< std::string > > customSequenceGetterWithDeps (const std::string &name, const std::string &prefix)
 
template<typename T >
std::pair< std::function< std::vector< double > const xAOD::Vertex &, const std::vector< const T * > &)>, std::set< std::string > > customSequenceGetterWithDeps (const std::string &name)
 

Detailed Description

Utils to produce Constituent -> vector<double> functions.

The GNN configures its inputs when the algorithm is initalized, meaning that the list of vertex and constituent properties that are used as inputs won't be known at compile time. Instead we build an array of "getter" functions, each of which returns one input for the tagger. The function here returns those getter functions.

Many of the getter functions are trivial: they will, for example, read one double of auxdata off of the Vertex object. The sequence input getters tend to be more complicated. Since we'd like to avoid reimplementing the logic in these functions in multiple places, they are exposed here.

NOTE: This file is for experts only, don't expect support.

Typedef Documentation

◆ IParticles

◆ SequenceFromIParticles

◆ SequenceFromTracks

using InDetGNNHardScatterSelection::getter_utils::SequenceFromTracks = typedef std::function<std::vector<double>( const xAOD::Vertex&, const Tracks&)>

◆ Tracks

Function Documentation

◆ customGetterAndName()

std::function< std::pair< std::string, double >const xAOD::Vertex &)> InDetGNNHardScatterSelection::getter_utils::customGetterAndName ( const std::string &  name)

Definition at line 196 of file InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/Root/CustomGetterUtils.cxx.

196  {
197  auto getter = customGetter(name);
198  return [name, getter](const xAOD::Vertex& j) {
199  return std::make_pair(name, getter(j));
200  };
201  }

◆ customSequenceGetterWithDeps() [1/2]

template<typename T >
std::pair< std::function<std::vector<double> const xAOD::Vertex&, const std::vector<const T*>&)>, std::set<std::string> > InDetGNNHardScatterSelection::getter_utils::customSequenceGetterWithDeps ( const std::string &  name)

Definition at line 211 of file InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/Root/CustomGetterUtils.cxx.

211  {
212 
213  if (auto getter = getterFromIParticles<T>(name)){
214  return {*getter, {}};
215  }
216  throw std::logic_error("no match for custom getter " + name);
217  }

◆ customSequenceGetterWithDeps() [2/2]

template<typename T >
std::pair< std::function<std::vector<double> const xAOD::Vertex&, const std::vector<const T*>&)>, std::set<std::string> > InDetGNNHardScatterSelection::getter_utils::customSequenceGetterWithDeps ( const std::string &  name,
const std::string &  prefix 
)
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42