ATLAS Offline Software
ConversionVertexAssociationTool.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: ConversionVertexAssociationTool.cxx 605545 2014-07-09 04:51:09Z ssnyder $
16 
17 
18 namespace D3PD {
19 
20 
28  const std::string& name,
29  const IInterface* parent)
30  : Base (type, name, parent),
31  m_vxCounter(0),
32  m_ph(0)
33 {
34 }
35 
36 
41 {
42  m_vxCounter = 0;
43  m_ph = &ph;
44  return StatusCode::SUCCESS;
45 }
46 
47 
54 const xAOD::Vertex*
56 {
57  if(!m_ph || m_vxCounter >= m_ph->nVertices())
58  return 0;
59 
60  return m_ph->vertex(m_vxCounter++);
61 }
62 
63 
64 } // namespace D3PD
xAOD::Photon_v1::nVertices
size_t nVertices() const
Return the number xAOD::Vertex/vertices that match the photon candidate.
D3PD::ConversionVertexAssociationTool::ConversionVertexAssociationTool
ConversionVertexAssociationTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Gaudi tool constructor.
Definition: ConversionVertexAssociationTool.cxx:27
D3PD::ConversionVertexAssociationTool::reset
virtual StatusCode reset(const xAOD::Photon &ph)
Start the iteration for a new association.
Definition: ConversionVertexAssociationTool.cxx:40
D3PD::ConversionVertexAssociationTool::next
virtual const xAOD::Vertex * next()
Return a pointer to the next associated object.
Definition: ConversionVertexAssociationTool.cxx:55
D3PD::MultiAssociationTool< xAOD::Photon, xAOD::Vertex >
D3PD
Block filler tool for noisy FEB information.
Definition: InnerDetector/InDetMonitoring/InDetGlobalMonitoring/macros/EnhancedPrimaryVertexMonitoring/TrigD3PD/ChainGroup.h:21
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
errorcheck.h
Helpers for checking error return status codes and reporting errors.
D3PD::ConversionVertexAssociationTool::m_vxCounter
unsigned int m_vxCounter
Definition: ConversionVertexAssociationTool.h:65
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
xAOD::Photon_v1
Definition: Photon_v1.h:37
D3PD::ConversionVertexAssociationTool::m_ph
const xAOD::Photon * m_ph
Definition: ConversionVertexAssociationTool.h:66
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ConversionVertexAssociationTool.h
xAOD::Photon_v1::vertex
const xAOD::Vertex * vertex(size_t index=0) const
Pointer to the xAOD::Vertex/es that match the photon candidate.
Definition: Photon_v1.cxx:46