ATLAS Offline Software
SelectedParticlesFilterTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Id: SelectedParticlesFilterTool.cxx 486128 2012-03-02 08:54:20Z krasznaa $
18 
19 
20 namespace D3PD {
21 
22 
30  (const std::string& type,
31  const std::string& name,
32  const IInterface* parent)
34  m_selgetter (this),
35  m_selection (0),
36  m_index (0)
37 {
38  declareProperty ("SelectionGetter", m_selgetter,
39  "Getter for the SelectedParticles object.");
40 }
41 
42 
47 {
49  CHECK( m_selgetter.retrieve() );
50  return StatusCode::SUCCESS;
51 }
52 
53 
59 const std::type_info& SelectedParticlesFilterTool::elementTypeinfo() const
60 {
61  return m_getter->elementTypeinfo();
62 }
63 
64 
72 StatusCode SelectedParticlesFilterTool::reset (bool allowMissing /*= false*/)
73 {
74  m_index = 0;
75  if (m_selection) {
76  m_selgetter->releaseObject (m_selection);
77  m_selection = 0;
78  }
80  m_selection = m_selgetter->get<SelectedParticles> (allowMissing);
81  return StatusCode::SUCCESS;
82 }
83 
84 
91 {
92  // Loop until the filter passes.
93  while (const void* p = m_getter->nextUntyped()) {
94  ++m_index;
96  return p;
97  else
98  m_getter->releaseElementUntyped (p);
99  }
100  if (m_selection) {
101  m_selgetter->releaseObject (m_selection);
102  m_selection = 0;
103  }
104  return 0;
105 }
106 
107 
118 {
119  return m_getter->releaseElementUntyped (p);
120 }
121 
122 
123 } // namespace D3PD
D3PD::SelectedParticlesFilterTool::m_selection
const SelectedParticles * m_selection
Current SelectedParticles object.
Definition: SelectedParticlesFilterTool.h:108
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
D3PD::SelectedParticlesFilterTool::releaseElementUntyped
virtual void releaseElementUntyped(const void *p)
Release an object retrieved from the getter.
Definition: SelectedParticlesFilterTool.cxx:117
D3PD::CollectionGetterFilterToolImpl::reset
virtual StatusCode reset(bool allowMissing=false)
Reset the iteration to the start of the collection.
Definition: CollectionGetterFilterToolImpl.cxx:58
SelectedParticles.h
D3PD::CollectionGetterFilterToolImpl::m_getter
ToolHandle< ICollectionGetterTool > m_getter
Property: The getter defining the sequence to filter.
Definition: CollectionGetterFilterToolImpl.h:110
SelectedParticles::isGood
bool isGood(unsigned i) const
Definition: SelectedParticles.cxx:84
D3PD::SelectedParticlesFilterTool::nextUntyped
virtual const void * nextUntyped()
Return a pointer to the next element in the collection.
Definition: SelectedParticlesFilterTool.cxx:90
D3PD
Block filler tool for noisy FEB information.
Definition: InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
D3PD::CollectionGetterFilterToolImpl
Non-template parts of CollectionGetterFilterTool.
Definition: CollectionGetterFilterToolImpl.h:37
D3PD::CollectionGetterFilterToolImpl::initialize
StatusCode initialize()
Standard Gaudi initialize method.
Definition: CollectionGetterFilterToolImpl.cxx:43
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
D3PD::SelectedParticlesFilterTool::m_selgetter
ToolHandle< IObjGetterTool > m_selgetter
Property: Getter for the SelectedParticles object.
Definition: SelectedParticlesFilterTool.h:105
D3PD::SelectedParticlesFilterTool::reset
virtual StatusCode reset(bool allowMissing=false)
Reset the iteration to the start of the collection.
Definition: SelectedParticlesFilterTool.cxx:72
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
errorcheck.h
Helpers for checking error return status codes and reporting errors.
D3PD::SelectedParticlesFilterTool::elementTypeinfo
virtual const std::type_info & elementTypeinfo() const
Return the element type of the collection.
Definition: SelectedParticlesFilterTool.cxx:59
SelectedParticlesFilterTool.h
D3PD::SelectedParticlesFilterTool::initialize
StatusCode initialize()
Standard Gaudi initialize method.
Definition: SelectedParticlesFilterTool.cxx:46
D3PD::SelectedParticlesFilterTool::SelectedParticlesFilterTool
SelectedParticlesFilterTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition: SelectedParticlesFilterTool.cxx:30
SelectedParticles
Definition: SelectedParticles.h:54
D3PD::SelectedParticlesFilterTool::m_index
size_t m_index
Current iteration index.
Definition: SelectedParticlesFilterTool.h:111
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15