ATLAS Offline Software
Loading...
Searching...
No Matches
ORUtils::OverlapLinkHelper< CI > Class Template Reference

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

#include <OverlapLinkHelper.h>

Inheritance diagram for ORUtils::OverlapLinkHelper< CI >:
Collaboration diagram for ORUtils::OverlapLinkHelper< CI >:

Public Member Functions

 OverlapLinkHelper (const std::string &linkLabel)
 Constructor.
template<columnar::ContainerIdConcept LT>
StatusCode addObjectLink (columnar::ObjectId< CI > p1, columnar::ObjectId< LT > p2) const
 Decorate p1 with an overlap object link to p2.
template<columnar::ContainerIdConcept LT>
columnar::OptObjectId< LT > getObjectLink (columnar::ObjectId< CI > p, columnar::ObjectRange< LT > container) const
 Retrieve an overlap-linked particle.

Private Types

using LTDef = columnar::VariantContainerId<columnar::ContainerId::particle1,columnar::ContainerId::particle1,columnar::ContainerId::particle2>

Private Attributes

columnar::ColumnDecorator< CI, columnar::ObjectLink< LTDef > > m_linkDecorator
 Object link decorator.
columnar::ColumnAccessor< CI, columnar::ObjectLink< LTDef > > m_linkAccessor
 Corresponding object link accessor (for reading only)

Detailed Description

template<columnar::ContainerIdConcept CI>
class ORUtils::OverlapLinkHelper< CI >

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:

  • Link one object to another
  • Retrieve a linked object

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 41 of file OverlapLinkHelper.h.

Member Typedef Documentation

◆ LTDef

Constructor & Destructor Documentation

◆ OverlapLinkHelper()

ORUtils::OverlapLinkHelper< CI >::OverlapLinkHelper ( const std::string & linkLabel)

Constructor.

Definition at line 79 of file OverlapLinkHelper.h.

82 {}
Helper class for setting links between overlapping objects.
columnar::ColumnAccessor< CI, columnar::ObjectLink< LTDef > > m_linkAccessor
Corresponding object link accessor (for reading only)
columnar::ColumnDecorator< CI, columnar::ObjectLink< LTDef > > m_linkDecorator
Object link decorator.

Member Function Documentation

◆ addObjectLink()

StatusCode ORUtils::OverlapLinkHelper< CI >::addObjectLink ( columnar::ObjectId< CI > p1,
columnar::ObjectId< LT > p2 ) const

Decorate p1 with an overlap object link to p2.

Definition at line 88 of file OverlapLinkHelper.h.

90 {
91 m_linkDecorator.set (p1, p2);
93 }

◆ getObjectLink()

Retrieve an overlap-linked particle.

Returns null if no ElementLink decoration exists.

Definition at line 99 of file OverlapLinkHelper.h.

101 {
102 // Check if the decoration is present and valid
103 if(!m_linkAccessor.isAvailable(p))
104 return {};
105 auto link = m_linkAccessor(p);
106 if (!link)
107 return {};
109 {
110 if (link.getXAODObject()->container() != &container.getXAODObject())
111 return {};
112 }
113 return link.template tryGetVariant<LT>();
114 }

Member Data Documentation

◆ m_linkAccessor

Corresponding object link accessor (for reading only)

Definition at line 71 of file OverlapLinkHelper.h.

◆ m_linkDecorator

Object link decorator.

Definition at line 69 of file OverlapLinkHelper.h.


The documentation for this class was generated from the following file: