ATLAS Offline Software
Loading...
Searching...
No Matches
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
18namespace MuonML{
20 class SPInferenceToolBase : public extends<AthAlgTool, IGraphInferenceTool> {
21 public:
23 using base_class::base_class;
29
30 StatusCode buildGraph(const EventContext& ctx,
31 GraphRawData& graphData) const;
32
33 StatusCode runInference(GraphRawData& graphData) const;
34
35
36 protected:
37 StatusCode setupModel();
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
Property holding a SG store/key/clid from which a ReadHandle is made.
Baseline tool to handle the.
NodeFeatureList m_graphFeatures
List of features to be used for the inference.
StatusCode runInference(GraphRawData &graphData) const
ToolHandle< AthOnnx::IOnnxRuntimeSessionTool > m_onnxSessionTool
StatusCode buildGraph(const EventContext &ctx, GraphRawData &graphData) const
Fill up the GraphRawData and construct the graph for the ML inference with ONNX.
SG::ReadHandleKey< MuonR4::SpacePointContainer > m_readKey
Input space points to filter.
Property holding a SG store/key/clid from which a ReadHandle is made.
Helper struct to ship the Graph from the space point buckets to ONNX.
Definition GraphData.h:25