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

#include <BinnedArrayArray2D.h>

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

Public Member Functions

 BinnedArrayArray2D (std::vector< std::pair< BinnedArray2D< T >, Amg::Vector3D > > &&tbas, const BinUtility &bUtility)
virtual BinnedArrayArray2Dclone () const override
 Implicit constructor.
virtual T * object (const Amg::Vector2D &lp) const override
 Returns the pointer to the templated class object from the BinnedArrayArray2D.
virtual T * object (const Amg::Vector3D &gp) const override
 Returns the pointer to the templated class object from the BinnedArrayArray2D it returns nullptr if not defined, takes global position.
virtual T * entryObject (const Amg::Vector3D &gp) const override
 Returns the pointer to the templated class object from the BinnedArrayArray2D - entry point.
virtual T * nextObject (const Amg::Vector3D &gp, const Amg::Vector3D &, bool) const override
 Returns the pointer to the templated class object from the BinnedArrayArray2D, takes 3D position & direction.
virtual std::span< T *const > arrayObjects () override final
 Return all objects of the Array non-const T.
virtual std::span< T const *const > arrayObjects () const override final
 Return all objects of the Array const T.
virtual unsigned int arrayObjectsNumber () const override final
 Number of Entries in the Array.
virtual const BinUtilitybinUtility () const override
 Return the BinUtility.

Private Member Functions

void buildCache ()

Private Attributes

BinUtility m_binUtility {}
std::vector< BinnedArray2D< T > > m_binnedArrays {}
std::vector< T * > m_arrayObjects {}

Detailed Description

template<class T>
class Trk::BinnedArrayArray2D< T >

Definition at line 30 of file BinnedArrayArray2D.h.

Constructor & Destructor Documentation

◆ BinnedArrayArray2D()

template<class T>
Trk::BinnedArrayArray2D< T >::BinnedArrayArray2D ( std::vector< std::pair< BinnedArray2D< T >, Amg::Vector3D > > && tbas,
const BinUtility & bUtility )
inline

Definition at line 35 of file BinnedArrayArray2D.h.

38 m_binnedArrays(bUtility.bins(0)),
40 // looping over the contained binned arrays so as to flatten
41 for (auto& barray : tbas) {
42 // flat ordered binned array
43 auto index = m_binUtility.bin(barray.second, 0);
45 }
46 buildCache();
47 }
std::vector< T * > m_arrayObjects
std::vector< BinnedArray2D< T > > m_binnedArrays

Member Function Documentation

◆ arrayObjects() [1/2]

template<class T>
virtual std::span< T const *const > Trk::BinnedArrayArray2D< T >::arrayObjects ( ) const
inlinefinaloverridevirtual

Return all objects of the Array const T.

Implements Trk::BinnedArray< T >.

Definition at line 100 of file BinnedArrayArray2D.h.

101 {
103 }

◆ arrayObjects() [2/2]

template<class T>
virtual std::span< T *const > Trk::BinnedArrayArray2D< T >::arrayObjects ( )
inlinefinaloverridevirtual

Return all objects of the Array non-const T.

Implements Trk::BinnedArray< T >.

Definition at line 94 of file BinnedArrayArray2D.h.

95 {
97 }

◆ arrayObjectsNumber()

template<class T>
virtual unsigned int Trk::BinnedArrayArray2D< T >::arrayObjectsNumber ( ) const
inlinefinaloverridevirtual

Number of Entries in the Array.

Implements Trk::BinnedArray< T >.

Definition at line 106 of file BinnedArrayArray2D.h.

107 {
108 return m_arrayObjects.size();
109 };

◆ binUtility()

template<class T>
virtual const BinUtility * Trk::BinnedArrayArray2D< T >::binUtility ( ) const
inlineoverridevirtual

Return the BinUtility.

Implements Trk::BinnedArray< T >.

Definition at line 112 of file BinnedArrayArray2D.h.

112{ return &m_binUtility; }

◆ buildCache()

template<class T>
void Trk::BinnedArrayArray2D< T >::buildCache ( )
inlineprivate

Definition at line 116 of file BinnedArrayArray2D.h.

116 {
117 // flattened array object
118 size_t numArrrays = m_binnedArrays.size();
119 //reserve num of Bin Arrays times num of Bins
120 m_arrayObjects.reserve(numArrrays * m_binUtility.bins(0));
121 for (size_t index = 0; index <numArrrays; ++index) {
123 for (auto& o : aObjects) {
124 m_arrayObjects.push_back(o);
125 }
126 }
127 }

◆ clone()

template<class T>
virtual BinnedArrayArray2D * Trk::BinnedArrayArray2D< T >::clone ( ) const
inlineoverridevirtual

Implicit constructor.

Implements Trk::BinnedArray< T >.

Definition at line 50 of file BinnedArrayArray2D.h.

51 {
52 return new BinnedArrayArray2D(*this);
53 }
BinnedArrayArray2D(std::vector< std::pair< BinnedArray2D< T >, Amg::Vector3D > > &&tbas, const BinUtility &bUtility)

◆ entryObject()

template<class T>
virtual T * Trk::BinnedArrayArray2D< T >::entryObject ( const Amg::Vector3D & gp) const
inlineoverridevirtual

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

Implements Trk::BinnedArray< T >.

Definition at line 79 of file BinnedArrayArray2D.h.

80 {
81 return object(gp);
82 }
virtual T * object(const Amg::Vector2D &lp) const override
Returns the pointer to the templated class object from the BinnedArrayArray2D.

◆ nextObject()

template<class T>
virtual T * Trk::BinnedArrayArray2D< T >::nextObject ( const Amg::Vector3D & gp,
const Amg::Vector3D & ,
bool  ) const
inlineoverridevirtual

Returns the pointer to the templated class object from the BinnedArrayArray2D, takes 3D position & direction.

Implements Trk::BinnedArray< T >.

Definition at line 86 of file BinnedArrayArray2D.h.

89 {
90 return object(gp);
91 }

◆ object() [1/2]

template<class T>
virtual T * Trk::BinnedArrayArray2D< T >::object ( const Amg::Vector2D & lp) const
inlineoverridevirtual

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

It returns nullptr if not defined, takes local position

Implements Trk::BinnedArray< T >.

Definition at line 58 of file BinnedArrayArray2D.h.

58 {
59 if (m_binUtility.inside(lp)) {
61 return ba.object(lp);
62 }
63 return nullptr;
64 }

◆ object() [2/2]

template<class T>
virtual T * Trk::BinnedArrayArray2D< T >::object ( const Amg::Vector3D & gp) const
inlineoverridevirtual

Returns the pointer to the templated class object from the BinnedArrayArray2D it returns nullptr if not defined, takes global position.

Implements Trk::BinnedArray< T >.

Definition at line 68 of file BinnedArrayArray2D.h.

69 {
70 if (m_binUtility.inside(gp)) {
72 return ba.object(gp);
73 }
74 return nullptr;
75 }

Member Data Documentation

◆ m_arrayObjects

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

Definition at line 133 of file BinnedArrayArray2D.h.

133{};

◆ m_binnedArrays

template<class T>
std::vector<BinnedArray2D<T> > Trk::BinnedArrayArray2D< T >::m_binnedArrays {}
private

Definition at line 130 of file BinnedArrayArray2D.h.

130{};

◆ m_binUtility

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

Definition at line 129 of file BinnedArrayArray2D.h.

129{};

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