|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #ifndef TRKDETDESCRUTILS_BINNEDARRAY2D_H
10 #define TRKDETDESCRUTILS_BINNEDARRAY2D_H
12 #include "GaudiKernel/GaudiException.h"
59 m_array = std::vector<std::vector<SharedObject<T>>>(bingen->bins(1));
60 for (
size_t i = 0;
i < bingen->bins(1); ++
i) {
61 m_array[
i] = std::vector<SharedObject<T>>(bingen->bins(0));
64 size_t vecsize = tclassvector.size();
67 if (bingen->inside(currentGlobal)) {
68 std::vector<SharedObject<T>>& curVec =
69 m_array[bingen->bin(currentGlobal, 1)];
71 curVec[bingen->bin(currentGlobal, 0)] = ((tclassvector)[
ivec]).first;
74 "BinnedArray2D",
"Object outside bounds", StatusCode::FAILURE);
89 m_array = std::vector<std::vector<SharedObject<T>>>(barr.m_array.size());
90 for (
size_t ihl = 0; ihl < barr.m_array.size(); ++ihl) {
91 m_array[ihl] = std::vector<SharedObject<T>>((barr.m_array[0]).
size());
92 for (
size_t ill = 0; ill < (barr.m_array[0]).
size(); ++ill) {
93 m_array[ihl][ill] = (barr.m_array)[ihl][ill];
106 m_array = std::vector<std::vector<SharedObject<T>>>(barr.
m_array.size());
107 for (
size_t ihl = 0; ihl < barr.
m_array.size(); ++ihl) {
109 for (
size_t ill = 0; ill < ((barr.
m_array)[0]).size(); ++ill) {
158 bool associatedResult =
true)
const
161 if (associatedResult)
166 return (nextFirst > 0 && nextSecond > 0)
200 std::make_unique<std::vector<T*>>();
214 std::vector<std::vector<SharedObject<T>>>
m_array;
223 #endif // TRKSURFACES_BINNEDARRAY2D_H
size_t entry(const Amg::Vector3D &position, size_t ba=0) const
Bin from a 3D vector (already in binning frame)
BinnedArray2D & operator=(const BinnedArray2D &barr)
Assignment operator.
unsigned int arrayObjectsNumber() const
Number of Entries in the Array.
T * object(const Amg::Vector2D &lp) const
Returns the pointer to the templated class object from the BinnedArray, it returns 0 if not defined;.
Eigen::Matrix< double, 2, 1 > Vector2D
const BinUtility * binUtility() const
Return the BinUtility.
BinnedArraySpan< T const *const > arrayObjects() const
Return all objects of the Array const T.
T * entryObject(const Amg::Vector3D &pos) const
Returns the pointer to the templated class object from the BinnedArray -entry point.
Cached pointer with atomic update.
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.
BinnedArray2D(const BinnedArray2D &barr)
Copy Constructor - copies only pointers !
BinnedArraySpan< T *const > arrayObjects()
Return all objects of the Array non-const T.
BinnedArray2D(const std::vector< std::pair< SharedObject< T >, Amg::Vector3D >> &tclassvector, BinUtility *bingen)
Constructor with std::vector and a BinUtility.
size_t bins(size_t ba=0) const
Number of bins.
BinnedArray2D()
Default Constructor - needed for inherited classes.
CxxUtils::CachedUniquePtr< std::vector< T * > > m_arrayObjects
binUtility for retrieving and filling the Array
BinUtility * m_binUtility
Ensure that the ATLAS eigen extensions are properly loaded.
bool inside(const Amg::Vector3D &position) const
Check if bin is inside from Vector3D.
void createArrayCache() const
vector of pointers to the class T
~BinnedArray2D()
Virtual Destructor.
Eigen::Matrix< double, 3, 1 > Vector3D
std::shared_ptr< T > SharedObject
BinUtility * clone() const
Implizit Constructor.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
T * object(const Amg::Vector3D &gp) const
Returns the pointer to the templated class object from the BinnedArray it returns 0 if not defined;.
BinnedArray2D * clone() const
Implizit Constructor.
size_t bin(const Amg::Vector3D &position, size_t ba=0) const
Bin from a 3D vector (already in binning frame)
vec_fb< typename boost::int_t< sizeof(T) *8 >::exact, N > ivec
std::span< T > BinnedArraySpan
std::vector< std::vector< SharedObject< T > > > m_array
forced 1D vector of pointers to class T
size_t next(const Amg::Vector3D &position, const Amg::Vector3D &direction, size_t ba=0) const
Bin from a 3D vector (already in binning frame)