ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
BoostedJetTaggers
BoostedJetTaggers
JSSMLTool.h
Go to the documentation of this file.
1
// Dear emacs, this is -*- c++ -*-
2
// Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
#ifndef BOOSTEDJETTAGGERS_JSSMLTOOL_H
4
#define BOOSTEDJETTAGGERS_JSSMLTOOL_H
5
6
#include "
IJSSMLTool.h
"
7
#include "
AsgTools/AsgTool.h
"
8
9
// ONNX Runtime include(s).
10
#include <onnxruntime_cxx_api.h>
11
12
// xAOD
13
#include "
xAODJet/JetContainer.h
"
14
#include "
xAODPFlow/TrackCaloClusterContainer.h
"
15
// System include(s).
16
#include <memory>
//unique_ptr
17
#include <string>
18
#include <map>
19
#include <vector>
20
#include <cstdint>
21
22
class
TH2D;
23
24
25
namespace
AthONNX
{
26
41
45
46
class
JSSMLTool
47
:
public
asg::AsgTool
,
48
virtual
public
IJSSMLTool
{
49
ASG_TOOL_CLASS
(
JSSMLTool
,
IJSSMLTool
)
50
51
public
:
52
JSSMLTool
(
const
std::string& name);
53
55
virtual
StatusCode
initialize
()
override
;
57
virtual
double
retrieveConstituentsScore
(std::vector<TH2D> Images)
const override
;
58
virtual
double
retrieveConstituentsScore
(std::vector<std::vector<float>> constituents)
const override
;
59
virtual
double
retrieveConstituentsScore
(std::vector<std::vector<float>> constituents, std::vector<std::vector<std::vector<float>>> interactions)
const override
;
60
virtual
double
retrieveConstituentsScore
(std::vector<std::vector<float>> constituents, std::vector<std::vector<std::vector<float>>> interactions, std::vector<std::vector<float>> mask)
const override
;
61
virtual
double
retrieveHighLevelScore
(std::map<std::string, double> JSSVars)
const override
;
62
63
virtual
std::vector<float>
retrieveConstituentsScoreMultiClass
(
const
std::vector<std::vector<float>>& constituents,
const
std::vector<std::vector<std::vector<float>>>& interactions,
const
std::vector<std::vector<float>>& mask)
const override
;
64
65
// basic tool functions
66
std::vector<float>
ReadJetImagePixels
( std::vector<TH2D> Images )
const
;
67
std::vector<float>
ReadJSSInputs
(std::map<std::string, double> JSSVars)
const
;
68
std::vector<int>
ReadOutputLabels
()
const
;
69
70
// extra methods
71
StatusCode
SetScaler
(
const
std::map<std::string, std::vector<double>> & scaler)
override
;
72
74
std::unique_ptr< Ort::Session >
m_session
;
75
std::unique_ptr< Ort::Env >
m_env
;
76
77
std::map<std::string, std::vector<double>>
m_scaler
;
78
std::map<int, std::string>
m_JSSInputMap
;
79
80
private
:
81
83
std::string
m_modelFileName
;
84
std::string
m_pixelFileName
;
85
std::string
m_labelFileName
;
86
87
// input node info
88
std::vector<int64_t>
m_input_node_dims
;
89
size_t
m_num_input_nodes
{};
90
std::vector<const char*>
m_input_node_names
;
91
92
// output node info
93
std::vector<int64_t>
m_output_node_dims
;
94
size_t
m_num_output_nodes
{};
95
std::vector<const char*>
m_output_node_names
;
96
97
// some configs
98
int
m_nPixelsX
{},
m_nPixelsY
{},
m_nPixelsZ
{};
99
100
int
m_nvars
{};
101
102
};
// class JSSMLTool
103
104
}
// namespace AthONNX
105
106
#endif
// BOOSTEDJETTAGGERS_JSSMLTOOL_H
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition
AsgToolMacros.h:68
AsgTool.h
IJSSMLTool.h
JetContainer.h
TrackCaloClusterContainer.h
AthONNX::IJSSMLTool
Definition
IJSSMLTool.h:25
AthONNX::JSSMLTool::m_modelFileName
std::string m_modelFileName
Name of the model file to load.
Definition
JSSMLTool.h:83
AthONNX::JSSMLTool::m_scaler
std::map< std::string, std::vector< double > > m_scaler
Definition
JSSMLTool.h:77
AthONNX::JSSMLTool::retrieveHighLevelScore
virtual double retrieveHighLevelScore(std::map< std::string, double > JSSVars) const override
Definition
JSSMLTool.cxx:536
AthONNX::JSSMLTool::m_nPixelsX
int m_nPixelsX
Definition
JSSMLTool.h:98
AthONNX::JSSMLTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition
JSSMLTool.cxx:85
AthONNX::JSSMLTool::m_nPixelsZ
int m_nPixelsZ
Definition
JSSMLTool.h:98
AthONNX::JSSMLTool::ReadJetImagePixels
std::vector< float > ReadJetImagePixels(std::vector< TH2D > Images) const
Definition
JSSMLTool.cxx:17
AthONNX::JSSMLTool::m_pixelFileName
std::string m_pixelFileName
Definition
JSSMLTool.h:84
AthONNX::JSSMLTool::JSSMLTool
JSSMLTool(const std::string &name)
Definition
JSSMLTool.cxx:75
AthONNX::JSSMLTool::retrieveConstituentsScoreMultiClass
virtual std::vector< float > retrieveConstituentsScoreMultiClass(const std::vector< std::vector< float > > &constituents, const std::vector< std::vector< std::vector< float > > > &interactions, const std::vector< std::vector< float > > &mask) const override
Definition
JSSMLTool.cxx:449
AthONNX::JSSMLTool::ReadOutputLabels
std::vector< int > ReadOutputLabels() const
Definition
JSSMLTool.cxx:65
AthONNX::JSSMLTool::m_env
std::unique_ptr< Ort::Env > m_env
Definition
JSSMLTool.h:75
AthONNX::JSSMLTool::m_nPixelsY
int m_nPixelsY
Definition
JSSMLTool.h:98
AthONNX::JSSMLTool::m_output_node_dims
std::vector< int64_t > m_output_node_dims
Definition
JSSMLTool.h:93
AthONNX::JSSMLTool::m_nvars
int m_nvars
Definition
JSSMLTool.h:100
AthONNX::JSSMLTool::retrieveConstituentsScore
virtual double retrieveConstituentsScore(std::vector< TH2D > Images) const override
Function executing the tool for a single event.
Definition
JSSMLTool.cxx:164
AthONNX::JSSMLTool::m_num_output_nodes
size_t m_num_output_nodes
Definition
JSSMLTool.h:94
AthONNX::JSSMLTool::m_num_input_nodes
size_t m_num_input_nodes
Definition
JSSMLTool.h:89
AthONNX::JSSMLTool::m_labelFileName
std::string m_labelFileName
Definition
JSSMLTool.h:85
AthONNX::JSSMLTool::ReadJSSInputs
std::vector< float > ReadJSSInputs(std::map< std::string, double > JSSVars) const
Definition
JSSMLTool.cxx:39
AthONNX::JSSMLTool::m_output_node_names
std::vector< const char * > m_output_node_names
Definition
JSSMLTool.h:95
AthONNX::JSSMLTool::m_input_node_dims
std::vector< int64_t > m_input_node_dims
Definition
JSSMLTool.h:88
AthONNX::JSSMLTool::m_JSSInputMap
std::map< int, std::string > m_JSSInputMap
Definition
JSSMLTool.h:78
AthONNX::JSSMLTool::m_input_node_names
std::vector< const char * > m_input_node_names
Definition
JSSMLTool.h:90
AthONNX::JSSMLTool::m_session
std::unique_ptr< Ort::Session > m_session
Definition
JSSMLTool.h:74
AthONNX::JSSMLTool::SetScaler
StatusCode SetScaler(const std::map< std::string, std::vector< double > > &scaler) override
Definition
JSSMLTool.cxx:602
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition
AsgTool.h:47
AthONNX
Definition
IJSSMLTool.h:23
Generated on
for ATLAS Offline Software by
1.17.0