ATLAS Offline Software
Loading...
Searching...
No Matches
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
12
13namespace DerivationFramework {
14
16 {
17 ATH_CHECK(m_tauKey.initialize());
18 ATH_CHECK(m_isTruthMatchedKey.initialize());
19 ATH_CHECK(m_truthJetLinkKey.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
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define CHECK(...)
Evaluate an expression and check for errors.
Handle class for reading from StoreGate.
SG::ReadHandleKey< xAOD::TauJetContainer > m_tauKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthParticleLinkKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_isTruthMatchedKey
virtual StatusCode addBranches(const EventContext &ctx) const override final
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthJetLinkKey
ToolHandle< TauAnalysisTools::ITauTruthMatchingTool > m_tTauTruthMatchingTool
virtual bool isValid() override final
Can the handle be successfully dereferenced?
THE reconstruction tool.