ATLAS Offline Software
SPInferenceToolBase.h
Go to the documentation of this file.
1 #ifndef MUONINFERENCETOOLS_SPINFERENCETOOL_H
2 #define MUONINFERENCETOOLS_SPINFERENCETOOL_H
3 
4 
8 
10 
12 
15 #include <onnxruntime_cxx_api.h> // is this somewhere else?
16 #include "nlohmann/json.hpp"
17 
18 namespace MuonML{
20  class SPInferenceToolBase : public extends<AthAlgTool, IGraphInferenceTool> {
21  public:
23  using base_class::base_class;
30  StatusCode buildGraph(const EventContext& ctx,
31  GraphRawData& graphData) const;
32 
33  StatusCode runInference(GraphRawData& graphData) const;
34 
35 
36  protected:
38 
39  Ort::Session& model() const;
41  SG::ReadHandleKey<MuonR4::SpacePointContainer> m_readKey{this, "ReadSpacePoints", "MuonSpacePoints"};
42  private:
45  ToolHandle<AthOnnx::IOnnxRuntimeSessionTool> m_onnxSessionTool{this, "ModelSession", "" };
46 
47  };
48 
49 }
50 
51 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
MuonML::SPInferenceToolBase::model
Ort::Session & model() const
Definition: SPInferenceToolBase.cxx:87
IGraphInferenceTool.h
MuonML::SPInferenceToolBase::setupModel
StatusCode setupModel()
Definition: SPInferenceToolBase.cxx:90
MuonML::SPInferenceToolBase::runInference
StatusCode runInference(GraphRawData &graphData) const
Definition: SPInferenceToolBase.cxx:188
MuonML::SPInferenceToolBase::m_onnxSessionTool
ToolHandle< AthOnnx::IOnnxRuntimeSessionTool > m_onnxSessionTool
Definition: SPInferenceToolBase.h:45
MuonML::SPInferenceToolBase::buildGraph
StatusCode buildGraph(const EventContext &ctx, GraphRawData &graphData) const
Fill up the GraphRawData and construct the graph for the ML inference with ONNX.
Definition: SPInferenceToolBase.cxx:114
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: BucketGraphUtils.h:19
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
IOnnxRuntimeSessionTool.h
MuonML::SPInferenceToolBase::m_readKey
SG::ReadHandleKey< MuonR4::SpacePointContainer > m_readKey
Input space points to filter
Definition: SPInferenceToolBase.h:41
GraphData.h
MuonML::SPInferenceToolBase::m_graphFeatures
NodeFeatureList m_graphFeatures
List of features to be used for the inference.
Definition: SPInferenceToolBase.h:44
MuonML::SPInferenceToolBase
Baseline tool to handle the
Definition: SPInferenceToolBase.h:20
NodeFeatureList.h
SpacePointContainer.h