ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
JetTagging
FlavorTagInference
Root
MultifoldGNNTool.cxx
Go to the documentation of this file.
1
/*
2
+ Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#if __GNUC__ >= 16
6
// Suppress false-positive warning seen with gcc16.
7
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
8
#endif
9
10
#include "
FlavorTagInference/MultifoldGNNTool.h
"
11
#include "
FlavorTagInference/MultifoldGNN.h
"
12
#include "
FlavorTagInference/GNNOptions.h
"
13
14
namespace
FlavorTagInference
{
15
16
MultifoldGNNTool::MultifoldGNNTool(
const
std::string& name):
17
asg::AsgTool(
name
),
18
m_props()
19
{
20
declareProperty(
"nnFiles"
, m_nn_files,
21
"the path to the netowrk file used to run inference"
);
22
declareProperty(
"foldHashName"
, m_fold_hash_name,
23
"the path to the netowrk file used to run inference"
);
24
propify
(*
this
, &m_props);
25
}
26
27
MultifoldGNNTool::~MultifoldGNNTool
() {}
28
29
StatusCode
MultifoldGNNTool::initialize
() {
30
31
const
auto
opts =
FlavorTagInference::getOptions
(
m_props
);
32
if
(!
m_nnsvc
.empty()) {
33
ATH_CHECK
(
m_nnsvc
.retrieve());
34
std::vector<std::shared_ptr<const FlavorTagInference::GNN>> gnns;
35
for
(
const
auto
&
file
:
m_nn_files
) {
36
auto
newopts = opts;
37
if
(
auto
def_handle =
m_defaults
.value().extract(
file
)) {
38
newopts.default_output_values = def_handle.mapped();
39
}
40
gnns.emplace_back(
m_nnsvc
->get(
file
, newopts));
41
}
42
if
(!
m_defaults
.empty()) {
43
ATH_MSG_ERROR
(
"unused per-fold defaults!"
);
44
return
StatusCode::FAILURE;
45
}
46
m_gnn
.reset(
new
MultifoldGNN
(gnns,
m_fold_hash_name
));
47
}
else
{
48
ATH_MSG_INFO
(
"Initialize multi-fold GNN"
);
49
m_gnn
.reset(
new
MultifoldGNN
(
m_nn_files
,
m_fold_hash_name
, opts));
50
}
51
52
return
StatusCode::SUCCESS;
53
}
54
55
void
MultifoldGNNTool::decorate
(
const
xAOD::IParticle
& i_jet)
const
{
56
m_gnn
->decorate(i_jet);
57
}
58
void
MultifoldGNNTool::decorateWithDefaults
(
const
xAOD::IParticle
& i_jet)
const
{
59
m_gnn
->decorateWithDefaults(i_jet);
60
}
61
62
// Dependencies
63
FTagDataDependencyNames
MultifoldGNNTool::getDependencies
()
const
{
64
return
m_gnn
->getDependencies();
65
}
66
67
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
GNNOptions.h
MultifoldGNNTool.h
MultifoldGNN.h
FlavorTagInference::MultifoldGNNTool::~MultifoldGNNTool
ASG_TOOL_CLASS(MultifoldGNNTool, IJetTagConditionalDecorator) public ~MultifoldGNNTool()
Definition
MultifoldGNNTool.cxx:27
FlavorTagInference::MultifoldGNNTool::m_props
FlavorTagInference::GNNToolProperties m_props
Definition
MultifoldGNNTool.h:60
FlavorTagInference::MultifoldGNNTool::m_nn_files
std::vector< std::string > m_nn_files
Definition
MultifoldGNNTool.h:58
FlavorTagInference::MultifoldGNNTool::m_gnn
std::shared_ptr< const MultifoldGNN > m_gnn
Definition
MultifoldGNNTool.h:61
FlavorTagInference::MultifoldGNNTool::initialize
StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition
MultifoldGNNTool.cxx:29
FlavorTagInference::MultifoldGNNTool::m_fold_hash_name
std::string m_fold_hash_name
Definition
MultifoldGNNTool.h:59
FlavorTagInference::MultifoldGNNTool::decorateWithDefaults
virtual void decorateWithDefaults(const xAOD::IParticle &i_jet) const override
Method to decorate a jet with defaults.
Definition
MultifoldGNNTool.cxx:58
FlavorTagInference::MultifoldGNNTool::getDependencies
FTagDataDependencyNames getDependencies() const override
Definition
MultifoldGNNTool.cxx:63
FlavorTagInference::MultifoldGNNTool::m_defaults
Gaudi::Property< MMD > m_defaults
Definition
MultifoldGNNTool.h:62
FlavorTagInference::MultifoldGNNTool::decorate
virtual void decorate(const xAOD::IParticle &i_jet) const override
Method to decorate a jet.
Definition
MultifoldGNNTool.cxx:55
FlavorTagInference::MultifoldGNNTool::m_nnsvc
ServiceHandle< FlavorTagInference::INNSharingSvc > m_nnsvc
Definition
MultifoldGNNTool.h:56
FlavorTagInference::MultifoldGNN
Definition
MultifoldGNN.h:25
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
FlavorTagInference
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition
CaloClusterLoader.h:27
FlavorTagInference::getOptions
GNNOptions getOptions(const GNNToolProperties &)
Definition
GNNToolifiers.cxx:24
FlavorTagInference::propify
void propify(asg::AsgTool &tool, GNNToolProperties *props)
Definition
GNNToolifiers.cxx:12
extractSporadic.name
name
Definition
extractSporadic.py:101
FlavorTagInference::FTagDataDependencyNames
Definition
FTagDataDependencyNames.h:12
file
TFile * file
Definition
tile_monitor.h:29
Generated on
for ATLAS Offline Software by
1.17.0