9#ifndef TRKDETDESCRUTILS_BINNEDARRAY1D1D_H
10#define TRKDETDESCRUTILS_BINNEDARRAY1D1D_H
45 const std::vector<std::pair<std::shared_ptr<T>,
Amg::Vector3D>>& tclassvector,
47 const std::vector<BinUtility>& singleBinGen)
56 const std::vector<std::pair<std::shared_ptr<T>,
Amg::Vector3D>>& tclassvector,
58 std::vector<BinUtility>&& singleBinGen)
96 return (
m_array[steerBin][singleBin]).get();
106 return (
m_array[steerBin][singleBin]).get();
115 return (
m_array[steerBin][singleBin]).get();
148 std::unique_ptr<std::vector<T*>>
arrayObjects = std::make_unique<std::vector<T*>>();
150 for (
size_t isingle = 0;
163 m_array[i] = std::vector<std::shared_ptr<T>>(sizeOfSubBin);
166 int vecsize(tclassvector.size());
167 for (
int ivec = 0; ivec < vecsize; ++ivec) {
168 const Amg::Vector3D currentGlobal((tclassvector[ivec]).second);
172 std::vector<std::shared_ptr<T>>& curVec =
m_array[steeringBin];
173 curVec[singleBin] = ((tclassvector)[ivec]).first;
175 throw GaudiException(
"BinnedArray1D1D",
"Object outside bounds",
176 StatusCode::FAILURE);
182 std::vector<std::vector<std::shared_ptr<T>>>
m_array{};
Cached unique_ptr with atomic update.
A generic symmetric BinUtility, for fully symmetric binning in terms of binning grid and binning type...
unsigned int arrayObjectsNumber() const
Number of Entries in the Array.
std::vector< BinUtility > m_singleBinUtilities
single bin utilities
BinnedArray1D1D(const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector, BinUtility &&steeringBinGen1D, std::vector< BinUtility > &&singleBinGen)
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
std::span< T const *const > arrayObjects() const
Return all objects of the Array const T.
~BinnedArray1D1D()=default
T * entryObject(const Amg::Vector3D &gp) const
Returns the pointer to the templated class object from the BinnedArray - entry point.
std::span< T *const > arrayObjects()
Return all objects of the Array non-const T.
T * nextObject(const Amg::Vector3D &, const Amg::Vector3D &, bool) const
Returns the pointer to the templated class object from the BinnedArray.
BinnedArray1D1D & operator=(BinnedArray1D1D &&)=default
void initialize(const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector)
vector of pointers to the class T
T * object(const Amg::Vector3D &gp) const
Returns the pointer to the templated class object from the BinnedArray, it returns 0 if not defined.
BinnedArray1D1D * clone() const
Implicit Constructor.
BinUtility m_steeringBinUtility
const BinUtility * binUtility() const
Return the BinUtility - returns the steering binUtility in this case.
T * object(const Amg::Vector2D &lp) const
Returns the pointer to the templated class object from the BinnedArray, it returns 0 if not defined.
void createArrayCache() const
BinnedArray1D1D(const BinnedArray1D1D &barr)
Copy Constructor.
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(BinnedArray1D1D &&)=default
BinnedArray1D1D()=default
BinnedArray1D1D & operator=(const BinnedArray1D1D &barr)
Assignment operator.
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
CachedUniquePtrT< const T > CachedUniquePtr
Ensure that the ATLAS eigen extensions are properly loaded.