ATLAS Offline Software
Loading...
Searching...
No Matches
TauTruthMatchingWrapper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6// TauTruthMatchingWrapper.cxx
7// Author: Evelina Bouhova-Thacker (e.bouhova@cern.ch)
9
14
15namespace DerivationFramework {
16
18 {
19 ATH_CHECK(m_tauKey.initialize());
20 ATH_CHECK(m_isTruthMatchedKey.initialize());
21 ATH_CHECK(m_truthJetLinkKey.initialize());
23 ATH_CHECK(m_tauOriginKey.initialize());
24 CHECK( m_tTauTruthMatchingTool.retrieve() );
25 return StatusCode::SUCCESS;
26 }
27
28
29 StatusCode TauTruthMatchingWrapper::addBranches(const EventContext& ctx) const
30 {
31 // Event context
32
33 // Read handle
35 if (!xTauContainer.isValid()) {
36 ATH_MSG_ERROR("Couldn't retrieve TauJetContainer with name " << m_tauKey);
37 return StatusCode::FAILURE;
38 }
39
40 // Loop over taus
41 std::unique_ptr<TauAnalysisTools::ITauTruthMatchingTool::ITruthTausEvent>
42 truthTausEvent = m_tTauTruthMatchingTool->getEvent();
44 for(auto xTau : *xTauContainer) {
45 m_tTauTruthMatchingTool->getTruth(*xTau, *truthTausEvent);
46 dec_tauOrigin(*xTau) = TauAnalysisTools::tauOrigin(*xTau);
47 }
48 ATH_CHECK( m_tTauTruthMatchingTool->lockDecorations(*xTauContainer) );
49
50 return StatusCode::SUCCESS;
51 }
52}
#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.
Handle class for adding a decoration to an object.
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_tauOriginKey
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?
Handle class for adding a decoration to an object.
THE reconstruction tool.
int tauOrigin(const xAOD::TauJet &xTau)
return truth origin class of the tau: -1 no truth match, 0 no hadron ancestor, 1 b-hadron,...