ATLAS Offline Software
Loading...
Searching...
No Matches
CaloClusterTritonTool.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 CALOCLUSTERCORRECTION_CALOCLUSTERTRITONTOOL_H
6#define CALOCLUSTERCORRECTION_CALOCLUSTERTRITONTOOL_H
7
12#include "GaudiKernel/ToolHandle.h"
13
14#include <cstddef>
15#include <string>
16#include <vector>
17
34class CaloClusterTritonTool : public extends<AthAlgTool, ICaloClusterTritonTool>
35{
36public:
37 CaloClusterTritonTool(const std::string &type, const std::string &name, const IInterface *parent);
38 virtual ~CaloClusterTritonTool() = default;
39
40 virtual StatusCode initialize() override;
41
42 virtual StatusCode inference(const xAOD::CaloClusterContainer &clusters,
43 std::vector<double> &clusterE_GNN_vec) const override;
44
45private:
48 StatusCode buildInputs(const xAOD::CaloCluster &cluster,
49 AthInfer::InputDataMap &inputData,
50 std::size_t &nCells) const;
51
53 StatusCode inferCluster(const xAOD::CaloCluster &cluster,
54 double &energyGeV,
55 bool &valid) const;
56
57 Gaudi::Property<float> m_cellEThreshold{
58 this, "CellEnergyThreshold", 0.005f,
59 "Minimum weighted cell energy [GeV] for a cell to enter the graph"};
60
61 Gaudi::Property<std::string> m_cellIdsName{
62 this, "CellIdsInputName", "CELL_IDS", "Name of the cell-ID input tensor"};
63 Gaudi::Property<std::string> m_cellFeaturesName{
64 this, "CellFeaturesInputName", "CELL_FEATURES", "Name of the cell-feature input tensor"};
65 Gaudi::Property<std::string> m_globalFeaturesName{
66 this, "GlobalFeaturesInputName", "GLOBAL_FEATURES", "Name of the global-feature input tensor"};
67 Gaudi::Property<std::string> m_outputName{
68 this, "OutputName", "OUTPUT", "Name of the output tensor"};
69
70 ToolHandle<AthInfer::IAthInferenceTool> m_tritonTool{
71 this, "TritonInferenceTool", "AthInfer::TritonTool",
72 "Inference tool forwarding requests to the Triton server"};
73};
74
75#endif // CALOCLUSTERCORRECTION_CALOCLUSTERTRITONTOOL_H
virtual StatusCode initialize() override
Gaudi::Property< std::string > m_cellIdsName
virtual ~CaloClusterTritonTool()=default
Gaudi::Property< std::string > m_outputName
StatusCode buildInputs(const xAOD::CaloCluster &cluster, AthInfer::InputDataMap &inputData, std::size_t &nCells) const
Fill the input tensor map for one cluster; nCells is the number of cells retained after the energy th...
virtual StatusCode inference(const xAOD::CaloClusterContainer &clusters, std::vector< double > &clusterE_GNN_vec) const override
Gaudi::Property< std::string > m_globalFeaturesName
CaloClusterTritonTool(const std::string &type, const std::string &name, const IInterface *parent)
ToolHandle< AthInfer::IAthInferenceTool > m_tritonTool
StatusCode inferCluster(const xAOD::CaloCluster &cluster, double &energyGeV, bool &valid) const
Run inference for one cluster. energyGeV is meaningful only if valid.
Gaudi::Property< float > m_cellEThreshold
Gaudi::Property< std::string > m_cellFeaturesName
std::map< std::string, InferenceData > InputDataMap
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.