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

2D dimensional binned array, where the binning grid is not symmetric. More...

#include <BinnedArray1D1D.h>

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

Public Member Functions

 BinnedArray1D1D ()=default
 BinnedArray1D1D (BinnedArray1D1D &&)=default
BinnedArray1D1Doperator= (BinnedArray1D1D &&)=default
 ~BinnedArray1D1D ()=default
 BinnedArray1D1D (const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector, const BinUtility &steeringBinGen1D, const std::vector< BinUtility > &singleBinGen)
 ctors with arguments
 BinnedArray1D1D (const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector, BinUtility &&steeringBinGen1D, std::vector< BinUtility > &&singleBinGen)
 BinnedArray1D1D (const BinnedArray1D1D &barr)
 Copy Constructor.
BinnedArray1D1Doperator= (const BinnedArray1D1D &barr)
 Assignment operator.
BinnedArray1D1Dclone () const
 Implicit Constructor.
T * object (const Amg::Vector2D &lp) const
 Returns the pointer to the templated class object from the BinnedArray, it returns 0 if not defined.
T * object (const Amg::Vector3D &gp) const
 Returns the pointer to the templated class object from the BinnedArray, it returns 0 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 &, const Amg::Vector3D &, bool) 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 BinUtilitybinUtility () const
 Return the BinUtility - returns the steering binUtility in this case.

Private Member Functions

void createArrayCache () const
void initialize (const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector)
 vector of pointers to the class T

Private Attributes

std::vector< std::vector< std::shared_ptr< T > > > m_array {}
 forced 1D vector of pointers to class T
CxxUtils::CachedUniquePtr< std::vector< T * > > m_arrayObjects {nullptr}
 binUtility for retrieving and filling the Array
BinUtility m_steeringBinUtility {}
std::vector< BinUtilitym_singleBinUtilities {}
 single bin utilities

Detailed Description

template<class T>
class Trk::BinnedArray1D1D< T >

2D dimensional binned array, where the binning grid is not symmetric.

One steering bin utility finds the associated array of the other.

Author
Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch
Christos Anastopoulos (Athena MT modifications)

Definition at line 33 of file BinnedArray1D1D.h.

Constructor & Destructor Documentation

◆ BinnedArray1D1D() [1/5]

template<class T>
Trk::BinnedArray1D1D< T >::BinnedArray1D1D ( )
default

◆ BinnedArray1D1D() [2/5]

template<class T>
Trk::BinnedArray1D1D< T >::BinnedArray1D1D ( BinnedArray1D1D< T > && )
default

◆ ~BinnedArray1D1D()

template<class T>
Trk::BinnedArray1D1D< T >::~BinnedArray1D1D ( )
default

◆ BinnedArray1D1D() [3/5]

template<class T>
Trk::BinnedArray1D1D< T >::BinnedArray1D1D ( const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > & tclassvector,
const BinUtility & steeringBinGen1D,
const std::vector< BinUtility > & singleBinGen )
inline

ctors with arguments

Constructor with std::vector and a BinUtility

Definition at line 44 of file BinnedArray1D1D.h.

49 m_array{},
50 m_arrayObjects(nullptr),
54 }
2D dimensional binned array, where the binning grid is not symmetric.
std::vector< BinUtility > m_singleBinUtilities
single bin utilities
CxxUtils::CachedUniquePtr< std::vector< T * > > m_arrayObjects
binUtility for retrieving and filling the Array
std::vector< std::vector< std::shared_ptr< T > > > m_array
forced 1D vector of pointers to class T
BinUtility m_steeringBinUtility
BinnedArray()=default
void initialize()

◆ BinnedArray1D1D() [4/5]

template<class T>
Trk::BinnedArray1D1D< T >::BinnedArray1D1D ( const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > & tclassvector,
BinUtility && steeringBinGen1D,
std::vector< BinUtility > && singleBinGen )
inline

◆ BinnedArray1D1D() [5/5]

template<class T>
Trk::BinnedArray1D1D< T >::BinnedArray1D1D ( const BinnedArray1D1D< T > & barr)
inline

Member Function Documentation

◆ arrayObjects() [1/2]

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

Return all objects of the Array non-const T.

Implements Trk::BinnedArray< T >.

Definition at line 125 of file BinnedArray1D1D.h.

126 {
128 return std::span<T* const>(m_arrayObjects->begin(), m_arrayObjects->end());
129 }
void createArrayCache() const

◆ arrayObjects() [2/2]

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

Return all objects of the Array const T.

Implements Trk::BinnedArray< T >.

Definition at line 132 of file BinnedArray1D1D.h.

133 {
136 }

◆ arrayObjectsNumber()

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

Number of Entries in the Array.

Implements Trk::BinnedArray< T >.

Definition at line 139 of file BinnedArray1D1D.h.

139{ return arrayObjects().size(); }
std::span< T *const > arrayObjects()
Return all objects of the Array non-const T.

◆ binUtility()

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

Return the BinUtility - returns the steering binUtility in this case.

Implements Trk::BinnedArray< T >.

Definition at line 142 of file BinnedArray1D1D.h.

142{ return &m_steeringBinUtility; }

◆ clone()

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

Implicit Constructor.

Implements Trk::BinnedArray< T >.

Definition at line 87 of file BinnedArray1D1D.h.

87{ return new BinnedArray1D1D(*this); }
BinnedArray1D1D()=default

◆ createArrayCache()

template<class T>
void Trk::BinnedArray1D1D< T >::createArrayCache ( ) const
inlineprivate

Definition at line 145 of file BinnedArray1D1D.h.

146 {
147 if (!m_arrayObjects) {
149 for (size_t isteer = 0; isteer < m_steeringBinUtility.bins(); ++isteer) {
150 for (size_t isingle = 0;
152 arrayObjects->push_back((m_array[isteer][isingle]).get());
153 }
154 }
156 }
157 }
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130

◆ entryObject()

template<class T>
T * Trk::BinnedArray1D1D< 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 111 of file BinnedArray1D1D.h.

112 {
113 int steerBin = m_steeringBinUtility.entry(gp, 0);
115 return (m_array[steerBin][singleBin]).get();
116 }

◆ initialize()

template<class T>
void Trk::BinnedArray1D1D< T >::initialize ( const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > & tclassvector)
inlineprivate

vector of pointers to the class T

Definition at line 159 of file BinnedArray1D1D.h.

◆ nextObject()

template<class T>
T * Trk::BinnedArray1D1D< T >::nextObject ( const Amg::Vector3D & ,
const Amg::Vector3D & ,
bool  ) const
inlinevirtual

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

Implements Trk::BinnedArray< T >.

Definition at line 119 of file BinnedArray1D1D.h.

120 {
121 return nullptr;
122 }

◆ object() [1/2]

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

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

Implements Trk::BinnedArray< T >.

Definition at line 92 of file BinnedArray1D1D.h.

93 {
94 int steerBin = m_steeringBinUtility.bin(lp, 0);
96 return (m_array[steerBin][singleBin]).get();
97 }

◆ object() [2/2]

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

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

Implements Trk::BinnedArray< T >.

Definition at line 102 of file BinnedArray1D1D.h.

103 {
104 int steerBin = m_steeringBinUtility.bin(gp, 0);
106 return (m_array[steerBin][singleBin]).get();
107 }

◆ operator=() [1/2]

template<class T>
BinnedArray1D1D & Trk::BinnedArray1D1D< T >::operator= ( BinnedArray1D1D< T > && )
default

◆ operator=() [2/2]

template<class T>
BinnedArray1D1D & Trk::BinnedArray1D1D< T >::operator= ( const BinnedArray1D1D< T > & barr)
inline

Assignment operator.

Definition at line 76 of file BinnedArray1D1D.h.

76 {
77 if (this != &barr) {
78 m_arrayObjects.release();
82 }
83 return *this;
84 }

Member Data Documentation

◆ m_array

template<class T>
std::vector<std::vector<std::shared_ptr<T> > > Trk::BinnedArray1D1D< T >::m_array {}
private

forced 1D vector of pointers to class T

Definition at line 182 of file BinnedArray1D1D.h.

182{};

◆ m_arrayObjects

template<class T>
CxxUtils::CachedUniquePtr<std::vector<T*> > Trk::BinnedArray1D1D< T >::m_arrayObjects {nullptr}
private

binUtility for retrieving and filling the Array

Definition at line 184 of file BinnedArray1D1D.h.

184{nullptr};

◆ m_singleBinUtilities

template<class T>
std::vector<BinUtility> Trk::BinnedArray1D1D< T >::m_singleBinUtilities {}
private

single bin utilities

Definition at line 187 of file BinnedArray1D1D.h.

187{};

◆ m_steeringBinUtility

template<class T>
BinUtility Trk::BinnedArray1D1D< T >::m_steeringBinUtility {}
private

Definition at line 186 of file BinnedArray1D1D.h.

186{};

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