ATLAS Offline Software
Loading...
Searching...
No Matches
VertexView Class Reference

Type-erased view on a generic vertex class - implementation won't bother with any VertexTraits at the moment, since the only functions where the xAOD::TruthVertex and xAOD::Vertex have any overlap are the x(), y() and z(), and they have the same name, so there is literally no point at the moment. More...

#include <VertexView.h>

Collaboration diagram for VertexView:

Classes

struct  VTable

Public Member Functions

template<typename T>
 VertexView (const T *pobj)
template<typename T, typename = std::enable_if_t< !std::is_pointer_v<T> && !std::is_same_v<std::decay_t<T>, VertexView> >>
 VertexView (const T &obj)
 VertexView (const VertexView &t)=default
 VertexView (const VertexView *)=delete
 VertexView (VertexView *)=delete
virtual ~VertexView ()=default
const void * ptr () const
float x () const
float y () const
float z () const
float dx () const
float dy () const
float dz () const
size_t nTrackParticles () const
float chiSquared () const
float numberDoF () const
float time () const
int vertexType () const
const std::type_info & type () const
template<typename T>
bool is () const
template<typename T>
const T * as () const

Static Private Member Functions

template<typename T>
static const T & deref (const void *p)
template<typename T>
static float x_impl (const void *p)
template<typename T>
static float y_impl (const void *p)
template<typename T>
static float z_impl (const void *p)
template<typename T>
static float dx_impl (const void *p)
template<typename T>
static float dy_impl (const void *p)
template<typename T>
static float dz_impl (const void *p)
template<typename T>
static size_t nTrackParticles_impl (const void *p)
template<typename T>
static float chiSquared_impl (const void *p)
template<typename T>
static float numberDoF_impl (const void *p)
template<typename T>
static float time_impl (const void *p)
template<typename T>
static int vertexType_impl (const void *p)

Private Attributes

const void * m_ptr
const VTable * m_vtable

Static Private Attributes

template<typename T>
static const VTable table

Detailed Description

Type-erased view on a generic vertex class - implementation won't bother with any VertexTraits at the moment, since the only functions where the xAOD::TruthVertex and xAOD::Vertex have any overlap are the x(), y() and z(), and they have the same name, so there is literally no point at the moment.

at some point we will want to extend this class so that it can properly include information on which tracks lie on the vertex since for proper selection, in an Roi it is not enough to verify that the z range is within the Roi, we need to check that AT LEAST one of the tracks on the vertex is in the Roi as well - if none of the tracks on the vertex is in the Roi then the vertex can not be found in that Roi - this is quite am important aspect - particularly for jet and bjet vertices in high pileup events

Definition at line 42 of file VertexView.h.

Constructor & Destructor Documentation

◆ VertexView() [1/5]

template<typename T>
VertexView::VertexView ( const T * pobj)
inline

Definition at line 47 of file VertexView.h.

47 : m_ptr(pobj), m_vtable(&table<T>) {
48#if 0
52 using BareT = std::remove_cv_t<T>;
53 static_assert( std::is_same_v<BareT, xAOD::Vertex> || std::is_same_v<BareT, xAOD::TruthVertex>,
54 "unsupported VertexView type" );
55#endif
56 }
const void * m_ptr
Definition VertexView.h:98
const VTable * m_vtable
Definition VertexView.h:99
static const VTable table
Definition VertexView.h:148

◆ VertexView() [2/5]

template<typename T, typename = std::enable_if_t< !std::is_pointer_v<T> && !std::is_same_v<std::decay_t<T>, VertexView> >>
VertexView::VertexView ( const T & obj)
inline

Definition at line 60 of file VertexView.h.

60: m_ptr(&obj), m_vtable(&table<T>) { }

◆ VertexView() [3/5]

VertexView::VertexView ( const VertexView & t)
default

◆ VertexView() [4/5]

VertexView::VertexView ( const VertexView * )
delete

◆ VertexView() [5/5]

VertexView::VertexView ( VertexView * )
delete

◆ ~VertexView()

virtual VertexView::~VertexView ( )
virtualdefault

Member Function Documentation

◆ as()

template<typename T>
const T * VertexView::as ( ) const
inline

Definition at line 91 of file VertexView.h.

91{ return is<T>() ? static_cast<const T*>(m_ptr) : 0; }
bool is() const
Definition VertexView.h:89
unsigned long long T

◆ chiSquared()

float VertexView::chiSquared ( ) const
inline

Definition at line 80 of file VertexView.h.

80{ return m_vtable->chiSquared(m_ptr); }

◆ chiSquared_impl()

template<typename T>
float VertexView::chiSquared_impl ( const void * p)
inlinestaticprivate

Definition at line 137 of file VertexView.h.

static const T & deref(const void *p)
Definition VertexView.h:126
static float chiSquared(const T &)

◆ deref()

template<typename T>
const T & VertexView::deref ( const void * p)
inlinestaticprivate

Definition at line 126 of file VertexView.h.

126{ return *static_cast<const T*>(p); }

◆ dx()

float VertexView::dx ( ) const
inline

Definition at line 75 of file VertexView.h.

75{ return m_vtable->dx(m_ptr); }

◆ dx_impl()

template<typename T>
float VertexView::dx_impl ( const void * p)
inlinestaticprivate

Definition at line 132 of file VertexView.h.

132{ return VertexTraits<T>::dx(deref<T>(p)); }
static float dx(const T &)

◆ dy()

float VertexView::dy ( ) const
inline

Definition at line 76 of file VertexView.h.

76{ return m_vtable->dy(m_ptr); }

◆ dy_impl()

template<typename T>
float VertexView::dy_impl ( const void * p)
inlinestaticprivate

Definition at line 133 of file VertexView.h.

133{ return VertexTraits<T>::dy(deref<T>(p)); }
static float dy(const T &)

◆ dz()

float VertexView::dz ( ) const
inline

Definition at line 77 of file VertexView.h.

77{ return m_vtable->dz(m_ptr); }

◆ dz_impl()

template<typename T>
float VertexView::dz_impl ( const void * p)
inlinestaticprivate

Definition at line 134 of file VertexView.h.

134{ return VertexTraits<T>::dz(deref<T>(p)); }
static float dz(const T &)

◆ is()

template<typename T>
bool VertexView::is ( ) const
inline

Definition at line 89 of file VertexView.h.

89{ return type()==typeid(T); }
const std::type_info & type() const
Definition VertexView.h:87

◆ nTrackParticles()

size_t VertexView::nTrackParticles ( ) const
inline

Definition at line 79 of file VertexView.h.

79{ return m_vtable->nTrackParticles(m_ptr); }

◆ nTrackParticles_impl()

template<typename T>
size_t VertexView::nTrackParticles_impl ( const void * p)
inlinestaticprivate

Definition at line 136 of file VertexView.h.

static size_t nTrackParticles(const T &)

◆ numberDoF()

float VertexView::numberDoF ( ) const
inline

Definition at line 81 of file VertexView.h.

81{ return m_vtable->numberDoF(m_ptr); }

◆ numberDoF_impl()

template<typename T>
float VertexView::numberDoF_impl ( const void * p)
inlinestaticprivate

Definition at line 138 of file VertexView.h.

static float numberDoF(const T &)

◆ ptr()

const void * VertexView::ptr ( ) const
inline

Definition at line 69 of file VertexView.h.

69{ return m_ptr; }

◆ time()

float VertexView::time ( ) const
inline

Definition at line 83 of file VertexView.h.

83{ return m_vtable->time(m_ptr); }

◆ time_impl()

template<typename T>
float VertexView::time_impl ( const void * p)
inlinestaticprivate

Definition at line 140 of file VertexView.h.

140{ return VertexTraits<T>::time(deref<T>(p)); }
static float time(const T &)

◆ type()

const std::type_info & VertexView::type ( ) const
inline

Definition at line 87 of file VertexView.h.

87{ return *m_vtable->m_type; }

◆ vertexType()

int VertexView::vertexType ( ) const
inline

Definition at line 85 of file VertexView.h.

85{ return m_vtable->vertexType(m_ptr); }

◆ vertexType_impl()

template<typename T>
int VertexView::vertexType_impl ( const void * p)
inlinestaticprivate

Definition at line 142 of file VertexView.h.

static int vertexType(const T &)

◆ x()

float VertexView::x ( ) const
inline

Definition at line 71 of file VertexView.h.

71{ return m_vtable->x(m_ptr); }

◆ x_impl()

template<typename T>
float VertexView::x_impl ( const void * p)
inlinestaticprivate

Definition at line 128 of file VertexView.h.

128{ return VertexTraits<T>::x(deref<T>(p)); }
static float x(const T &v)

◆ y()

float VertexView::y ( ) const
inline

Definition at line 72 of file VertexView.h.

72{ return m_vtable->y(m_ptr); }

◆ y_impl()

template<typename T>
float VertexView::y_impl ( const void * p)
inlinestaticprivate

Definition at line 129 of file VertexView.h.

129{ return VertexTraits<T>::y(deref<T>(p)); }
static float y(const T &v)

◆ z()

float VertexView::z ( ) const
inline

Definition at line 73 of file VertexView.h.

73{ return m_vtable->z(m_ptr); }

◆ z_impl()

template<typename T>
float VertexView::z_impl ( const void * p)
inlinestaticprivate

Definition at line 130 of file VertexView.h.

130{ return VertexTraits<T>::z(deref<T>(p)); }
static float z(const T &v)

Member Data Documentation

◆ m_ptr

const void* VertexView::m_ptr
private

Definition at line 98 of file VertexView.h.

◆ m_vtable

const VTable* VertexView::m_vtable
private

Definition at line 99 of file VertexView.h.

◆ table

template<typename T>
const VertexView::VTable VertexView::table
inlinestaticprivate
Initial value:
= {
&typeid(T)
}
static float numberDoF_impl(const void *p)
Definition VertexView.h:138
static int vertexType_impl(const void *p)
Definition VertexView.h:142
static size_t nTrackParticles_impl(const void *p)
Definition VertexView.h:136
static float z_impl(const void *p)
Definition VertexView.h:130
static float chiSquared_impl(const void *p)
Definition VertexView.h:137
static float x_impl(const void *p)
Definition VertexView.h:128
static float dz_impl(const void *p)
Definition VertexView.h:134
static float y_impl(const void *p)
Definition VertexView.h:129
static float dx_impl(const void *p)
Definition VertexView.h:132
static float time_impl(const void *p)
Definition VertexView.h:140
static float dy_impl(const void *p)
Definition VertexView.h:133

Definition at line 148 of file VertexView.h.


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