ATLAS Offline Software
Loading...
Searching...
No Matches
GNNTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9namespace FlavorTagInference {
10
11 GNNTool::GNNTool(const std::string& name):
12 asg::AsgTool(name),
13 m_props()
14 {
15 declareProperty("nnFile", m_nn_file,
16 "the path to the netowrk file used to run inference");
17 propify(*this, &m_props);
18 }
19
21
22 StatusCode GNNTool::initialize() {
23
24 auto opts = getOptions(m_props);
25 if (!m_nnsvc.empty()) {
26 ATH_CHECK(m_nnsvc.retrieve());
27 m_gnn = m_nnsvc->get(m_nn_file, opts);
28 } else {
29 ATH_MSG_INFO("Initialize bTagging Tool (GNN) from: " + m_nn_file);
30 m_gnn.reset(new GNN(m_nn_file, opts));
31 }
32
33 return StatusCode::SUCCESS;
34 }
35
36 void GNNTool::decorate(const xAOD::IParticle& i_jet) const {
37 m_gnn->decorate(i_jet);
38 }
40 m_gnn->decorateWithDefaults(i_jet);
41 }
42
43 // Dependencies
45 return m_gnn->getDependencies();
46 }
47
48}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x,...)
virtual void decorateWithDefaults(const xAOD::IParticle &i_jet) const override
Method to decorate a jet with defaults.
Definition GNNTool.cxx:39
ServiceHandle< INNSharingSvc > m_nnsvc
Definition GNNTool.h:50
std::shared_ptr< const GNN > m_gnn
Definition GNNTool.h:54
StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition GNNTool.cxx:22
GNNToolProperties m_props
Definition GNNTool.h:53
virtual void decorate(const xAOD::IParticle &i_jet) const override
Method to decorate a jet.
Definition GNNTool.cxx:36
virtual FTagDataDependencyNames getDependencies() const override
Definition GNNTool.cxx:44
ASG_TOOL_CLASS(GNNTool, IJetTagConditionalDecorator) public ~GNNTool()
Definition GNNTool.cxx:20
Class providing the definition of the 4-vector interface.
This file contains "getter" functions used for accessing tagger inputs from the EDM.
GNNOptions getOptions(const GNNToolProperties &)
void propify(asg::AsgTool &tool, GNNToolProperties *props)