ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFramework::TauTruthMatchingWrapper Class Reference

#include <TauTruthMatchingWrapper.h>

Inheritance diagram for DerivationFramework::TauTruthMatchingWrapper:
Collaboration diagram for DerivationFramework::TauTruthMatchingWrapper:

Public Member Functions

virtual StatusCode initialize () override final
virtual StatusCode addBranches (const EventContext &ctx) const override final

Private Attributes

SG::ReadHandleKey< xAOD::TauJetContainer > m_tauKey {this, "TauContainerName", "TauJets", "ReadHandleKey for input TauJetContainer"}
ToolHandle< TauAnalysisTools::ITauTruthMatchingTool > m_tTauTruthMatchingTool {this, "TauTruthMatchingTool", "TauAnalysisTools::TauTruthMatchingTool"}
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_isTruthMatchedKey {this, "IsTruthMatchedKey", m_tauKey, "IsTruthMatched", "WriteDecorHandleKey for IsTruthMatched decoration"}
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthJetLinkKey {this, "TruthJetLinkKey", m_tauKey, "truthJetLink", "WriteDecorHandleKey for truthJetLink decoration"}
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthParticleLinkKey {this, "TruthParticleLinkKey", m_tauKey, "truthParticleLink", "WriteDecorHandleKey for truthParticleLink decoration"}
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_tauOriginKey {this, "TauOriginKey", m_tauKey, "tauOriginDevOnly", "WriteDecorHandleKey for tauOriginDev decoration"}

Detailed Description

Definition at line 29 of file TauTruthMatchingWrapper.h.

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::TauTruthMatchingWrapper::addBranches ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 29 of file TauTruthMatchingWrapper.cxx.

30 {
31 // Event context
32
33 // Read handle
34 SG::ReadHandle<xAOD::TauJetContainer> xTauContainer(m_tauKey,ctx);
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();
43 SG::WriteDecorHandle<xAOD::TauJetContainer, int> dec_tauOrigin(m_tauOriginKey, ctx);
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 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x,...)
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_tauOriginKey
SG::ReadHandleKey< xAOD::TauJetContainer > m_tauKey
ToolHandle< TauAnalysisTools::ITauTruthMatchingTool > m_tTauTruthMatchingTool
int tauOrigin(const xAOD::TauJet &xTau)
return truth origin class of the tau: -1 no truth match, 0 no hadron ancestor, 1 b-hadron,...

◆ initialize()

StatusCode DerivationFramework::TauTruthMatchingWrapper::initialize ( )
finaloverridevirtual

Definition at line 17 of file TauTruthMatchingWrapper.cxx.

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 }
#define CHECK(...)
Evaluate an expression and check for errors.
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthParticleLinkKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_isTruthMatchedKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthJetLinkKey

Member Data Documentation

◆ m_isTruthMatchedKey

SG::WriteDecorHandleKey<xAOD::TauJetContainer> DerivationFramework::TauTruthMatchingWrapper::m_isTruthMatchedKey {this, "IsTruthMatchedKey", m_tauKey, "IsTruthMatched", "WriteDecorHandleKey for IsTruthMatched decoration"}
private

Definition at line 43 of file TauTruthMatchingWrapper.h.

44{this, "IsTruthMatchedKey", m_tauKey, "IsTruthMatched", "WriteDecorHandleKey for IsTruthMatched decoration"};

◆ m_tauKey

SG::ReadHandleKey<xAOD::TauJetContainer> DerivationFramework::TauTruthMatchingWrapper::m_tauKey {this, "TauContainerName", "TauJets", "ReadHandleKey for input TauJetContainer"}
private

Definition at line 38 of file TauTruthMatchingWrapper.h.

39{this, "TauContainerName", "TauJets", "ReadHandleKey for input TauJetContainer"};

◆ m_tauOriginKey

SG::WriteDecorHandleKey<xAOD::TauJetContainer> DerivationFramework::TauTruthMatchingWrapper::m_tauOriginKey {this, "TauOriginKey", m_tauKey, "tauOriginDevOnly", "WriteDecorHandleKey for tauOriginDev decoration"}
private

Definition at line 52 of file TauTruthMatchingWrapper.h.

53{this, "TauOriginKey", m_tauKey, "tauOriginDevOnly", "WriteDecorHandleKey for tauOriginDev decoration"};

◆ m_truthJetLinkKey

SG::WriteDecorHandleKey<xAOD::TauJetContainer> DerivationFramework::TauTruthMatchingWrapper::m_truthJetLinkKey {this, "TruthJetLinkKey", m_tauKey, "truthJetLink", "WriteDecorHandleKey for truthJetLink decoration"}
private

Definition at line 46 of file TauTruthMatchingWrapper.h.

47{this, "TruthJetLinkKey", m_tauKey, "truthJetLink", "WriteDecorHandleKey for truthJetLink decoration"};

◆ m_truthParticleLinkKey

SG::WriteDecorHandleKey<xAOD::TauJetContainer> DerivationFramework::TauTruthMatchingWrapper::m_truthParticleLinkKey {this, "TruthParticleLinkKey", m_tauKey, "truthParticleLink", "WriteDecorHandleKey for truthParticleLink decoration"}
private

Definition at line 49 of file TauTruthMatchingWrapper.h.

50{this, "TruthParticleLinkKey", m_tauKey, "truthParticleLink", "WriteDecorHandleKey for truthParticleLink decoration"};

◆ m_tTauTruthMatchingTool

ToolHandle< TauAnalysisTools::ITauTruthMatchingTool > DerivationFramework::TauTruthMatchingWrapper::m_tTauTruthMatchingTool {this, "TauTruthMatchingTool", "TauAnalysisTools::TauTruthMatchingTool"}
private

Definition at line 41 of file TauTruthMatchingWrapper.h.

41{this, "TauTruthMatchingTool", "TauAnalysisTools::TauTruthMatchingTool"};

The documentation for this class was generated from the following files: