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

#include <ViewContainerThinning.h>

Inheritance diagram for DerivationFramework::ViewContainerThinning:
Collaboration diagram for DerivationFramework::ViewContainerThinning:

Public Member Functions

virtual StatusCode initialize () override
virtual StatusCode finalize () override
virtual StatusCode doThinning () const override

Protected Member Functions

template<class T>
StatusCode doThinningT (const SG::ThinningHandleKey< T > &key, const SG::ReadHandleKey< T > &viewKey) const

Protected Attributes

StringProperty m_streamName { this, "StreamName", "", "Name of the stream being thinned" }
SG::ThinningHandleKey< xAOD::TrackParticleContainerm_trackParticleKey { this, "TrackParticleKey", "", "" }
SG::ThinningHandleKey< xAOD::CaloClusterContainerm_caloClusterKey { this, "CaloClusterKey", "", "" }
SG::ThinningHandleKey< xAOD::TruthParticleContainerm_truthParticleKey { this, "TruthParticleKey", "", "" }
SG::ReadHandleKey< xAOD::TrackParticleContainerm_trackParticleViewKey { this, "TrackParticleViewKey", "", "" }
SG::ReadHandleKey< xAOD::CaloClusterContainerm_caloClusterViewKey { this, "CaloClusterViewKey", "", "" }
SG::ReadHandleKey< xAOD::TruthParticleContainerm_truthParticleViewKey { this, "TruthParticleViewKey", "", "" }

Detailed Description

Definition at line 32 of file ViewContainerThinning.h.

Member Function Documentation

◆ doThinning()

StatusCode DerivationFramework::ViewContainerThinning::doThinning ( ) const
overridevirtual

Definition at line 76 of file ViewContainerThinning.cxx.

77 {
78
79 if (!m_trackParticleKey.empty()) {
81 }
82
83 if (!m_caloClusterKey.empty()) {
85 }
86
87 if (!m_truthParticleKey.empty()) {
89 }
90 return StatusCode::SUCCESS;
91 }
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleViewKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleViewKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClusterViewKey
SG::ThinningHandleKey< xAOD::CaloClusterContainer > m_caloClusterKey
SG::ThinningHandleKey< xAOD::TruthParticleContainer > m_truthParticleKey
StatusCode doThinningT(const SG::ThinningHandleKey< T > &key, const SG::ReadHandleKey< T > &viewKey) const
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_trackParticleKey

◆ doThinningT()

template<class T>
StatusCode DerivationFramework::ViewContainerThinning::doThinningT ( const SG::ThinningHandleKey< T > & key,
const SG::ReadHandleKey< T > & viewKey ) const
protected

Definition at line 32 of file ViewContainerThinning.cxx.

34 {
35 const EventContext& ctx = Gaudi::Hive::currentContext();
36
37 SG::ThinningHandle<T> sourceCont (key, ctx);
38 SG::ReadHandle<T> viewCont (viewKey, ctx);
39
40 std::vector<bool> masks;
41 masks.assign( sourceCont->size(), false);
42
43 for( const auto* part: *viewCont){
44 masks[ part->index() ] = true;
45 }
46
47 sourceCont.keep (masks);
48 return StatusCode::SUCCESS;
49 }

◆ finalize()

StatusCode DerivationFramework::ViewContainerThinning::finalize ( )
overridevirtual

Definition at line 69 of file ViewContainerThinning.cxx.

70 {
71 return StatusCode::SUCCESS;
72 }

◆ initialize()

StatusCode DerivationFramework::ViewContainerThinning::initialize ( )
overridevirtual

Definition at line 54 of file ViewContainerThinning.cxx.

55 {
56 ATH_MSG_INFO ("Initializing " << name() << "...");
57
61
65
66 return StatusCode::SUCCESS;
67 }
#define ATH_MSG_INFO(x)

Member Data Documentation

◆ m_caloClusterKey

SG::ThinningHandleKey<xAOD::CaloClusterContainer> DerivationFramework::ViewContainerThinning::m_caloClusterKey { this, "CaloClusterKey", "", "" }
protected

Definition at line 59 of file ViewContainerThinning.h.

60{ this, "CaloClusterKey", "", "" };

◆ m_caloClusterViewKey

SG::ReadHandleKey<xAOD::CaloClusterContainer> DerivationFramework::ViewContainerThinning::m_caloClusterViewKey { this, "CaloClusterViewKey", "", "" }
protected

Definition at line 66 of file ViewContainerThinning.h.

67{ this, "CaloClusterViewKey", "", "" };

◆ m_streamName

StringProperty DerivationFramework::ViewContainerThinning::m_streamName { this, "StreamName", "", "Name of the stream being thinned" }
protected

Definition at line 54 of file ViewContainerThinning.h.

55{ this, "StreamName", "", "Name of the stream being thinned" };

◆ m_trackParticleKey

SG::ThinningHandleKey<xAOD::TrackParticleContainer> DerivationFramework::ViewContainerThinning::m_trackParticleKey { this, "TrackParticleKey", "", "" }
protected

Definition at line 57 of file ViewContainerThinning.h.

58{ this, "TrackParticleKey", "", "" };

◆ m_trackParticleViewKey

SG::ReadHandleKey<xAOD::TrackParticleContainer> DerivationFramework::ViewContainerThinning::m_trackParticleViewKey { this, "TrackParticleViewKey", "", "" }
protected

Definition at line 64 of file ViewContainerThinning.h.

65{ this, "TrackParticleViewKey", "", "" };

◆ m_truthParticleKey

SG::ThinningHandleKey<xAOD::TruthParticleContainer> DerivationFramework::ViewContainerThinning::m_truthParticleKey { this, "TruthParticleKey", "", "" }
protected

Definition at line 61 of file ViewContainerThinning.h.

62{ this, "TruthParticleKey", "", "" };

◆ m_truthParticleViewKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> DerivationFramework::ViewContainerThinning::m_truthParticleViewKey { this, "TruthParticleViewKey", "", "" }
protected

Definition at line 68 of file ViewContainerThinning.h.

69{ this, "TruthParticleViewKey", "", "" };

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