ATLAS Offline Software
Loading...
Searching...
No Matches
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
13namespace MuonML {
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}{}
32
33 NodeFeature(NodeFeature&& other) = default;
34
36 const std::string& name() const {
37 return m_name;
38 }
39
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
The LayerSpBucket is a space pointbucket where the points are internally sorted by their layer number...
Definition LayerBucket.h:14
std::string m_name
Definition NodeFeature.h:46
NodeFeature(NodeFeature &&other)=default
Standard move assignment & move constructor.
LayerSpBucket Bucket_t
Abreviation of the Space point bucket type.
Definition NodeFeature.h:19
const std::string & name() const
Returns the feature name.
Definition NodeFeature.h:36
double eval(const Bucket_t &bucket, size_t spIndex) const
Extract the feature from a space point inside the bucket.
Definition NodeFeature.h:42
std::function< double(const Bucket_t &, size_t)> Func_t
Lambda function type to extract the feature from a bucket.
Definition NodeFeature.h:24
NodeFeature(const std::string &featName, const Func_t &extractFunc)
Standard constructor to build a feature.
Definition NodeFeature.h:29