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
25namespace ActsPlugins {
26class GnnPipeline;
27} // namespace ActsPlugins
28
29
30namespace ActsTrk {
31
32class GnnPipelineTool : public extends<AthAlgTool, IGnnPipelineTool> {
33 public:
34 GnnPipelineTool(const std::string& type, const std::string& name,
35 const IInterface* parent);
37
38 StatusCode initialize() override;
39
40 StatusCode buildSeed(
41 const std::vector<const xAOD::SpacePointContainer*>&
42 spacePointCollections,
43 ActsTrk::SeedContainer& seeds) const override;
44
45 private:
46 Gaudi::Property<std::string> m_moduleMapPath{this, "moduleMapPath", "",
47 "Path to the module map files"};
48 Gaudi::Property<std::string> m_gnnPath{this, "gnnPath", "",
49 "Path to the gnn file"};
50 Gaudi::Property<bool> m_usePhiOverlapSps{
51 this, "usePhiOverlapSps", false,
52 "Whether to use phi overlap spacepoints"};
53 Gaudi::Property<unsigned int> m_maxGpuInstances{
54 this, "maxGpuInstances", 1,
55 "Number of events that can be on GPU in parallel"};
56 Gaudi::Property<unsigned int> m_numTrtContexts{
57 this, "numTrtContexts", 1, "Number of TensorRT contexts to allocate"};
58 Gaudi::Property<double> m_edgeCut{this, "edgeCut", 0.5,
59 "Edge cut to apply after the GNN"};
60 Gaudi::Property<unsigned int> m_minCandidateMeasurements{
61 this, "minCandidateMeasurements", 7,
62 "Minimum number of spacepoints to cut for in the GNN candidates"};
63 Gaudi::Property<int> m_cudaDeviceIndex{this, "cudaDeviceIndex", 0,
64 "CUDA device index for GNN inference"};
65
66 const Acts::Logger& logger() const { return *m_logger; }
67 std::unique_ptr<const Acts::Logger> m_logger;
68
70
71 const PixelID* m_pixelIdHelper{nullptr};
72 const SCT_ID* m_stripIdHelper{nullptr};
73
74 StatusCode buildFeatures(
75 const std::vector<const xAOD::SpacePointContainer*>&
76 spacePointCollections,
77 std::vector<float>& features, std::vector<std::uint64_t>& moduleIds,
78 std::vector<int>& ids,
79 std::vector<const xAOD::SpacePoint*>& allSPPtrs,
80 std::size_t nFeatures = 12) const;
81
82 std::unique_ptr<ActsPlugins::GnnPipeline> m_gnnPipeline;
83 mutable std::optional<std::counting_semaphore<>> m_gpuInstanceCount
85};
86
87} // namespace ActsTrk
88
89#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
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
std::unique_ptr< ActsPlugins::GnnPipeline > m_gnnPipeline
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...