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

Helper class for setting links between overlapping objects. More...

#include <OverlapLinkHelper.h>

Collaboration diagram for ORUtils::OverlapLinkHelper:

Public Member Functions

 OverlapLinkHelper (const std::string &linkLabel)
 Constructor. More...
 
StatusCode addObjectLink (const xAOD::IParticle &p1, const xAOD::IParticle &p2) const
 Decorate p1 with an overlap object link to p2. More...
 
const xAOD::IParticlegetObjectLink (const xAOD::IParticle &p) const
 Retrieve an overlap-linked particle. More...
 

Private Attributes

ort::objLinkDecorator_t m_linkDecorator
 Object link decorator. More...
 
ort::objLinkAccessor_t m_linkAccessor
 Corresponding object link accessor (for reading only) More...
 

Detailed Description

Helper class for setting links between overlapping objects.

This utility class is used by the OverlapTools, though it could probably be used by a user as well. It can do two things at the moment:

For this simple implementation, use a single object link. I might later allow for an array of links to include all possible object overlaps.

Author
Steve Farrell Steve.nosp@m.n.Fa.nosp@m.rrell.nosp@m.@cer.nosp@m.n.ch

Definition at line 34 of file OverlapLinkHelper.h.

Constructor & Destructor Documentation

◆ OverlapLinkHelper()

ORUtils::OverlapLinkHelper::OverlapLinkHelper ( const std::string &  linkLabel)

Constructor.

Definition at line 14 of file OverlapLinkHelper.cxx.

15  : m_linkDecorator(linkLabel),
16  m_linkAccessor(linkLabel)
17  {}

Member Function Documentation

◆ addObjectLink()

StatusCode ORUtils::OverlapLinkHelper::addObjectLink ( const xAOD::IParticle p1,
const xAOD::IParticle p2 
) const

Decorate p1 with an overlap object link to p2.

Definition at line 22 of file OverlapLinkHelper.cxx.

24  {
25  const xAOD::IParticleContainer* overlapContainer =
26  static_cast<const xAOD::IParticleContainer*>( p2.container() );
27  m_linkDecorator(p1) = ort::objLink_t(*overlapContainer, p2.index());
28  return StatusCode::SUCCESS;
29  }

◆ getObjectLink()

const xAOD::IParticle * ORUtils::OverlapLinkHelper::getObjectLink ( const xAOD::IParticle p) const

Retrieve an overlap-linked particle.

Returns null if no ElementLink decoration exists.

Definition at line 34 of file OverlapLinkHelper.cxx.

36  {
37  // Check if the decoration is present and valid
39  auto& link = m_linkAccessor(p);
40  if(link.isValid()) return *link;
41  }
42  return nullptr;
43  }

Member Data Documentation

◆ m_linkAccessor

ort::objLinkAccessor_t ORUtils::OverlapLinkHelper::m_linkAccessor
private

Corresponding object link accessor (for reading only)

Definition at line 55 of file OverlapLinkHelper.h.

◆ m_linkDecorator

ort::objLinkDecorator_t ORUtils::OverlapLinkHelper::m_linkDecorator
private

Object link decorator.

Definition at line 53 of file OverlapLinkHelper.h.


The documentation for this class was generated from the following files:
ort::objLink_t
ElementLink< xAOD::IParticleContainer > objLink_t
Overlap object link.
Definition: OverlapRemovalDefs.h:37
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ORUtils::OverlapLinkHelper::m_linkDecorator
ort::objLinkDecorator_t m_linkDecorator
Object link decorator.
Definition: OverlapLinkHelper.h:53
SG::AuxElement::index
size_t index() const
Return the index of this element within its container.
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
ORUtils::OverlapLinkHelper::m_linkAccessor
ort::objLinkAccessor_t m_linkAccessor
Corresponding object link accessor (for reading only)
Definition: OverlapLinkHelper.h:55
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
SG::AuxElement::container
const SG::AuxVectorData * container() const
Return the container holding this element.