ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
EFTracking
FPGATrackSim
FPGATrackSimGNN
src
FPGATrackSimGNNEdgeClassifierTool.h
Go to the documentation of this file.
1
// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3
#ifndef FPGATRACKSIMGNNEDGECLASSIFIERTOOL_H
4
#define FPGATRACKSIMGNNEDGECLASSIFIERTOOL_H
5
16
17
#include "
AthenaBaseComps/AthAlgTool.h
"
18
19
#include "
FPGATrackSimObjects/FPGATrackSimGNNHit.h
"
20
#include "
FPGATrackSimObjects/FPGATrackSimGNNEdge.h
"
21
22
#include "
AthOnnxInterfaces/IOnnxRuntimeInferenceTool.h
"
23
#include <onnxruntime_cxx_api.h>
24
25
class
FPGATrackSimGNNEdgeClassifierTool
:
public
AthAlgTool
26
{
27
public
:
28
30
// AthAlgTool
31
32
FPGATrackSimGNNEdgeClassifierTool
(
const
std::string&,
const
std::string&,
const
IInterface*);
33
34
virtual
StatusCode
initialize
()
override
;
35
37
// Functions
38
39
virtual
StatusCode
scoreEdges
(
const
std::vector<std::shared_ptr<FPGATrackSimGNNHit>> & hits, std::vector<std::shared_ptr<FPGATrackSimGNNEdge>> & edges);
40
int
regionNum
()
const
{
return
m_regionNum
; }
41
42
private
:
43
45
// Handles
46
47
ToolHandle<AthOnnx::IOnnxRuntimeInferenceTool>
m_GNNInferenceTool
{
this
,
"GNNInferenceTool"
,
"AthOnnx::OnnxRuntimeInferenceTool"
};
48
Gaudi::Property<int>
m_regionNum
{
this
,
"regionNum"
, -1,
"Region number for this GNNEdgeClassifierTool"
};
49
Gaudi::Property<bool>
m_doGNNPixelSeeding
{
this
,
"doGNNPixelSeeding"
,
false
,
"Flag to configure for GNN Pixel Seeding"
};
50
52
// Helpers
53
54
std::vector<float>
getNodeFeatures
(
const
std::vector<std::shared_ptr<FPGATrackSimGNNHit>> & hits);
55
std::vector<int64_t>
getEdgeList
(
const
std::vector<std::shared_ptr<FPGATrackSimGNNEdge>> & edges);
56
std::vector<float>
getEdgeFeatures
(std::vector<std::shared_ptr<FPGATrackSimGNNEdge>> & edges,
const
std::vector<float> & gNodeFeatures);
57
void
computeEdgeFeatures
(std::shared_ptr<FPGATrackSimGNNEdge>& edge,
const
int
& hit1_index,
const
int
& hit2_index,
const
std::vector<float> & gNodeFeatures);
58
59
StringArrayProperty
m_gnnFeatureNamesVec
{
60
this
,
"GNNFeatureNames"
,
61
{
"r"
,
"phi"
,
"z"
,
"eta"
,
"cluster_r_1"
,
"cluster_phi_1"
,
"cluster_z_1"
,
"cluster_eta_1"
,
"cluster_r_2"
,
"cluster_phi_2"
,
"cluster_z_2"
,
"cluster_eta_2"
},
62
"Feature names for the GNN model"
};
63
FloatArrayProperty
m_gnnFeatureScalesVec
{
64
this
,
"GNNFeatureScales"
,
65
{1000.0, 3.14159265359, 1000.0, 1.0, 1000.0, 3.14159265359, 1000.0, 1.0, 1000.0, 3.14159265359, 1000.0, 1.0},
66
"Feature scales for the GNN model"
};
67
68
StringArrayProperty
m_gnnFeatureNamesVec_pixelOnly
{
69
this
,
"GNNFeatureNames"
,
70
{
"r"
,
"phi"
,
"z"
,
"eta"
},
71
"Feature names for the GNN model"
};
72
FloatArrayProperty
m_gnnFeatureScalesVec_pixelOnly
{
73
this
,
"GNNFeatureScales"
,
74
{1000.0, 3.14159265359, 1000.0, 1.0},
75
"Feature scales for the GNN model"
};
76
};
77
78
79
#endif
// FPGATRACKSIMGNNEDGECLASSIFIERTOOL_H
AthAlgTool.h
FPGATrackSimGNNEdge.h
FPGATrackSim-specific class to represent an edge as a connection between two hits in the detector use...
FPGATrackSimGNNHit.h
FPGATrackSim-specific class to represent an hit in the detector used for GNN pattern recognition.
IOnnxRuntimeInferenceTool.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
FPGATrackSimGNNEdgeClassifierTool::m_gnnFeatureScalesVec
FloatArrayProperty m_gnnFeatureScalesVec
Definition
FPGATrackSimGNNEdgeClassifierTool.h:63
FPGATrackSimGNNEdgeClassifierTool::computeEdgeFeatures
void computeEdgeFeatures(std::shared_ptr< FPGATrackSimGNNEdge > &edge, const int &hit1_index, const int &hit2_index, const std::vector< float > &gNodeFeatures)
Definition
FPGATrackSimGNNEdgeClassifierTool.cxx:139
FPGATrackSimGNNEdgeClassifierTool::getEdgeList
std::vector< int64_t > getEdgeList(const std::vector< std::shared_ptr< FPGATrackSimGNNEdge > > &edges)
Definition
FPGATrackSimGNNEdgeClassifierTool.cxx:104
FPGATrackSimGNNEdgeClassifierTool::m_GNNInferenceTool
ToolHandle< AthOnnx::IOnnxRuntimeInferenceTool > m_GNNInferenceTool
Definition
FPGATrackSimGNNEdgeClassifierTool.h:47
FPGATrackSimGNNEdgeClassifierTool::m_gnnFeatureScalesVec_pixelOnly
FloatArrayProperty m_gnnFeatureScalesVec_pixelOnly
Definition
FPGATrackSimGNNEdgeClassifierTool.h:72
FPGATrackSimGNNEdgeClassifierTool::regionNum
int regionNum() const
Definition
FPGATrackSimGNNEdgeClassifierTool.h:40
FPGATrackSimGNNEdgeClassifierTool::initialize
virtual StatusCode initialize() override
Definition
FPGATrackSimGNNEdgeClassifierTool.cxx:14
FPGATrackSimGNNEdgeClassifierTool::m_doGNNPixelSeeding
Gaudi::Property< bool > m_doGNNPixelSeeding
Definition
FPGATrackSimGNNEdgeClassifierTool.h:49
FPGATrackSimGNNEdgeClassifierTool::m_gnnFeatureNamesVec
StringArrayProperty m_gnnFeatureNamesVec
Definition
FPGATrackSimGNNEdgeClassifierTool.h:59
FPGATrackSimGNNEdgeClassifierTool::m_gnnFeatureNamesVec_pixelOnly
StringArrayProperty m_gnnFeatureNamesVec_pixelOnly
Definition
FPGATrackSimGNNEdgeClassifierTool.h:68
FPGATrackSimGNNEdgeClassifierTool::getEdgeFeatures
std::vector< float > getEdgeFeatures(std::vector< std::shared_ptr< FPGATrackSimGNNEdge > > &edges, const std::vector< float > &gNodeFeatures)
Definition
FPGATrackSimGNNEdgeClassifierTool.cxx:121
FPGATrackSimGNNEdgeClassifierTool::scoreEdges
virtual StatusCode scoreEdges(const std::vector< std::shared_ptr< FPGATrackSimGNNHit > > &hits, std::vector< std::shared_ptr< FPGATrackSimGNNEdge > > &edges)
Definition
FPGATrackSimGNNEdgeClassifierTool.cxx:27
FPGATrackSimGNNEdgeClassifierTool::getNodeFeatures
std::vector< float > getNodeFeatures(const std::vector< std::shared_ptr< FPGATrackSimGNNHit > > &hits)
Definition
FPGATrackSimGNNEdgeClassifierTool.cxx:57
FPGATrackSimGNNEdgeClassifierTool::FPGATrackSimGNNEdgeClassifierTool
FPGATrackSimGNNEdgeClassifierTool(const std::string &, const std::string &, const IInterface *)
Definition
FPGATrackSimGNNEdgeClassifierTool.cxx:11
FPGATrackSimGNNEdgeClassifierTool::m_regionNum
Gaudi::Property< int > m_regionNum
Definition
FPGATrackSimGNNEdgeClassifierTool.h:48
Generated on
for ATLAS Offline Software by
1.17.0