ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
DerivationFramework::AsgSelectionToolWrapper Class Reference

#include <AsgSelectionToolWrapper.h>

Inheritance diagram for DerivationFramework::AsgSelectionToolWrapper:
Collaboration diagram for DerivationFramework::AsgSelectionToolWrapper:

Public Member Functions

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

Private Attributes

PublicToolHandle< IAsgSelectionToolm_tool {this, "AsgSelectionTool", ""}
 
Gaudi::Property< std::string > m_cut {this, "CutType", "" }
 
SG::ReadHandleKey< xAOD::IParticleContainerm_containerKey {this, "ContainerName", ""}
 
SG::WriteDecorHandleKey< xAOD::IParticleContainerm_decorKey {this, "StoreGateEntryName", m_containerKey, ""}
 

Detailed Description

Definition at line 18 of file AsgSelectionToolWrapper.h.

Member Function Documentation

◆ addBranches()

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

Definition at line 24 of file AsgSelectionToolWrapper.cxx.

25  {
26  // retrieve container
27 
29  if( ! decorator.isValid() ) {
30  ATH_MSG_ERROR ("Couldn't retrieve IParticles with key: " << m_containerKey.fullKey() );
31  return StatusCode::FAILURE;
32  }
33 
34  // Write mask for each element and record to SG for subsequent selection
35  for ( const xAOD::IParticle* part : *decorator) {
36  auto theAccept = m_tool->accept(part); // asg::AcceptData or TAccept
37  if(m_cut.empty()){
38  decorator(*part) = true && theAccept;
39  } else{
40  decorator(*part) = true && theAccept.getCutResult(m_cut);
41  }
42  }
43 
44  return StatusCode::SUCCESS;
45  }

◆ initialize()

StatusCode DerivationFramework::AsgSelectionToolWrapper::initialize ( )
finaloverridevirtual

Definition at line 15 of file AsgSelectionToolWrapper.cxx.

15  {
16  ATH_CHECK(m_tool.retrieve());
17  ATH_CHECK(m_containerKey.initialize());
18  ATH_CHECK(m_decorKey.initialize());
19  return StatusCode::SUCCESS;
20  }

Member Data Documentation

◆ m_containerKey

SG::ReadHandleKey<xAOD::IParticleContainer> DerivationFramework::AsgSelectionToolWrapper::m_containerKey {this, "ContainerName", ""}
private

Definition at line 29 of file AsgSelectionToolWrapper.h.

◆ m_cut

Gaudi::Property<std::string> DerivationFramework::AsgSelectionToolWrapper::m_cut {this, "CutType", "" }
private

Definition at line 28 of file AsgSelectionToolWrapper.h.

◆ m_decorKey

SG::WriteDecorHandleKey<xAOD::IParticleContainer> DerivationFramework::AsgSelectionToolWrapper::m_decorKey {this, "StoreGateEntryName", m_containerKey, ""}
private

Definition at line 30 of file AsgSelectionToolWrapper.h.

◆ m_tool

PublicToolHandle<IAsgSelectionTool> DerivationFramework::AsgSelectionToolWrapper::m_tool {this, "AsgSelectionTool", ""}
private

Definition at line 27 of file AsgSelectionToolWrapper.h.


The documentation for this class was generated from the following files:
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
DerivationFramework::AsgSelectionToolWrapper::m_tool
PublicToolHandle< IAsgSelectionTool > m_tool
Definition: AsgSelectionToolWrapper.h:27
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework::AsgSelectionToolWrapper::m_containerKey
SG::ReadHandleKey< xAOD::IParticleContainer > m_containerKey
Definition: AsgSelectionToolWrapper.h:29
DerivationFramework::AsgSelectionToolWrapper::m_cut
Gaudi::Property< std::string > m_cut
Definition: AsgSelectionToolWrapper.h:28
DerivationFramework::AsgSelectionToolWrapper::m_decorKey
SG::WriteDecorHandleKey< xAOD::IParticleContainer > m_decorKey
Definition: AsgSelectionToolWrapper.h:30