9#ifndef TRKDETDESCRUTILS_BINNEDARRAY1D1D1D_H
10#define TRKDETDESCRUTILS_BINNEDARRAY1D1D1D_H
47 const std::vector<std::pair<std::shared_ptr<T>,
Amg::Vector3D>>& tclassvector,
49 const std::vector<std::vector<BinUtility>>& binUtilVec)
59 const std::vector<std::pair<std::shared_ptr<T>,
Amg::Vector3D>>& tclassvector,
62 std::vector<std::vector<BinUtility>>&& binUtilVec)
174 std::unique_ptr<std::vector<T*>>
arrayObjects = std::make_unique<std::vector<T*>>();
175 for (
size_t ibin1 = 0; ibin1 <
m_binUtil1.bins(); ++ibin1) {
176 for (
size_t ibin2 = 0; ibin2 <
m_binUtil2.bins(); ++ibin2) {
177 for (
size_t ibin3 = 0; ibin3 < std::as_const(
m_binUtilArray)[ibin1][ibin2].bins(); ++ibin3) {
189 m_array = std::vector<std::vector<std::vector<std::shared_ptr<T>>>>(v1Size);
190 for (
int i = 0; i < v1Size; ++i) {
191 m_array[i] = std::vector<std::vector<std::shared_ptr<T>>>(v2Size);
192 for (
int j = 0; j < v2Size; ++j) {
197 int vecsize(tclassvector.size());
198 for (
int ivec = 0; ivec < vecsize; ++ivec) {
204 std::vector<std::vector<std::shared_ptr<T>>>& currArr =
m_array[bin1];
205 std::vector<std::shared_ptr<T>>& curVec = currArr[
bin2];
206 curVec[
bin3] = (tclassvector[ivec]).first;
208 throw GaudiException(
"BinnedArray1D1D1D",
"Object outside bounds",
209 StatusCode::FAILURE);
214 std::vector<std::vector<std::vector<std::shared_ptr<T>>>>
m_array{};
Cached unique_ptr with atomic update.
static const std::vector< std::string > bins
A generic symmetric BinUtility, for fully symmetric binning in terms of binning grid and binning type...
BinnedArray1D1D1D(const BinnedArray1D1D1D &barr)
Copy.
unsigned int arrayObjectsNumber() const
Number of Entries in the Array.
T * nextObject(const Amg::Vector3D &, const Amg::Vector3D &, bool) const
Returns the pointer to the templated class object from the BinnedArray dummy for multidimensional arr...
BinnedArray1D1D1D & operator=(const BinnedArray1D1D1D &barr)
Assignment operator.
BinnedArray1D1D1D()=default
BinnedArray1D1D1D(const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector, const BinUtility &binUtil1, const BinUtility &binUtil2, const std::vector< std::vector< BinUtility > > &binUtilVec)
ctors
const BinUtility * binUtility() const
Return the BinUtility - returns the first binUtility in this case.
void initialize(const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector)
vector of pointers to the class T
~BinnedArray1D1D1D()=default
T * object(const Amg::Vector2D &lp) const
Returns the pointer to the templated class object from the BinnedArray, it returns nullptr if not def...
void createArrayCache() const
std::span< T const *const > arrayObjects() const
Return all objects of the Array const T.
BinUtility m_binUtil2
binUtility for retrieving and filling the Array
std::span< T *const > arrayObjects()
Return all objects of the Array const T.
std::vector< std::vector< std::vector< std::shared_ptr< T > > > > m_array
1D cache of non owning pointers to class T
BinnedArray1D1D1D(BinnedArray1D1D1D &&)=default
T * object(const Amg::Vector3D &gp) const
Returns the pointer to the templated class object from the BinnedArray, it returns nullptr if not def...
BinnedArray1D1D1D & operator=(BinnedArray1D1D1D &&)=default
CxxUtils::CachedUniquePtr< std::vector< T * > > m_arrayObjects
BinnedArray1D1D1D * clone() const
Implicit Constructor.
BinUtility m_binUtil1
binUtility for retrieving and filling the Array
BinnedArray1D1D1D(const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector, BinUtility &&binUtil1, BinUtility &&binUtil2, std::vector< std::vector< BinUtility > > &&binUtilVec)
T * entryObject(const Amg::Vector3D &gp) const
Returns the pointer to the templated class object from the BinnedArray - entry point.
std::vector< std::vector< BinUtility > > m_binUtilArray
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.