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