ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
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
StatusCode
TauTruthMatchingWrapper::initialize
()
16
{
17
ATH_CHECK
(
m_tauKey
.initialize());
18
ATH_CHECK
(
m_isTruthMatchedKey
.initialize());
19
ATH_CHECK
(
m_truthJetLinkKey
.initialize());
20
ATH_CHECK
(
m_truthParticleLinkKey
.initialize());
21
CHECK
(
m_tTauTruthMatchingTool
.retrieve() );
22
return
StatusCode::SUCCESS;
23
}
24
25
26
StatusCode
TauTruthMatchingWrapper::addBranches
(
const
EventContext& ctx)
const
27
{
28
// Event context
29
30
// Read handle
31
SG::ReadHandle<xAOD::TauJetContainer>
xTauContainer(
m_tauKey
,ctx);
32
if
(!xTauContainer.
isValid
()) {
33
ATH_MSG_ERROR
(
"Couldn't retrieve TauJetContainer with name "
<<
m_tauKey
);
34
return
StatusCode::FAILURE;
35
}
36
37
// Loop over taus
38
std::unique_ptr<TauAnalysisTools::ITauTruthMatchingTool::ITruthTausEvent>
39
truthTausEvent =
m_tTauTruthMatchingTool
->getEvent();
40
for
(
auto
xTau : *xTauContainer)
41
m_tTauTruthMatchingTool
->getTruth(*xTau, *truthTausEvent);
42
ATH_CHECK
(
m_tTauTruthMatchingTool
->lockDecorations(*xTauContainer) );
43
44
return
StatusCode::SUCCESS;
45
}
46
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
ReadHandle.h
Handle class for reading from StoreGate.
TauTruthMatchingWrapper.h
DerivationFramework::TauTruthMatchingWrapper::initialize
virtual StatusCode initialize() override final
Definition
TauTruthMatchingWrapper.cxx:15
DerivationFramework::TauTruthMatchingWrapper::m_tauKey
SG::ReadHandleKey< xAOD::TauJetContainer > m_tauKey
Definition
TauTruthMatchingWrapper.h:39
DerivationFramework::TauTruthMatchingWrapper::m_truthParticleLinkKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthParticleLinkKey
Definition
TauTruthMatchingWrapper.h:50
DerivationFramework::TauTruthMatchingWrapper::m_isTruthMatchedKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_isTruthMatchedKey
Definition
TauTruthMatchingWrapper.h:44
DerivationFramework::TauTruthMatchingWrapper::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override final
Definition
TauTruthMatchingWrapper.cxx:26
DerivationFramework::TauTruthMatchingWrapper::m_truthJetLinkKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthJetLinkKey
Definition
TauTruthMatchingWrapper.h:47
DerivationFramework::TauTruthMatchingWrapper::m_tTauTruthMatchingTool
ToolHandle< TauAnalysisTools::ITauTruthMatchingTool > m_tTauTruthMatchingTool
Definition
TauTruthMatchingWrapper.h:41
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
DerivationFramework
THE reconstruction tool.
Definition
CascadeTools.h:16
Generated on
for ATLAS Offline Software by
1.17.0