9#ifndef TRKDETDESCRUTILS_BINNEDARRAY2D_H
10#define TRKDETDESCRUTILS_BINNEDARRAY2D_H
12#include "GaudiKernel/GaudiException.h"
48 const std::vector<std::pair<std::shared_ptr<T>,
Amg::Vector3D>>& tclassvector,
57 const std::vector<std::pair<std::shared_ptr<T>,
Amg::Vector3D>>& tclassvector,
118 bool associatedResult =
true)
const
121 if (associatedResult){
127 return (nextFirst > 0 && nextSecond > 0)
159 std::unique_ptr<std::vector<T*>>
arrayObjects = std::make_unique<std::vector<T*>>();
161 for (
size_t ihl = 0; ihl < (
m_binUtility.bins(1)); ++ihl) {
162 for (
size_t ill = 0; ill < (
m_binUtility.bins(0)); ++ill) {
176 size_t vecsize = tclassvector.size();
177 for (
size_t ivec = 0; ivec < vecsize; ++ivec) {
178 const Amg::Vector3D currentGlobal(((tclassvector[ivec]).second));
181 curVec[
m_binUtility.bin(currentGlobal, 0)] = ((tclassvector)[ivec]).first;
183 throw GaudiException(
"BinnedArray2D",
"Object outside bounds",
184 StatusCode::FAILURE);
189 std::vector<std::vector<std::shared_ptr<T>>>
m_array{};
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.
BinnedArray2D(BinnedArray2D &&)=default
void createArrayCache() const
T * entryObject(const Amg::Vector3D &pos) const
Returns the pointer to the templated class object from the BinnedArray -entry point.
BinnedArray2D(const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector, const BinUtility &bingen)
Constructors with arguments.
BinnedArray2D * clone() const
Implizit Constructor.
BinnedArray2D(const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector, BinUtility &&bingen)
BinnedArray2D & operator=(const BinnedArray2D &barr)
Assignment operator.
void initialize(const std::vector< std::pair< std::shared_ptr< T >, Amg::Vector3D > > &tclassvector)
vector of pointers to the class T
CxxUtils::CachedUniquePtr< std::vector< T * > > m_arrayObjects
binUtility for retrieving and filling the Array
std::span< T const *const > arrayObjects() const
Return all objects of the Array const T.
const BinUtility * binUtility() const
Return the BinUtility.
std::vector< std::vector< std::shared_ptr< T > > > m_array
1D vector of cached not owning pointers to class T
BinnedArray2D & operator=(BinnedArray2D &&)=default
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 nullptr if not def...
BinnedArray2D(const BinnedArray2D &barr)
Copy Constructor !
std::span< T *const > arrayObjects()
Return all objects of the Array non-const T.
T * object(const Amg::Vector3D &gp) const
Returns the pointer to the templated class object from the BinnedArray it returns nullptr if not defi...
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.