Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
NodeFeature.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONINFERENCEINTERACES_GRAPHFEATURE_H
5 #define MUONINFERENCEINTERACES_GRAPHFEATURE_H
6 
7 
8 #include <functional>
9 #include <string>
10 
12 
13 namespace MuonML {
16  class NodeFeature {
17  public:
20 
24  using Func_t = std::function<double(const Bucket_t&, size_t)>;
25 
29  NodeFeature(const std::string& featName,
30  const Func_t& extractFunc):
31  m_name{featName}, m_func{extractFunc}{}
34 
36  const std::string& name() const {
37  return m_name;
38  }
42  double eval(const Bucket_t& bucket, size_t spIndex) const {
43  return m_func(bucket, spIndex);
44  }
45  private:
46  std::string m_name{};
47  Func_t m_func{[](const Bucket_t& , size_t) { return 0.; }};
48  };
49 }
50 #endif
MuonML::NodeFeature::NodeFeature
NodeFeature(NodeFeature &&other)=default
Standard move assignment & move constructor.
MuonML::NodeFeature::name
const std::string & name() const
Returns the feature name.
Definition: NodeFeature.h:36
MuonML::NodeFeature::m_func
Func_t m_func
Definition: NodeFeature.h:47
MuonML
Definition: GraphBucketFilterTool.cxx:9
MuonML::NodeFeature::m_name
std::string m_name
Definition: NodeFeature.h:46
MuonML::NodeFeature::NodeFeature
NodeFeature(const std::string &featName, const Func_t &extractFunc)
Standard constructor to build a feature.
Definition: NodeFeature.h:29
MuonML::LayerSpBucket
The LayerSpBucket is a space pointbucket where the points are internally sorted by their layer number...
Definition: LayerBucket.h:14
MuonML::NodeFeature::eval
double eval(const Bucket_t &bucket, size_t spIndex) const
Extract the feature from a space point inside the bucket.
Definition: NodeFeature.h:42
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
LayerBucket.h
MuonML::NodeFeature
The NodeFeature is the gluing instance to extract the information from the space point inside a MuonB...
Definition: NodeFeature.h:16
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
MuonML::NodeFeature::Func_t
std::function< double(const Bucket_t &, size_t)> Func_t
Lambda function type to extract the feature from a bucket.
Definition: NodeFeature.h:24