ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
RingerSelectorTools
RingerSelectorTools
tools
onnx
RingerSelector.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef RingerSelectorTools_tools_onnx_RingerSelector_h
5
#define RingerSelectorTools_tools_onnx_RingerSelector_h
6
7
8
9
#include "GaudiKernel/StatusCode.h"
10
#include "GaudiKernel/ServiceHandle.h"
11
#include "
AsgMessaging/AsgMessaging.h
"
12
#include "
RingerSelectorTools/tools/onnx/Model.h
"
13
#include "
RingerSelectorTools/tools/onnx/Threshold.h
"
14
#include "
AthOnnxInterfaces/IOnnxRuntimeSvc.h
"
15
#include <onnxruntime_cxx_api.h>
16
#include "
xAODTrigRinger/TrigRingerRings.h
"
17
#include "
xAODTrigCalo/TrigEMCluster.h
"
18
#include "
xAODTrigEgamma/TrigElectron.h
"
19
#include "GaudiKernel/SystemOfUnits.h"
20
#include <memory>
21
#include "TEnv.h"
22
23
namespace
Ringer
{
24
25
namespace
onnx
{
26
27
class
RingerSelector
:
public
asg::AsgMessaging
28
29
{
30
public
:
31
33
RingerSelector
(
const
std::string& name );
34
36
~RingerSelector
()=
default
;
37
38
42
StatusCode
read_from
(
const
std::string&,
AthOnnx::IOnnxRuntimeSvc
*);
43
44
48
std::vector<std::vector<float>>
prepare_inputs
(
unsigned
barcode,
const
xAOD::TrigRingerRings
*,
const
xAOD::TrigElectron
*)
const
;
49
50
54
float
predict
(
const
xAOD::TrigRingerRings
*,
const
xAOD::TrigElectron
* )
const
;
55
56
60
bool
accept
(
const
xAOD::TrigRingerRings
*,
float
discr,
float
mu )
const
;
61
62
63
private
:
64
66
std::vector< Ringer::onnx::Model >
m_models
;
68
std::vector< Ringer::onnx::Threshold >
m_thresholds
;
69
71
template
<
typename
T>
bool
strtof
(
const
std::string& input, T& f);
73
template
<
typename
T> std::vector<T>
GetValues
(
const
std::string& input, TEnv& env);
75
std::vector<std::string>
GetPaths
(
const
std::string& input, TEnv& env);
77
std::string
GetBasePath
(
const
std::string &path)
const
;
78
79
};
80
81
}
// namespace onnx
82
}
//namespace Ringer
83
84
#endif
AsgMessaging.h
TrigEMCluster.h
TrigElectron.h
IOnnxRuntimeSvc.h
Model.h
Threshold.h
TrigRingerRings.h
AthOnnx::IOnnxRuntimeSvc
Service used for managing global objects used by Onnx Runtime.
Definition
IOnnxRuntimeSvc.h:25
Ringer::onnx::RingerSelector::GetValues
std::vector< T > GetValues(const std::string &input, TEnv &env)
Get the list of values inside of tenv.
Definition
RingerSelector.cxx:247
Ringer::onnx::RingerSelector::read_from
StatusCode read_from(const std::string &, AthOnnx::IOnnxRuntimeSvc *)
read tunings from configuration file
Definition
RingerSelector.cxx:26
Ringer::onnx::RingerSelector::accept
bool accept(const xAOD::TrigRingerRings *, float discr, float mu) const
Accept method.
Definition
RingerSelector.cxx:109
Ringer::onnx::RingerSelector::predict
float predict(const xAOD::TrigRingerRings *, const xAOD::TrigElectron *) const
Calculation of model output.
Definition
RingerSelector.cxx:126
Ringer::onnx::RingerSelector::RingerSelector
RingerSelector(const std::string &name)
Standard constructor.
Definition
RingerSelector.cxx:20
Ringer::onnx::RingerSelector::GetPaths
std::vector< std::string > GetPaths(const std::string &input, TEnv &env)
Get the list of paths inside of tenv.
Definition
RingerSelector.cxx:269
Ringer::onnx::RingerSelector::m_models
std::vector< Ringer::onnx::Model > m_models
hold all onnx sessions
Definition
RingerSelector.h:66
Ringer::onnx::RingerSelector::m_thresholds
std::vector< Ringer::onnx::Threshold > m_thresholds
hold all thresholds definitions
Definition
RingerSelector.h:68
Ringer::onnx::RingerSelector::strtof
bool strtof(const std::string &input, T &f)
parse tenv string into list with type T
Definition
RingerSelector.cxx:216
Ringer::onnx::RingerSelector::prepare_inputs
std::vector< std::vector< float > > prepare_inputs(unsigned barcode, const xAOD::TrigRingerRings *, const xAOD::TrigElectron *) const
prepare all inputs
Definition
RingerSelector.cxx:151
Ringer::onnx::RingerSelector::GetBasePath
std::string GetBasePath(const std::string &path) const
Get basepath from calib path.
Definition
RingerSelector.cxx:286
Ringer::onnx::RingerSelector::~RingerSelector
~RingerSelector()=default
Standard destructor.
asg::AsgMessaging
Class mimicking the AthMessaging class from the offline software.
Definition
AsgMessaging.h:40
Ringer::onnx
Definition
Model.h:19
Ringer
Namespace dedicated for Ringer utilities.
Definition
CaloRingsDefs.h:9
xAOD::TrigRingerRings
TrigRingerRings_v2 TrigRingerRings
Define the latest version of the TrigRingerRings class.
Definition
TrigRingerRings.h:17
xAOD::TrigElectron
TrigElectron_v1 TrigElectron
Declare the latest version of the class.
Definition
Event/xAOD/xAODTrigEgamma/xAODTrigEgamma/TrigElectron.h:16
Generated on
for ATLAS Offline Software by
1.17.0