ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
24class MsgStream;
25
26namespace 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 = {{
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 BooleanProperty m_useEdgeLayerConnector{this, "useEdgeLayerConnector", false, "Use the EdgeLayerConnector instead of CC&JR as graph segmentation algorithm"};
77 IntegerProperty m_elcMaxHitsPerTrack{this, "elcMaxHitsPerTrack", 30, "Max hits per track config for the EdgeLayerConnector"};
78
79 // Tool handles
80 ToolHandle<ISpacepointFeatureTool> m_spacepointFeatureTool{
81 this, "SpacepointFeatureTool", "InDet::SpacepointFeatureTool"};
82
83 // ACTS pipeline
84 std::unique_ptr<ActsPlugins::GnnPipeline> m_gnnPipeline;
85 std::unique_ptr<const Acts::Logger> m_logger;
86
87 // Present for ONNX and Torch (not thread-safe); absent for TRT (handles concurrency internally)
88 mutable std::optional<std::mutex> m_runMutex ATLAS_THREAD_SAFE{};
89 };
90
91}
92
93#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