ATLAS Offline Software
GraphInferenceToolBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONINFERENCETOOLS_GRAPHINFERENCETOOL_H
5 #define MUONINFERENCETOOLS_GRAPHINFERENCETOOL_H
6 
10 
12 
14 
17 #include <onnxruntime_cxx_api.h> // is this somewhere else?
18 #include "nlohmann/json.hpp"
19 
20 namespace MuonML{
22  class GraphInferenceToolBase : public extends<AthAlgTool, IGraphInferenceTool> {
23  public:
25  using base_class::base_class;
32  StatusCode buildGraph(const EventContext& ctx,
33  GraphRawData& graphData) const;
34 
35  StatusCode runInference(GraphRawData& graphData) const;
36 
37 
38  protected:
40 
41  Ort::Session& model() const;
43  SG::ReadHandleKey<MuonR4::SpacePointContainer> m_readKey{this, "ReadSpacePoints", "MuonSpacePoints"};
44  private:
47  ToolHandle<AthOnnx::IOnnxRuntimeSessionTool> m_onnxSessionTool{this, "ModelSession", "" };
48 
49  };
50 
51 }
52 
53 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
MuonML::GraphInferenceToolBase::m_readKey
SG::ReadHandleKey< MuonR4::SpacePointContainer > m_readKey
Input space points to filter
Definition: GraphInferenceToolBase.h:43
IGraphInferenceTool.h
MuonML::GraphInferenceToolBase::buildGraph
StatusCode buildGraph(const EventContext &ctx, GraphRawData &graphData) const
Fill up the GraphRawData and construct the graph for the ML inference with ONNX.
Definition: GraphInferenceToolBase.cxx:114
MuonML::GraphInferenceToolBase::m_onnxSessionTool
ToolHandle< AthOnnx::IOnnxRuntimeSessionTool > m_onnxSessionTool
Definition: GraphInferenceToolBase.h:47
MuonML::NodeFeatureList
Definition: NodeFeatureList.h:14
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
python.oracle.Session
Session
Definition: oracle.py:76
MuonML
Definition: GraphBucketFilterTool.cxx:9
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
MuonML::GraphRawData
Helper struct to ship the Graph from the space point buckets to ONNX.
Definition: GraphData.h:25
MuonML::GraphInferenceToolBase::model
Ort::Session & model() const
Definition: GraphInferenceToolBase.cxx:87
IOnnxRuntimeSessionTool.h
MuonML::GraphInferenceToolBase
Baseline tool to handle the
Definition: GraphInferenceToolBase.h:22
GraphData.h
MuonML::GraphInferenceToolBase::setupModel
StatusCode setupModel()
Definition: GraphInferenceToolBase.cxx:90
NodeFeatureList.h
SpacePointContainer.h
MuonML::GraphInferenceToolBase::runInference
StatusCode runInference(GraphRawData &graphData) const
Definition: GraphInferenceToolBase.cxx:188
MuonML::GraphInferenceToolBase::m_graphFeatures
NodeFeatureList m_graphFeatures
List of features to be used for the inference.
Definition: GraphInferenceToolBase.h:46