ATLAS Offline Software
Loading...
Searching...
No Matches
InDetGNNHardScatterSelection::getter_utils::CustomSequenceGetter< T > Class Template Reference

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

#include <CustomGetterUtils.h>

Collaboration diagram for InDetGNNHardScatterSelection::getter_utils::CustomSequenceGetter< T >:

Public Types

using Constituents = std::vector<const T*>
using NamedSequenceFromConstituents

Public Member Functions

 CustomSequenceGetter (const std::vector< InputVariableConfig > &inputs)
std::pair< std::vector< float >, std::vector< int64_t > > getFeats (const xAOD::Vertex &jet, const Constituents &constituents) const

Private Member Functions

std::pair< NamedSequenceFromConstituents, std::set< std::string > > customNamedSeqGetterWithDeps (const std::string &name)
std::pair< NamedSequenceFromConstituents, std::set< std::string > > seqFromConsituents (const InputVariableConfig &cfg)

Private Attributes

std::vector< NamedSequenceFromConstituentsm_sequencesFromConstituents

Detailed Description

template<typename T>
class InDetGNNHardScatterSelection::getter_utils::CustomSequenceGetter< T >

Template class to extract features from sequence of constituents.

Template Parameters
Tconstituent type

It supports the following types of constituents:

Definition at line 81 of file InnerDetector/InDetRecTools/InDetGNNHardScatterSelection/InDetGNNHardScatterSelection/CustomGetterUtils.h.

Member Typedef Documentation

◆ Constituents

◆ NamedSequenceFromConstituents

template<typename T>
using InDetGNNHardScatterSelection::getter_utils::CustomSequenceGetter< T >::NamedSequenceFromConstituents

Constructor & Destructor Documentation

◆ CustomSequenceGetter()

Member Function Documentation

◆ customNamedSeqGetterWithDeps()

template<typename T>
std::pair< typename CustomSequenceGetter< T >::NamedSequenceFromConstituents, std::set< std::string > > InDetGNNHardScatterSelection::getter_utils::CustomSequenceGetter< T >::customNamedSeqGetterWithDeps ( const std::string & name)
private

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

234 {
236 return {
237 [n=name, g=getter](const xAOD::Vertex& j,
238 const std::vector<const T*>& t) {
239 return std::make_pair(n, g(j, t));
240 },
241 deps
242 };
243 }
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)

◆ getFeats()

template<typename T>
std::pair< std::vector< float >, std::vector< int64_t > > InDetGNNHardScatterSelection::getter_utils::CustomSequenceGetter< T >::getFeats ( const xAOD::Vertex & jet,
const Constituents & constituents ) const

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

286 {
289 int num_cnsts = 0;
290
291 int cnst_var_idx = 0;
292 for (const auto& seq_builder: m_sequencesFromConstituents){
294
295 if (cnst_var_idx==0){
296 num_cnsts = static_cast<int>(double_vec.size());
298 }
299
300 // need to transpose + flatten
301 for (unsigned int cnst_idx=0; cnst_idx<double_vec.size(); cnst_idx++){
303 = double_vec.at(cnst_idx);
304 }
305 cnst_var_idx++;
306 }
308 return {cnsts_feats, cnsts_feat_dim};
309 }

◆ seqFromConsituents()

template<typename T>
std::pair< typename CustomSequenceGetter< T >::NamedSequenceFromConstituents, std::set< std::string > > InDetGNNHardScatterSelection::getter_utils::CustomSequenceGetter< T >::seqFromConsituents ( const InputVariableConfig & cfg)
private

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

248 {
249 switch (cfg.type) {
250 case ConstituentsEDMType::INT: return {
251 SequenceGetter<int, T>(cfg.name), {cfg.name}
252 };
253 case ConstituentsEDMType::FLOAT: return {
254 SequenceGetter<float, T>(cfg.name), {cfg.name}
255 };
256 case ConstituentsEDMType::CHAR: return {
257 SequenceGetter<char, T>(cfg.name), {cfg.name}
258 };
259 case ConstituentsEDMType::UCHAR: return {
261 };
264 cfg.name);
265 }
266 default: {
267 throw std::logic_error("Unknown EDM type for constituent.");
268 }
269 }
270 }
std::pair< NamedSequenceFromConstituents, std::set< std::string > > customNamedSeqGetterWithDeps(const std::string &name)

Member Data Documentation

◆ m_sequencesFromConstituents


The documentation for this class was generated from the following files: