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 CHECK( m_tTauTruthMatchingTool.retrieve() );
19 return StatusCode::SUCCESS;
20 }
21
22
23 StatusCode TauTruthMatchingWrapper::addBranches(const EventContext& ctx) const
24 {
25 // Event context
26
27 // Read handle
29 if (!xTauContainer.isValid()) {
30 ATH_MSG_ERROR("Couldn't retrieve TauJetContainer with name " << m_tauKey);
31 return StatusCode::FAILURE;
32 }
33
34 // Loop over taus
35 std::unique_ptr<TauAnalysisTools::ITauTruthMatchingTool::ITruthTausEvent>
36 truthTausEvent = m_tTauTruthMatchingTool->getEvent();
37 for(auto xTau : *xTauContainer)
38 m_tTauTruthMatchingTool->getTruth(*xTau, *truthTausEvent);
39 ATH_CHECK( m_tTauTruthMatchingTool->lockDecorations(*xTauContainer) );
40
41 return StatusCode::SUCCESS;
42 }
43}
#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
virtual StatusCode addBranches(const EventContext &ctx) const override final
ToolHandle< TauAnalysisTools::ITauTruthMatchingTool > m_tTauTruthMatchingTool
virtual bool isValid() override final
Can the handle be successfully dereferenced?
THE reconstruction tool.