ATLAS Offline Software
Loading...
Searching...
No Matches
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
using SequenceFromTracks

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

◆ 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 206 of file InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/Root/CustomGetterUtils.cxx.

206 {
207 auto getter = customGetter(name);
208 return [name, getter](const xAOD::Vertex& j) {
209 return std::make_pair(name, getter(j));
210 };
211 }

◆ 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 221 of file InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/Root/CustomGetterUtils.cxx.

221 {
222
223 if (auto getter = getterFromIParticles<T>(name)){
224 return {*getter, {}};
225 }
226 throw std::logic_error("no match for custom getter " + name);
227 }

◆ 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 )