ATLAS Offline Software
Loading...
Searching...
No Matches
columnar::MomentumAccessors< CI, CM > Class Template Referencefinal

a handle to hold a IMomentumAccessors object More...

#include <MomentumAccessors.h>

Collaboration diagram for columnar::MomentumAccessors< CI, CM >:

Public Member Functions

 MomentumAccessors () noexcept
template<typename MyMomentumAccessors, typename... Args>
 MomentumAccessors (std::in_place_type_t< MyMomentumAccessors >, Args &&... args)
template<typename MyMomentumAccessors, typename... Args>
void reset (std::in_place_type_t< MyMomentumAccessors >, Args &&... args)
double pt (ObjectId< CI, CM > object) const
 the various momentum accessors
double eta (ObjectId< CI, CM > object) const
double phi (ObjectId< CI, CM > object) const
double m (ObjectId< CI, CM > object) const
double e (ObjectId< CI, CM > object) const
double rapidity (ObjectId< CI, CM > object) const

Private Attributes

std::shared_ptr< const Detail::IMomentumAccessors< CI, CM > > m_accessors
 the underlying accessors, which default to the xAOD::IParticle accessors in case they are not overridden

Detailed Description

template<ContainerIdConcept CI, typename CM = ColumnarModeDefault>
class columnar::MomentumAccessors< CI, CM >

a handle to hold a IMomentumAccessors object

In principle the user could also hold a (smart) pointer to the underlying IMomentumAccessors, but having it in a class like this allows some refactoring in the future. Currently the expectation is that momentum accessors will not be widely used, but if it is I can then refactor this class without affecting the users.

The implementation of this is essentially this is a variation on a type-erased interface. There are a number of variations and optimizations that could be done here. Most notably if one tried hard enough one could probably avoid the ContainerId template parameter for the virtual interface, which would cut down on the code bloat. However that would need some infrastructure support which is not available (as of 24 Jul 25).

I'm not quite clear whether it would be a good idea to hide the underlying momentum accessors

Note that this is also always guaranteed to be valid, defaulting to the IParticle implementation (which is not available in columnar mode).

Definition at line 289 of file MomentumAccessors.h.

Constructor & Destructor Documentation

◆ MomentumAccessors() [1/2]

template<ContainerIdConcept CI, typename CM = ColumnarModeDefault>
columnar::MomentumAccessors< CI, CM >::MomentumAccessors ( )
inlinenoexcept

Definition at line 293 of file MomentumAccessors.h.

294 {
296 }
a handle to hold a IMomentumAccessors object
void reset(std::in_place_type_t< MyMomentumAccessors >, Args &&... args)

◆ MomentumAccessors() [2/2]

template<ContainerIdConcept CI, typename CM = ColumnarModeDefault>
template<typename MyMomentumAccessors, typename... Args>
columnar::MomentumAccessors< CI, CM >::MomentumAccessors ( std::in_place_type_t< MyMomentumAccessors< CI, CM > > ,
Args &&... args )
inline

Definition at line 299 of file MomentumAccessors.h.

Member Function Documentation

◆ e()

template<ContainerIdConcept CI, typename CM = ColumnarModeDefault>
double columnar::MomentumAccessors< CI, CM >::e ( ObjectId< CI, CM > object) const
inlinenodiscard

Definition at line 319 of file MomentumAccessors.h.

319 {
320 return m_accessors->e (object); }
std::shared_ptr< const Detail::IMomentumAccessors< CI, CM > > m_accessors
the underlying accessors, which default to the xAOD::IParticle accessors in case they are not overrid...

◆ eta()

template<ContainerIdConcept CI, typename CM = ColumnarModeDefault>
double columnar::MomentumAccessors< CI, CM >::eta ( ObjectId< CI, CM > object) const
inlinenodiscard

Definition at line 313 of file MomentumAccessors.h.

313 {
314 return m_accessors->eta (object); }

◆ m()

template<ContainerIdConcept CI, typename CM = ColumnarModeDefault>
double columnar::MomentumAccessors< CI, CM >::m ( ObjectId< CI, CM > object) const
inlinenodiscard

Definition at line 317 of file MomentumAccessors.h.

317 {
318 return m_accessors->m (object); }

◆ phi()

template<ContainerIdConcept CI, typename CM = ColumnarModeDefault>
double columnar::MomentumAccessors< CI, CM >::phi ( ObjectId< CI, CM > object) const
inlinenodiscard

Definition at line 315 of file MomentumAccessors.h.

315 {
316 return m_accessors->phi (object); }

◆ pt()

template<ContainerIdConcept CI, typename CM = ColumnarModeDefault>
double columnar::MomentumAccessors< CI, CM >::pt ( ObjectId< CI, CM > object) const
inlinenodiscard

the various momentum accessors

Definition at line 311 of file MomentumAccessors.h.

311 {
312 return m_accessors->pt (object); }

◆ rapidity()

template<ContainerIdConcept CI, typename CM = ColumnarModeDefault>
double columnar::MomentumAccessors< CI, CM >::rapidity ( ObjectId< CI, CM > object) const
inlinenodiscard

Definition at line 321 of file MomentumAccessors.h.

321 {
322 return m_accessors->rapidity (object); }

◆ reset()

template<ContainerIdConcept CI, typename CM = ColumnarModeDefault>
template<typename MyMomentumAccessors, typename... Args>
void columnar::MomentumAccessors< CI, CM >::reset ( std::in_place_type_t< MyMomentumAccessors< CI, CM > > ,
Args &&... args )
inline

Member Data Documentation

◆ m_accessors

template<ContainerIdConcept CI, typename CM = ColumnarModeDefault>
std::shared_ptr<const Detail::IMomentumAccessors<CI,CM> > columnar::MomentumAccessors< CI, CM >::m_accessors
private

the underlying accessors, which default to the xAOD::IParticle accessors in case they are not overridden

Definition at line 328 of file MomentumAccessors.h.


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