ATLAS Offline Software
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 
8 namespace FlavorTagDiscriminants {
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("trackLinkType", m_props.trackLinkType);
19  declareProperty("defaultOutputValue", m_props.default_output_value);
20  }
22 
24  ATH_MSG_INFO("Initialize DL2 from: " + m_props.nnFile);
26  if (m_props.flipTagConfig.size() > 0) {
28  }
30  if (m_props.trackLinkType.size() > 0) {
32  }
33  m_dl2.reset(
34  new DL2HighLevel(
36  flipConfig,
38  trackLinkType
39  )
40  );
41  return StatusCode::SUCCESS;
42  }
43 
44  void DL2Tool::decorate(const xAOD::BTagging& btag) const {
45  ATH_MSG_DEBUG("Decorating btagging object from: " + m_props.nnFile);
46  m_dl2->decorate(btag);
47  ATH_MSG_VERBOSE("Decorated btagging object");
48  }
49  void DL2Tool::decorate(const xAOD::Jet& jet) const {
50  ATH_MSG_DEBUG("Decorating jet from: " + m_props.nnFile);
51  m_dl2->decorate(jet);
52  ATH_MSG_VERBOSE("Decorated jet");
53  }
55  ATH_MSG_DEBUG("Decorating jet with defaults from: " + m_props.nnFile);
56  m_dl2->decorateWithDefaults(jet);
57  ATH_MSG_VERBOSE("Decorated jet with defaults");
58  }
59 
60  std::set<std::string> DL2Tool::getDecoratorKeys() const {
61  return m_dl2->getDataDependencyNames().bTagOutputs;
62  }
63  std::set<std::string> DL2Tool::getAuxInputKeys() const {
64  return m_dl2->getDataDependencyNames().bTagInputs;
65  }
66  std::set<std::string> DL2Tool::getConstituentAuxInputKeys() const {
67  return m_dl2->getDataDependencyNames().trackInputs;
68  }
69 
70 }
FlavorTagDiscriminants::DL2Tool::m_dl2
std::unique_ptr< DL2HighLevel > m_dl2
Definition: DL2Tool.h:46
FlavorTagDiscriminants::FlipTagConfig::STANDARD
@ STANDARD
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
FlavorTagDiscriminants::DL2Tool::initialize
StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition: DL2Tool.cxx:23
AthCommonDataStore< AthCommonMsg< AlgTool > >::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:472
FlavorTagDiscriminants::DL2Properties::trackLinkType
std::string trackLinkType
Definition: DL2Tool.h:21
asg
Definition: DataHandleTestTool.h:28
FlavorTagDiscriminants::DL2HighLevel
Definition: DL2HighLevel.h:27
FlavorTagDiscriminants::DL2Properties::default_output_value
float default_output_value
Definition: DL2Tool.h:22
FlavorTagDiscriminants::DL2Tool::~DL2Tool
~DL2Tool()
Definition: DL2Tool.cxx:21
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
FlavorTagDiscriminants::DL2Tool::decorateWithDefaults
virtual void decorateWithDefaults(const SG::AuxElement &jet) const override
Method to decorate a jet with defaults.
Definition: DL2Tool.cxx:54
FlavorTagDiscriminants::DL2Tool::DL2Tool
DL2Tool(const std::string &name)
Definition: DL2Tool.cxx:10
FlavorTagDiscriminants::DL2Properties::nnFile
std::string nnFile
Definition: DL2Tool.h:18
FlavorTagDiscriminants::DL2Tool::decorate
virtual void decorate(const xAOD::BTagging &btag) const override
Method to decorate a jet.
Definition: DL2Tool.cxx:44
jet
Definition: JetCalibTools_PlotJESFactors.cxx:23
FlavorTagDiscriminants::DL2Tool::m_props
DL2Properties m_props
Definition: DL2Tool.h:45
FlavorTagDiscriminants::trackLinkTypeFromString
TrackLinkType trackLinkTypeFromString(const std::string &)
Definition: AssociationEnums.cxx:15
FlavorTagDiscriminants::DL2Tool::getAuxInputKeys
virtual std::set< std::string > getAuxInputKeys() const override
Definition: DL2Tool.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
FlavorTagDiscriminants::DL2Properties::variableRemapping
std::map< std::string, std::string > variableRemapping
Definition: DL2Tool.h:20
FlavorTagDiscriminants::TrackLinkType
TrackLinkType
Definition: AssociationEnums.h:12
FlavorTagDiscriminants::flipTagConfigFromString
FlipTagConfig flipTagConfigFromString(const std::string &)
Definition: FlipTagEnums.cxx:15
FlavorTagDiscriminants::DL2Properties::flipTagConfig
std::string flipTagConfig
Definition: DL2Tool.h:19
xAOD::BTagging_v1
Definition: BTagging_v1.h:39
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
FlavorTagDiscriminants::DL2Tool::getDecoratorKeys
virtual std::set< std::string > getDecoratorKeys() const override
Definition: DL2Tool.cxx:60
DL2HighLevel.h
xAOD::Jet_v1
Class describing a jet.
Definition: Jet_v1.h:57
DL2Tool.h
FlavorTagDiscriminants::FlipTagConfig
FlipTagConfig
Definition: FlipTagEnums.h:14
FlavorTagDiscriminants::DL2Tool::getConstituentAuxInputKeys
virtual std::set< std::string > getConstituentAuxInputKeys() const override
Definition: DL2Tool.cxx:66
FlavorTagDiscriminants::TrackLinkType::TRACK_PARTICLE
@ TRACK_PARTICLE