ATLAS Offline Software
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 
9 namespace FlavorTagDiscriminants {
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 
20  GNNTool::~GNNTool() {}
21 
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::BTagging& btag) const {
37  m_gnn->decorate(btag);
38  }
39  void GNNTool::decorate(const xAOD::Jet& jet) const {
40  m_gnn->decorate(jet, jet);
41  }
42  void GNNTool::decorateWithDefaults(const SG::AuxElement& jet) const {
43  m_gnn->decorateWithDefaults(jet);
44  }
45 
46  void GNNTool::decorate(const xAOD::Jet& jet, const SG::AuxElement& btag) const
47  {
48  m_gnn->decorate(jet, btag);
49  }
50 
51  // Dependencies
52  std::set<std::string> GNNTool::getDecoratorKeys() const {
53  return m_gnn->getDecoratorKeys();
54  }
55  std::set<std::string> GNNTool::getAuxInputKeys() const {
56  return m_gnn->getAuxInputKeys();
57  }
58  std::set<std::string> GNNTool::getConstituentAuxInputKeys() const {
59  return m_gnn->getConstituentAuxInputKeys();
60  }
61 
62 }
GNNTool.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FlavorTagDiscriminants
This file contains "getter" functions used for accessing tagger inputs from the EDM.
Definition: AssociationEnums.h:11
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:446
initialize
void initialize()
Definition: run_EoverP.cxx:894
asg
Definition: DataHandleTestTool.h:28
GNNOptions.h
python.DecoratorFactory.decorate
def decorate(hto4l_controller, decorator, **kwargs)
Definition: Hto4lControl/python/DecoratorFactory.py:5
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::BTagging_v1
Definition: BTagging_v1.h:39
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
GNN.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
FlavorTagDiscriminants::GNN
Definition: GNN.h:40
athena.opts
opts
Definition: athena.py:86
FlavorTagDiscriminants::getOptions
GNNOptions getOptions(const GNNToolProperties &)
Definition: GNNToolifiers.cxx:22
FlavorTagDiscriminants::propify
void propify(asg::AsgTool &tool, GNNToolProperties *props)
Definition: GNNToolifiers.cxx:12