Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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

 AsgSelectionToolWrapper (const std::string &t, const std::string &n, const IInterface *p)
 
StatusCode initialize () override final
 
virtual StatusCode addBranches () const override final
 

Private Attributes

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

Detailed Description

Definition at line 18 of file AsgSelectionToolWrapper.h.

Constructor & Destructor Documentation

◆ AsgSelectionToolWrapper()

DerivationFramework::AsgSelectionToolWrapper::AsgSelectionToolWrapper ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 19 of file AsgSelectionToolWrapper.cxx.

21  :
22  base_class(t,n,p)
23 
24  {
25  }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::AsgSelectionToolWrapper::addBranches ( ) const
finaloverridevirtual

Definition at line 41 of file AsgSelectionToolWrapper.cxx.

42  {
43  // retrieve container
44 
45  const EventContext& ctx = Gaudi::Hive::currentContext();
47  if( ! decorator.isValid() ) {
48  ATH_MSG_ERROR ("Couldn't retrieve IParticles with key: " << m_containerKey.fullKey() );
49  return StatusCode::FAILURE;
50  }
51 
52  // Write mask for each element and record to SG for subsequent selection
53  for ( const xAOD::IParticle* part : *decorator) {
54  auto theAccept = m_tool->accept(part); // asg::AcceptData or TAccept
55  if(m_cut.empty()){
56  decorator(*part) = true && theAccept;
57  } else{
58  decorator(*part) = true && theAccept.getCutResult(m_cut);
59  }
60  }
61 
62  return StatusCode::SUCCESS;
63  }

◆ initialize()

StatusCode DerivationFramework::AsgSelectionToolWrapper::initialize ( )
finaloverride

Definition at line 27 of file AsgSelectionToolWrapper.cxx.

27  {
28  if (m_sgName.value().empty()) {
29  ATH_MSG_ERROR("No SG name provided for the output of invariant mass tool!");
30  return StatusCode::FAILURE;
31  }
32  ATH_CHECK(m_tool.retrieve());
33  ATH_CHECK(m_containerKey.initialize());
34  m_decorKey = m_containerKey.key() + "." + m_sgName;
35  ATH_CHECK(m_decorKey.initialize());
36  return StatusCode::SUCCESS;
37  }

Member Data Documentation

◆ m_containerKey

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

Definition at line 31 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
private
Initial value:
{this, "DecorationKey", "",
"Will be composed by <ContainerName>.<StoreGateEntryName>"}

Definition at line 33 of file AsgSelectionToolWrapper.h.

◆ m_sgName

Gaudi::Property<std::string> DerivationFramework::AsgSelectionToolWrapper::m_sgName {this, "StoreGateEntryName", ""}
private

Definition at line 29 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
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
beamspotman.n
n
Definition: beamspotman.py:731
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
DerivationFramework::AsgSelectionToolWrapper::m_sgName
Gaudi::Property< std::string > m_sgName
Definition: AsgSelectionToolWrapper.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework::AsgSelectionToolWrapper::m_containerKey
SG::ReadHandleKey< xAOD::IParticleContainer > m_containerKey
Definition: AsgSelectionToolWrapper.h:31
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:33