ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetGNNTracking
src
ActsGnnModuleMapFinderTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef ActsGnnModuleMapFinderTool_H
6
#define ActsGnnModuleMapFinderTool_H
7
8
9
10
#include "
AthenaBaseComps/AthAlgTool.h
"
11
#include "
InDetRecToolInterfaces/IGNNTrackFinder.h
"
12
#include "
ISpacepointFeatureTool.h
"
13
#include "Acts/Utilities/Logger.hpp"
14
#include "ActsPlugins/Gnn/GnnPipeline.hpp"
15
16
#include <array>
17
#include <memory>
18
#include <mutex>
19
#include <optional>
20
#include <string>
21
#include <vector>
22
#include <cstdint>
23
24
class
MsgStream;
25
26
namespace
InDet
{
27
34
class
ActsGnnModuleMapFinderTool
:
public
extends<AthAlgTool, IGNNTrackFinder>
35
{
36
public
:
37
using
extends::extends;
38
39
virtual
StatusCode
initialize
()
override
;
40
41
virtual
StatusCode
getTracks
(
42
const
std::vector<const Trk::SpacePoint*>& spacepoints,
43
std::vector<std::vector<uint32_t>>& tracks,
44
std::unordered_map<
int
, std::unordered_map<int, float>>* edgeMap =
nullptr
)
const override
;
45
46
virtual
MsgStream&
dump
(MsgStream& out)
const override
;
47
virtual
std::ostream&
dump
(std::ostream& out)
const override
;
48
49
private
:
50
// Hardcoded feature configuration for module-map chain
51
static
constexpr
std::size_t
NUM_FEATURES
= 12;
52
53
static
constexpr
std::array<const char*, NUM_FEATURES>
FEATURE_NAMES
= {{
54
"r"
,
"phi"
,
"z"
,
"eta"
,
55
"cluster_r_1"
,
"cluster_phi_1"
,
"cluster_z_1"
,
"cluster_eta_1"
,
56
"cluster_r_2"
,
"cluster_phi_2"
,
"cluster_z_2"
,
"cluster_eta_2"
57
}};
58
59
static
constexpr
float
kScaleR
= 1000.f;
60
static
constexpr
float
kScalePhi
= 3.14159265359f;
61
static
constexpr
float
kScaleZ
= 1000.f;
62
static
constexpr
float
kScaleEta
= 1.f;
63
64
static
constexpr
std::array<float, NUM_FEATURES>
FEATURE_SCALES
= {{
65
kScaleR
,
kScalePhi
,
kScaleZ
,
kScaleEta
,
66
kScaleR
,
kScalePhi
,
kScaleZ
,
kScaleEta
,
67
kScaleR
,
kScalePhi
,
kScaleZ
,
kScaleEta
68
}};
69
70
// Gaudi properties
71
StringProperty
m_moduleMapPath
{
this
,
"moduleMapPath"
,
""
,
"Path to module map ROOT files"
};
72
StringProperty
m_gnnPath
{
this
,
"gnnPath"
,
""
,
"Path to GNN model (.onnx, .pt, or .engine)"
};
73
FloatProperty
m_edgeCut
{
this
,
"edgeCut"
, 0.5,
"Edge classification cut"
};
74
UnsignedIntegerProperty
m_numTrtContexts
{
this
,
"numTrtContexts"
, 1,
"Number of TensorRT execution contexts (controls concurrency)"
};
75
UnsignedIntegerProperty
m_minCandidateMeasurements
{
this
,
"minCandidateMeasurements"
, 7,
"Min measurements per candidate"
};
76
StringProperty
m_trackBuilder
{
77
this
,
"trackBuilder"
,
"junctionremoval"
,
78
"Graph segmentation algorithm: junctionremoval, edgelayerconnector, or dwalk"
};
79
IntegerProperty
m_elcMaxHitsPerTrack
{
this
,
"elcMaxHitsPerTrack"
, 30,
"Max hits per track config for the EdgeLayerConnector"
};
80
81
// Tool handles
82
ToolHandle<ISpacepointFeatureTool>
m_spacepointFeatureTool
{
83
this
,
"SpacepointFeatureTool"
,
"InDet::SpacepointFeatureTool"
};
84
85
// ACTS pipeline
86
std::unique_ptr<ActsPlugins::GnnPipeline>
m_gnnPipeline
;
87
std::unique_ptr<const Acts::Logger>
m_logger
;
88
89
// Present for ONNX and Torch (not thread-safe); absent for TRT (handles concurrency internally)
90
mutable
std::optional<std::mutex> m_runMutex
ATLAS_THREAD_SAFE
{};
91
};
92
93
}
94
95
#endif
AthAlgTool.h
IGNNTrackFinder.h
ISpacepointFeatureTool.h
InDet::ActsGnnModuleMapFinderTool
Tool that produces track candidates using the ACTS GNN pipeline with module-map graph construction,...
Definition
ActsGnnModuleMapFinderTool.h:35
InDet::ActsGnnModuleMapFinderTool::initialize
virtual StatusCode initialize() override
InDet::ActsGnnModuleMapFinderTool::m_numTrtContexts
UnsignedIntegerProperty m_numTrtContexts
Definition
ActsGnnModuleMapFinderTool.h:74
InDet::ActsGnnModuleMapFinderTool::kScaleEta
static constexpr float kScaleEta
Definition
ActsGnnModuleMapFinderTool.h:62
InDet::ActsGnnModuleMapFinderTool::kScaleZ
static constexpr float kScaleZ
Definition
ActsGnnModuleMapFinderTool.h:61
InDet::ActsGnnModuleMapFinderTool::dump
virtual MsgStream & dump(MsgStream &out) const override
InDet::ActsGnnModuleMapFinderTool::m_trackBuilder
StringProperty m_trackBuilder
Definition
ActsGnnModuleMapFinderTool.h:76
InDet::ActsGnnModuleMapFinderTool::kScaleR
static constexpr float kScaleR
Definition
ActsGnnModuleMapFinderTool.h:59
InDet::ActsGnnModuleMapFinderTool::kScalePhi
static constexpr float kScalePhi
Definition
ActsGnnModuleMapFinderTool.h:60
InDet::ActsGnnModuleMapFinderTool::ATLAS_THREAD_SAFE
std::optional< std::mutex > m_runMutex ATLAS_THREAD_SAFE
Definition
ActsGnnModuleMapFinderTool.h:90
InDet::ActsGnnModuleMapFinderTool::m_minCandidateMeasurements
UnsignedIntegerProperty m_minCandidateMeasurements
Definition
ActsGnnModuleMapFinderTool.h:75
InDet::ActsGnnModuleMapFinderTool::FEATURE_SCALES
static constexpr std::array< float, NUM_FEATURES > FEATURE_SCALES
Definition
ActsGnnModuleMapFinderTool.h:64
InDet::ActsGnnModuleMapFinderTool::dump
virtual std::ostream & dump(std::ostream &out) const override
InDet::ActsGnnModuleMapFinderTool::FEATURE_NAMES
static constexpr std::array< const char *, NUM_FEATURES > FEATURE_NAMES
Definition
ActsGnnModuleMapFinderTool.h:53
InDet::ActsGnnModuleMapFinderTool::m_edgeCut
FloatProperty m_edgeCut
Definition
ActsGnnModuleMapFinderTool.h:73
InDet::ActsGnnModuleMapFinderTool::m_logger
std::unique_ptr< const Acts::Logger > m_logger
Definition
ActsGnnModuleMapFinderTool.h:87
InDet::ActsGnnModuleMapFinderTool::m_elcMaxHitsPerTrack
IntegerProperty m_elcMaxHitsPerTrack
Definition
ActsGnnModuleMapFinderTool.h:79
InDet::ActsGnnModuleMapFinderTool::m_moduleMapPath
StringProperty m_moduleMapPath
Definition
ActsGnnModuleMapFinderTool.h:71
InDet::ActsGnnModuleMapFinderTool::m_spacepointFeatureTool
ToolHandle< ISpacepointFeatureTool > m_spacepointFeatureTool
Definition
ActsGnnModuleMapFinderTool.h:82
InDet::ActsGnnModuleMapFinderTool::NUM_FEATURES
static constexpr std::size_t NUM_FEATURES
Definition
ActsGnnModuleMapFinderTool.h:51
InDet::ActsGnnModuleMapFinderTool::getTracks
virtual StatusCode getTracks(const std::vector< const Trk::SpacePoint * > &spacepoints, std::vector< std::vector< uint32_t > > &tracks, std::unordered_map< int, std::unordered_map< int, float > > *edgeMap=nullptr) const override
InDet::ActsGnnModuleMapFinderTool::m_gnnPath
StringProperty m_gnnPath
Definition
ActsGnnModuleMapFinderTool.h:72
InDet::ActsGnnModuleMapFinderTool::m_gnnPipeline
std::unique_ptr< ActsPlugins::GnnPipeline > m_gnnPipeline
Definition
ActsGnnModuleMapFinderTool.h:86
InDet
Primary Vertex Finder.
Definition
VP1ErrorUtils.h:36
Generated on
for ATLAS Offline Software by
1.17.0