ATLAS Offline Software
Loading...
Searching...
No Matches
DL2Tool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
7
9
10 DL2Tool::DL2Tool(const std::string& name):
11 asg::AsgTool(name),
12 m_props(),
13 m_dl2(nullptr)
14 {
15 declareProperty("nnFile", m_props.nnFile);
16 declareProperty("flipTagConfig", m_props.flipTagConfig);
17 declareProperty("variableRemapping", m_props.variableRemapping);
18 declareProperty("defaultOutputValue", m_props.default_output_value);
19 }
21
22 StatusCode DL2Tool::initialize() {
23 ATH_MSG_INFO("Initialize DL2 from: " + m_props.nnFile);
24 FlipTagConfig flipConfig = FlipTagConfig::STANDARD;
25 if (m_props.flipTagConfig.size() > 0) {
26 flipConfig = FlavorTagInference::flipTagConfigFromString(m_props.flipTagConfig);
27 }
28 m_dl2.reset(
29 new DL2HighLevel(
30 m_props.nnFile,
31 flipConfig,
32 m_props.variableRemapping
33 )
34 );
35 return StatusCode::SUCCESS;
36 }
37
38 void DL2Tool::decorate(const xAOD::IParticle& i_jet) const {
39 ATH_MSG_DEBUG("Decorating i_jet from: " + m_props.nnFile);
40 m_dl2->decorate(i_jet);
41 ATH_MSG_VERBOSE("Decorated i_jet");
42 }
44 ATH_MSG_DEBUG("Decorating i_jet with defaults from: " + m_props.nnFile);
45 m_dl2->decorateWithDefaults(i_jet);
46 ATH_MSG_VERBOSE("Decorated i_jet with defaults");
47 }
48
50 return m_dl2->getDataDependencyNames();
51 }
52
53}
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
DL2Tool(const std::string &name)
Definition DL2Tool.cxx:10
virtual void decorate(const xAOD::IParticle &i_jet) const override
Method to decorate a jet.
Definition DL2Tool.cxx:38
virtual void decorateWithDefaults(const xAOD::IParticle &i_jet) const override
Method to decorate a jet with defaults.
Definition DL2Tool.cxx:43
std::unique_ptr< DL2HighLevel > m_dl2
Definition DL2Tool.h:43
StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition DL2Tool.cxx:22
virtual DataDependencyNames getDependencies() const override
Definition DL2Tool.cxx:49
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
Class providing the definition of the 4-vector interface.
FlipTagConfig flipTagConfigFromString(const std::string &)