ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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  }

◆ 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 
59  ATH_CHECK( m_caloClusterKey.initialize (m_streamName, !m_caloClusterKey.empty()) );
61 
65 
66  return StatusCode::SUCCESS;
67  }

Member Data Documentation

◆ m_caloClusterKey

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

Definition at line 59 of file ViewContainerThinning.h.

◆ m_caloClusterViewKey

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

Definition at line 66 of file ViewContainerThinning.h.

◆ m_streamName

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

Definition at line 54 of file ViewContainerThinning.h.

◆ m_trackParticleKey

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

Definition at line 57 of file ViewContainerThinning.h.

◆ m_trackParticleViewKey

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

Definition at line 64 of file ViewContainerThinning.h.

◆ m_truthParticleKey

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

Definition at line 61 of file ViewContainerThinning.h.

◆ m_truthParticleViewKey

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

Definition at line 68 of file ViewContainerThinning.h.


The documentation for this class was generated from the following files:
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
DerivationFramework::ViewContainerThinning::m_truthParticleKey
SG::ThinningHandleKey< xAOD::TruthParticleContainer > m_truthParticleKey
Definition: ViewContainerThinning.h:62
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
SG::ThinningHandle
Handle for requesting thinning for a data object.
Definition: ThinningHandle.h:84
DerivationFramework::ViewContainerThinning::m_trackParticleKey
SG::ThinningHandleKey< xAOD::TrackParticleContainer > m_trackParticleKey
Definition: ViewContainerThinning.h:58
DerivationFramework::ViewContainerThinning::m_truthParticleViewKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleViewKey
Definition: ViewContainerThinning.h:69
DerivationFramework::ViewContainerThinning::m_streamName
StringProperty m_streamName
Definition: ViewContainerThinning.h:55
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DerivationFramework::ViewContainerThinning::m_caloClusterKey
SG::ThinningHandleKey< xAOD::CaloClusterContainer > m_caloClusterKey
Definition: ViewContainerThinning.h:60
DerivationFramework::ViewContainerThinning::doThinningT
StatusCode doThinningT(const SG::ThinningHandleKey< T > &key, const SG::ReadHandleKey< T > &viewKey) const
Definition: ViewContainerThinning.cxx:32
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
DerivationFramework::ViewContainerThinning::m_trackParticleViewKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticleViewKey
Definition: ViewContainerThinning.h:65
DerivationFramework::ViewContainerThinning::m_caloClusterViewKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_caloClusterViewKey
Definition: ViewContainerThinning.h:67
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37