ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::CompactBinnedArray1D< T > Class Template Referencefinal

1-dimensional binned arry based on a sorting given by the BinUtitlity. More...

#include <CompactBinnedArray1D.h>

Inheritance diagram for Trk::CompactBinnedArray1D< T >:
Collaboration diagram for Trk::CompactBinnedArray1D< T >:

Public Member Functions

 CompactBinnedArray1D (const std::vector< T * > &tclassvector, const std::vector< size_t > &indexvector, const BinUtility &bingen)
 Constructor with arguents.
 CompactBinnedArray1D (const std::vector< T * > &tclassvector, std::vector< size_t > &&indexvector, BinUtility &&bingen)
CompactBinnedArray1D * clone () const
 Implicit Constructor.
CompactBinnedArray1D * clone (const std::vector< T * > &ptrs) const
T * object (const Amg::Vector2D &lp) const
 Returns the pointer to the templated class object from the BinnedArray, it returns nullptr if not defined;.
T * object (const Amg::Vector3D &gp) const
 Returns the pointer to the templated class object from the BinnedArray it returns nullptr if not defined;.
T * entryObject (const Amg::Vector3D &gp) const
 Returns the pointer to the templated class object from the BinnedArray - entry point.
T * nextObject (const Amg::Vector3D &gp, const Amg::Vector3D &mom, bool associatedResult=true) const
 Returns the pointer to the templated class object from the BinnedArray.
std::span< T *const > arrayObjects ()
 Return all objects of the Array non const T.
std::span< T const *const > arrayObjects () const
 Return all objects of the Array const T.
unsigned int arrayObjectsNumber () const
 Number of Entries in the Array.
const BinUtility * binUtility () const
 Return the BinUtility.
const BinUtility * layerBinUtility (const Amg::Vector3D &) const
 Return the BinUtility.
size_t layerBin (const Amg::Vector3D &pos) const
 Return the layer bin.

Private Attributes

std::vector< size_t > m_array {}
 vector of indices to objects
std::vector< T * > m_arrayObjects {}
 not owning pointers to objects
BinUtility m_binUtility {}
 binUtility

Detailed Description

template<class T>
class Trk::CompactBinnedArray1D< T >

1-dimensional binned arry based on a sorting given by the BinUtitlity.

Author
sarka.nosp@m..tod.nosp@m.orova.nosp@m.@cer.nosp@m.n.ch
Christos Anastopoulos (Athena MT modifications)

Definition at line 32 of file CompactBinnedArray1D.h.

Constructor & Destructor Documentation

◆ CompactBinnedArray1D() [1/2]

template<class T>
Trk::CompactBinnedArray1D< T >::CompactBinnedArray1D ( const std::vector< T * > & tclassvector,
const std::vector< size_t > & indexvector,
const BinUtility & bingen )
inline

Constructor with arguents.

Note that we do not take ownership of pointersy

Definition at line 40 of file CompactBinnedArray1D.h.

1-dimensional binned arry based on a sorting given by the BinUtitlity.
BinUtility m_binUtility
binUtility
std::vector< T * > m_arrayObjects
not owning pointers to objects
std::vector< size_t > m_array
vector of indices to objects

◆ CompactBinnedArray1D() [2/2]

template<class T>
Trk::CompactBinnedArray1D< T >::CompactBinnedArray1D ( const std::vector< T * > & tclassvector,
std::vector< size_t > && indexvector,
BinUtility && bingen )
inline

Member Function Documentation

◆ arrayObjects() [1/2]

template<class T>
std::span< T *const > Trk::CompactBinnedArray1D< T >::arrayObjects ( )
inlinevirtual

Return all objects of the Array non const T.

Implements Trk::BinnedArray< T >.

Definition at line 107 of file CompactBinnedArray1D.h.

108 {
110 }

◆ arrayObjects() [2/2]

template<class T>
std::span< T const *const > Trk::CompactBinnedArray1D< T >::arrayObjects ( ) const
inlinevirtual

Return all objects of the Array const T.

Implements Trk::BinnedArray< T >.

Definition at line 113 of file CompactBinnedArray1D.h.

114 {
116 }

◆ arrayObjectsNumber()

template<class T>
unsigned int Trk::CompactBinnedArray1D< T >::arrayObjectsNumber ( ) const
inlinevirtual

Number of Entries in the Array.

Implements Trk::BinnedArray< T >.

Definition at line 119 of file CompactBinnedArray1D.h.

119{ return m_arrayObjects.size(); }

◆ binUtility()

template<class T>
const BinUtility * Trk::CompactBinnedArray1D< T >::binUtility ( ) const
inlinevirtual

Return the BinUtility.

Implements Trk::BinnedArray< T >.

Definition at line 122 of file CompactBinnedArray1D.h.

122{ return &m_binUtility; }

◆ clone() [1/2]

template<class T>
CompactBinnedArray1D * Trk::CompactBinnedArray1D< T >::clone ( ) const
inlinevirtual

Implicit Constructor.

Implements Trk::CompactBinnedArray< T >.

Definition at line 57 of file CompactBinnedArray1D.h.

58 {
60 }
CompactBinnedArray1D(const std::vector< T * > &tclassvector, const std::vector< size_t > &indexvector, const BinUtility &bingen)
Constructor with arguents.

◆ clone() [2/2]

template<class T>
CompactBinnedArray1D * Trk::CompactBinnedArray1D< T >::clone ( const std::vector< T * > & ptrs) const
inlinevirtual

Implements Trk::CompactBinnedArray< T >.

Definition at line 62 of file CompactBinnedArray1D.h.

63 {
64 assert(ptrs.size() == m_arrayObjects.size());
66 }

◆ entryObject()

template<class T>
T * Trk::CompactBinnedArray1D< T >::entryObject ( const Amg::Vector3D & gp) const
inlinevirtual

Returns the pointer to the templated class object from the BinnedArray - entry point.

Implements Trk::BinnedArray< T >.

Definition at line 89 of file CompactBinnedArray1D.h.

90 {
91 return (m_arrayObjects[m_array[m_binUtility.entry(gp, 0)]]);
92 }

◆ layerBin()

template<class T>
size_t Trk::CompactBinnedArray1D< T >::layerBin ( const Amg::Vector3D & pos) const
inlinevirtual

Return the layer bin.

Implements Trk::CompactBinnedArray< T >.

Definition at line 131 of file CompactBinnedArray1D.h.

132 {
133 return m_binUtility.bin(pos);
134 }

◆ layerBinUtility()

template<class T>
const BinUtility * Trk::CompactBinnedArray1D< T >::layerBinUtility ( const Amg::Vector3D & ) const
inlinevirtual

Return the BinUtility.

Implements Trk::CompactBinnedArray< T >.

Definition at line 125 of file CompactBinnedArray1D.h.

126 {
127 return &m_binUtility;
128 }

◆ nextObject()

template<class T>
T * Trk::CompactBinnedArray1D< T >::nextObject ( const Amg::Vector3D & gp,
const Amg::Vector3D & mom,
bool associatedResult = true ) const
inlinevirtual

Returns the pointer to the templated class object from the BinnedArray.

Implements Trk::BinnedArray< T >.

Definition at line 96 of file CompactBinnedArray1D.h.

99 {
100 // the bins
101 size_t bin = associatedResult ? m_binUtility.bin(gp, 0)
102 : m_binUtility.next(gp, mom, 0);
103 return m_arrayObjects[m_array[bin]];
104 }

◆ object() [1/2]

template<class T>
T * Trk::CompactBinnedArray1D< T >::object ( const Amg::Vector2D & lp) const
inlinevirtual

Returns the pointer to the templated class object from the BinnedArray, it returns nullptr if not defined;.

Implements Trk::BinnedArray< T >.

Definition at line 71 of file CompactBinnedArray1D.h.

72 {
73 if (m_binUtility.inside(lp)){
74 return m_arrayObjects[m_array[m_binUtility.bin(lp, 0)]];
75 }
76 return nullptr;
77 }

◆ object() [2/2]

template<class T>
T * Trk::CompactBinnedArray1D< T >::object ( const Amg::Vector3D & gp) const
inlinevirtual

Returns the pointer to the templated class object from the BinnedArray it returns nullptr if not defined;.

Implements Trk::BinnedArray< T >.

Definition at line 82 of file CompactBinnedArray1D.h.

83 {
84 return m_arrayObjects[m_array[m_binUtility.bin(gp, 0)]];
85 }

Member Data Documentation

◆ m_array

template<class T>
std::vector<size_t> Trk::CompactBinnedArray1D< T >::m_array {}
private

vector of indices to objects

Definition at line 137 of file CompactBinnedArray1D.h.

137{};

◆ m_arrayObjects

template<class T>
std::vector<T*> Trk::CompactBinnedArray1D< T >::m_arrayObjects {}
private

not owning pointers to objects

Definition at line 138 of file CompactBinnedArray1D.h.

138{};

◆ m_binUtility

template<class T>
BinUtility Trk::CompactBinnedArray1D< T >::m_binUtility {}
private

binUtility

Definition at line 139 of file CompactBinnedArray1D.h.

139{};

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