ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonPhaseII
MuonLearning
MuonInference
src
SPInferenceToolBase.h
Go to the documentation of this file.
1
#ifndef MUONINFERENCETOOLS_SPINFERENCETOOL_H
2
#define MUONINFERENCETOOLS_SPINFERENCETOOL_H
3
4
5
#include "
MuonInferenceInterfaces/IGraphInferenceTool.h
"
6
#include "
MuonInferenceInterfaces/NodeFeatureList.h
"
7
#include "
MuonInferenceInterfaces/GraphData.h
"
8
9
#include "
AthOnnxInterfaces/IOnnxRuntimeSessionTool.h
"
10
11
#include "
MuonSpacePoint/SpacePointContainer.h
"
12
13
#include "
AthenaBaseComps/AthAlgTool.h
"
14
#include "
StoreGate/ReadHandleKey.h
"
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;
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
:
44
NodeFeatureList
m_graphFeatures
{};
45
ToolHandle<AthOnnx::IOnnxRuntimeSessionTool>
m_onnxSessionTool
{
this
,
"ModelSession"
,
""
};
46
// Cached at initialize: true when the session runs on CUDA.
47
bool
m_isCuda
{
false
};
48
int
m_cudaDeviceId
{0};
49
50
};
51
52
}
53
54
#endif
AthAlgTool.h
GraphData.h
IGraphInferenceTool.h
IOnnxRuntimeSessionTool.h
SpacePointContainer.h
NodeFeatureList.h
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
MuonML::NodeFeatureList
Definition
NodeFeatureList.h:14
MuonML::SPInferenceToolBase
Baseline tool to handle the.
Definition
SPInferenceToolBase.h:20
MuonML::SPInferenceToolBase::m_graphFeatures
NodeFeatureList m_graphFeatures
List of features to be used for the inference.
Definition
SPInferenceToolBase.h:44
MuonML::SPInferenceToolBase::runInference
StatusCode runInference(GraphRawData &graphData) const
Definition
SPInferenceToolBase.cxx:201
MuonML::SPInferenceToolBase::m_onnxSessionTool
ToolHandle< AthOnnx::IOnnxRuntimeSessionTool > m_onnxSessionTool
Definition
SPInferenceToolBase.h:45
MuonML::SPInferenceToolBase::model
Ort::Session & model() const
Definition
SPInferenceToolBase.cxx:88
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:127
MuonML::SPInferenceToolBase::m_readKey
SG::ReadHandleKey< MuonR4::SpacePointContainer > m_readKey
Input space points to filter.
Definition
SPInferenceToolBase.h:41
MuonML::SPInferenceToolBase::setupModel
StatusCode setupModel()
Definition
SPInferenceToolBase.cxx:91
MuonML::SPInferenceToolBase::m_isCuda
bool m_isCuda
Definition
SPInferenceToolBase.h:47
MuonML::SPInferenceToolBase::m_cudaDeviceId
int m_cudaDeviceId
Definition
SPInferenceToolBase.h:48
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition
StoreGate/StoreGate/ReadHandleKey.h:40
MuonML
Definition
BucketGraphUtils.h:19
MuonML::GraphRawData
Helper struct to ship the Graph from the space point buckets to ONNX.
Definition
GraphData.h:25
Generated on
for ATLAS Offline Software by
1.17.0