ATLAS Offline Software
Loading...
Searching...
No Matches
GnnPipelineTool.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 ACTSGNN_GNNPIPELINETOOL_H
6#define ACTSGNN_GNNPIPELINETOOL_H
7
8#include <cstdint>
9#include <memory>
10#include <optional>
11#include <semaphore>
12#include <string>
13#include <vector>
14
16#include "ActsInterop/Logger.h"
19#include "GaudiKernel/IChronoStatSvc.h"
20#include "GaudiKernel/ServiceHandle.h"
21
22class PixelID;
23class SCT_ID;
24
25#ifdef ACTS_GNN_WITH_MODULEMAP
26namespace ActsPlugins {
27class GnnPipeline;
28} // namespace ActsPlugins
29#endif
30
31
32namespace ActsTrk {
33
34class GnnPipelineTool : public extends<AthAlgTool, IGnnPipelineTool> {
35 public:
36 GnnPipelineTool(const std::string& type, const std::string& name,
37 const IInterface* parent);
39
40 StatusCode initialize() override;
41
42 StatusCode buildSeed(
43 const std::vector<const xAOD::SpacePointContainer*>&
44 spacePointCollections,
45 ActsTrk::SeedContainer& seeds) const override;
46
47 private:
48 Gaudi::Property<std::string> m_moduleMapPath{this, "moduleMapPath", "",
49 "Path to the module map files"};
50 Gaudi::Property<std::string> m_gnnPath{this, "gnnPath", "",
51 "Path to the gnn file"};
52 Gaudi::Property<bool> m_usePhiOverlapSps{
53 this, "usePhiOverlapSps", false,
54 "Whether to use phi overlap spacepoints"};
55 Gaudi::Property<unsigned int> m_maxGpuInstances{
56 this, "maxGpuInstances", 1,
57 "Number of events that can be on GPU in parallel"};
58 Gaudi::Property<unsigned int> m_numTrtContexts{
59 this, "numTrtContexts", 1, "Number of TensorRT contexts to allocate"};
60 Gaudi::Property<double> m_edgeCut{this, "edgeCut", 0.5,
61 "Edge cut to apply after the GNN"};
62 Gaudi::Property<unsigned int> m_minCandidateMeasurements{
63 this, "minCandidateMeasurements", 7,
64 "Minimum number of spacepoints to cut for in the GNN candidates"};
65 Gaudi::Property<int> m_cudaDeviceIndex{this, "cudaDeviceIndex", 0,
66 "CUDA device index for GNN inference"};
67 Gaudi::Property<unsigned int> m_numFeatures{
68 this, "numFeatures", 12,
69 "Number of input features per spacepoint: 12 (spacepoint and both strip "
70 "clusters) or 4 (spacepoint only, pixel-only models)"};
71
72 const Acts::Logger& logger() const { return *m_logger; }
73 std::unique_ptr<const Acts::Logger> m_logger;
74
76
77 const PixelID* m_pixelIdHelper{nullptr};
78 const SCT_ID* m_stripIdHelper{nullptr};
79
80 StatusCode buildFeatures(
81 const std::vector<const xAOD::SpacePointContainer*>&
82 spacePointCollections,
83 std::vector<float>& features, std::vector<std::uint64_t>& moduleIds,
84 std::vector<int>& ids,
85 std::vector<const xAOD::SpacePoint*>& allSPPtrs,
86 std::size_t nFeatures = 12) const;
87
88#ifdef ACTS_GNN_WITH_MODULEMAP
89 std::unique_ptr<ActsPlugins::GnnPipeline> m_gnnPipeline;
90#endif
91 mutable std::optional<std::counting_semaphore<>> m_gpuInstanceCount
93};
94
95} // namespace ActsTrk
96
97#endif
Define macros for attributes used to control the static checker.
Gaudi::Property< std::string > m_gnnPath
StatusCode buildSeed(const std::vector< const xAOD::SpacePointContainer * > &spacePointCollections, ActsTrk::SeedContainer &seeds) const override
Gaudi::Property< unsigned int > m_numFeatures
const SCT_ID * m_stripIdHelper
Gaudi::Property< bool > m_usePhiOverlapSps
std::optional< std::counting_semaphore<> > m_gpuInstanceCount ATLAS_THREAD_SAFE
StatusCode initialize() override
Gaudi::Property< std::string > m_moduleMapPath
Gaudi::Property< unsigned int > m_maxGpuInstances
Gaudi::Property< unsigned int > m_minCandidateMeasurements
ServiceHandle< IChronoStatSvc > m_chronoSvc
std::unique_ptr< const Acts::Logger > m_logger
GnnPipelineTool(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< unsigned int > m_numTrtContexts
const Acts::Logger & logger() const
Gaudi::Property< int > m_cudaDeviceIndex
Gaudi::Property< double > m_edgeCut
const PixelID * m_pixelIdHelper
StatusCode buildFeatures(const std::vector< const xAOD::SpacePointContainer * > &spacePointCollections, std::vector< float > &features, std::vector< std::uint64_t > &moduleIds, std::vector< int > &ids, std::vector< const xAOD::SpacePoint * > &allSPPtrs, std::size_t nFeatures=12) const
Definition GnnFeatures.h:48
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:69
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...