9#ifndef TRKDETDESCRUTILS_BINNEDARRAY1D_H
10#define TRKDETDESCRUTILS_BINNEDARRAY1D_H
45 const std::vector<std::pair<std::shared_ptr<T>,
Amg::Vector3D>>& tclassvector,
54 const std::vector<std::pair<std::shared_ptr<T>,
Amg::Vector3D>>& tclassvector,
115 bool associatedResult =
true)
const
147 std::unique_ptr<std::vector<T*>>
arrayObjects = std::make_unique<std::vector<T*>>();
150 for (
size_t ill = 0; ill < bins; ++ill) {
159 size_t vecsize = tclassvector.size();
160 m_array = std::vector<std::shared_ptr<T>>(vecsize);
161 for (
size_t ivec = 0; ivec < vecsize; ++ivec) {
162 const Amg::Vector3D currentGlobal(((tclassvector[ivec]).second));
165 ((tclassvector)[ivec]).first;
167 throw GaudiException(
"BinnedArray1D constructor",
168 "Object outside bounds", StatusCode::FAILURE);
Cached unique_ptr with atomic update.
A generic symmetric BinUtility, for fully symmetric binning in terms of binning grid and binning type...
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.
BinnedArray1D & operator=(BinnedArray1D &&)=default
const BinUtility * binUtility() const
Return the BinUtility.
CxxUtils::CachedUniquePtr< std::vector< T * > > m_arrayObjects
binUtility for retrieving and filling the Array
void createArrayCache() const
T * object(const Amg::Vector2D &lp) const
Returns the pointer to the templated class object from the BinnedArray, it returns nullptr if not def...
T * object(const Amg::Vector3D &gp) const
Returns the pointer to the templated class object from the BinnedArray it returns nullptr if not defi...
std::span< T *const > arrayObjects()
Return all objects of the Array non-const T.
BinnedArray1D * clone() const
Implicit Constructor.
std::span< T const *const > arrayObjects() const
Return all objects of the Array const T.
BinnedArray1D(BinnedArray1D &&)=default
BinnedArray1D & operator=(const BinnedArray1D &barr)
Assignment.
BinnedArray1D(const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector, const BinUtility &bingen)
ctors with arguments
BinnedArray1D(const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector, BinUtility &&bingen)
T * entryObject(const Amg::Vector3D &gp) const
Returns the pointer to the templated class object from the BinnedArray - entry point.
BinnedArray1D(const BinnedArray1D &barr)
Copy.
unsigned int arrayObjectsNumber() const
Number of Entries in the Array.
void initialize(const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector)
vector of pointers to the class T
std::vector< std::shared_ptr< T > > m_array
1D vector of cached not owning pointers to class T
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.