15#ifndef TRIGIDR4MONITORING_VERTEXVIEW_H
16#define TRIGIDR4MONITORING_VERTEXVIEW_H
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" );
59 typename=std::enable_if_t< !std::is_pointer_v<T> && !std::is_same_v<std::decay_t<T>,
VertexView> > >
89 template<
typename T>
bool is()
const {
return type()==
typeid(T); }
91 template<
typename T>
const T*
as()
const {
return is<T>() ?
static_cast<const T*
>(
m_ptr) : 0; }
104 float (*
x)(
const void*);
105 float (*
y)(
const void*);
106 float (*
z)(
const void*);
108 float (*
dx)(
const void*);
109 float (*
dy)(
const void*);
110 float (*
dz)(
const void*);
126 static const T&
deref(
const void* p) {
return *
static_cast<const T*
>(p); }
168 <<
"\tntracks= " << v.nTrackParticles()
169 <<
"\ttype=" << v.vertexType()
170 <<
"\t : ptr=" << v.ptr()
182 std::vector<VertexView> tv( v.begin(), v.end() );
190 std::vector<VertexView> tv( v.begin(), v.end() );
198 std::vector<VertexView> tv( v.begin(), v.end() );
205std::vector<VertexView>
makevertexview(
typename T::const_iterator ibegin,
typename T::const_iterator iend ) {
206 std::vector<VertexView> tv( ibegin, iend );
bool dummyVertex(const VertexView &v)
annoying that they always include this "dummy" vertex ...
std::ostream & operator<<(std::ostream &s, const VertexView &v)
std::vector< VertexView > makevertexview(const std::vector< const T * > &v)
Type-erased view on a generic vertex class - implementation won't bother with any VertexTraits at the...
static float numberDoF_impl(const void *p)
static int vertexType_impl(const void *p)
static size_t nTrackParticles_impl(const void *p)
static const T & deref(const void *p)
static float z_impl(const void *p)
static float chiSquared_impl(const void *p)
static float x_impl(const void *p)
VertexView(VertexView *)=delete
VertexView(const T *pobj)
static float dz_impl(const void *p)
VertexView(const VertexView &t)=default
size_t nTrackParticles() const
const std::type_info & type() const
static float y_impl(const void *p)
static float dx_impl(const void *p)
static float time_impl(const void *p)
static float dy_impl(const void *p)
static const VTable table
virtual ~VertexView()=default
VertexView(const VertexView *)=delete
DataModel_detail::iterator< DVL > remove_if(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end, Predicate pred)
Specialization of remove_if for DataVector/List.
float(* time)(const void *)
const std::type_info * m_type
size_t(* nTrackParticles)(const void *)
float(* dx)(const void *)
float(* chiSquared)(const void *)
float(* numberDoF)(const void *)
float(* dy)(const void *)
float(* dz)(const void *)
int(* vertexType)(const void *)