ATLAS Offline Software
PhysicsAnalysis
DerivationFramework
DerivationFrameworkTau
src
TauTruthMatchingWrapper.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// TauTruthMatchingWrapper.cxx
7
// Author: Evelina Bouhova-Thacker (e.bouhova@cern.ch)
9
10
#include "
DerivationFrameworkTau/TauTruthMatchingWrapper.h
"
11
#include "
StoreGate/ReadHandle.h
"
12
13
namespace
DerivationFramework
{
14
15
TauTruthMatchingWrapper::TauTruthMatchingWrapper
(
const
std::string&
t
,
const
std::string&
n
,
const
IInterface*
p
) :
16
base_class(
t
,
n
,
p
)
17
{
18
}
19
20
StatusCode
TauTruthMatchingWrapper::initialize
()
21
{
22
ATH_CHECK
(
m_tauKey
.initialize());
23
CHECK
(
m_tTauTruthMatchingTool
.retrieve() );
24
return
StatusCode::SUCCESS;
25
}
26
27
StatusCode
TauTruthMatchingWrapper::finalize
()
28
{
29
return
StatusCode::SUCCESS;
30
}
31
32
StatusCode
TauTruthMatchingWrapper::addBranches
()
const
33
{
34
// Event context
35
const
EventContext& ctx = Gaudi::Hive::currentContext();
36
37
// Read handle
38
SG::ReadHandle<xAOD::TauJetContainer>
xTauContainer(
m_tauKey
,ctx);
39
if
(!xTauContainer.
isValid
()) {
40
ATH_MSG_ERROR
(
"Couldn't retrieve TauJetContainer with name "
<<
m_tauKey
);
41
return
StatusCode::FAILURE;
42
}
43
44
// Loop over taus
45
std::unique_ptr<TauAnalysisTools::ITauTruthMatchingTool::ITruthTausEvent>
46
truthTausEvent =
m_tTauTruthMatchingTool
->getEvent();
47
for
(
auto
xTau : *xTauContainer)
48
m_tTauTruthMatchingTool
->getTruth(*xTau, *truthTausEvent);
49
ATH_CHECK
(
m_tTauTruthMatchingTool
->lockDecorations(*xTauContainer) );
50
51
return
StatusCode::SUCCESS;
52
}
53
}
DerivationFramework::TauTruthMatchingWrapper::m_tTauTruthMatchingTool
ToolHandle< TauAnalysisTools::ITauTruthMatchingTool > m_tTauTruthMatchingTool
Definition:
TauTruthMatchingWrapper.h:40
DerivationFramework::TauTruthMatchingWrapper::addBranches
virtual StatusCode addBranches() const
Definition:
TauTruthMatchingWrapper.cxx:32
SG::ReadHandle
Definition:
StoreGate/StoreGate/ReadHandle.h:67
read_hist_ntuple.t
t
Definition:
read_hist_ntuple.py:5
DerivationFramework::TauTruthMatchingWrapper::initialize
StatusCode initialize()
Definition:
TauTruthMatchingWrapper.cxx:20
python.utils.AtlRunQueryDQUtils.p
p
Definition:
AtlRunQueryDQUtils.py:209
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition:
AthMsgStreamMacros.h:33
beamspotman.n
n
Definition:
beamspotman.py:729
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::TauTruthMatchingWrapper::TauTruthMatchingWrapper
TauTruthMatchingWrapper(const std::string &t, const std::string &n, const IInterface *p)
Definition:
TauTruthMatchingWrapper.cxx:15
ATH_CHECK
#define ATH_CHECK
Definition:
AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition:
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
DerivationFramework
THE reconstruction tool.
Definition:
ParticleSortingAlg.h:24
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
DerivationFramework::TauTruthMatchingWrapper::finalize
StatusCode finalize()
Definition:
TauTruthMatchingWrapper.cxx:27
TauTruthMatchingWrapper.h
DerivationFramework::TauTruthMatchingWrapper::m_tauKey
SG::ReadHandleKey< xAOD::TauJetContainer > m_tauKey
Definition:
TauTruthMatchingWrapper.h:38
ReadHandle.h
Handle class for reading from StoreGate.
Generated on Mon Sep 1 2025 21:20:01 for ATLAS Offline Software by
1.8.18