|
ATLAS Offline Software
|
Go to the documentation of this file.
9 #ifndef TRKDETDESCRUTILS_BINNEDARRAY1D1D_H
10 #define TRKDETDESCRUTILS_BINNEDARRAY1D1D_H
52 std::vector<BinUtility*>* singleBinGen)
61 if (steeringBinGen1D) {
63 std::vector<std::vector<SharedObject<T>>>(steeringBinGen1D->bins());
64 for (
size_t i = 0;
i < steeringBinGen1D->bins(); ++
i) {
65 size_t sizeOfSubBin = ((*m_singleBinUtilities)[
i])->
bins();
66 m_array[
i] = std::vector<SharedObject<T>>(sizeOfSubBin);
70 int vecsize(tclassvector.size());
73 if (steeringBinGen1D->inside(currentGlobal)) {
74 int steeringBin = steeringBinGen1D->bin(currentGlobal, 0);
76 ((*m_singleBinUtilities)[steeringBin])->
bin(currentGlobal, 0);
77 std::vector<SharedObject<T>>& curVec =
m_array[steeringBin];
78 curVec[singleBin] = ((tclassvector)[
ivec]).first;
81 "BinnedArray1D1D",
"Object outside bounds", StatusCode::FAILURE);
96 ? barr.m_steeringBinUtility->
clone()
100 barr.m_singleBinUtilities->begin();
101 for (; singleBinIter != barr.m_singleBinUtilities->end(); ++singleBinIter) {
108 m_array = std::vector<std::vector<SharedObject<T>>>(
111 size_t sizeOfSubBin = ((*m_singleBinUtilities)[
i])->
bins(0);
112 m_array[
i] = std::vector<SharedObject<T>>(sizeOfSubBin,
nullptr);
118 for (
size_t isingle = 0;
119 isingle < (*m_singleBinUtilities)[isteer]->bins(0);
121 m_array[isteer][isingle] = (barr.m_array)[isteer][isingle];
138 delete *singleBinIter;
147 singleBinIter = barr.m_singleBinUtilties->begin();
154 m_array = std::vector<std::vector<SharedObject<T>>>(
157 unsigned int sizeOfSubBin = ((*m_singleBinUtilities)[
i])->
bins(0);
158 m_array[
i] = std::vector<SharedObject<T>>(sizeOfSubBin);
163 for (
int isingle = 0;
164 isingle < (*m_singleBinUtilities)[isteer]->bins(0);
198 return (
m_array[steerBin][singleBin]).get();
208 return (
m_array[steerBin][singleBin]).get();
217 return (
m_array[steerBin][singleBin]).get();
251 std::make_unique<std::vector<T*>>();
253 for (
size_t isingle = 0;
263 std::vector<std::vector<SharedObject<T>>>
m_array;
272 #endif // TRKSURFACES_BINNEDARRAY1D1D_H
JetConstituentVector::iterator iterator
size_t entry(const Amg::Vector3D &position, size_t ba=0) const
Bin from a 3D vector (already in binning frame)
BinnedArray1D1D(const BinnedArray1D1D &barr)
Copy Constructor - copies only pointers!
BinUtility * m_steeringBinUtility
T * entryObject(const Amg::Vector3D &gp) const
Returns the pointer to the templated class object from the BinnedArray - entry point.
Eigen::Matrix< double, 2, 1 > Vector2D
BinnedArray1D1D & operator=(const BinnedArray1D1D &barr)
Assignment operator.
Cached pointer with atomic update.
CxxUtils::CachedUniquePtr< std::vector< T * > > m_arrayObjects
binUtility for retrieving and filling the Array
std::vector< BinUtility * > * m_singleBinUtilities
single bin utilities
std::vector< std::vector< SharedObject< T > > > m_array
forced 1D vector of pointers to class T
size_t bins(size_t ba=0) const
Number of bins.
BinnedArraySpan< T *const > arrayObjects()
Return all objects of the Array non-const T.
unsigned int arrayObjectsNumber() const
Number of Entries in the Array.
void createArrayCache() const
vector of pointers to the class T
BinnedArray1D1D()
Default Constructor - needed for inherited classes.
BinnedArray1D1D(const std::vector< std::pair< SharedObject< T >, Amg::Vector3D >> &tclassvector, BinUtility *steeringBinGen1D, std::vector< BinUtility * > *singleBinGen)
Constructor with std::vector and a BinUtility.
BinnedArray1D1D * clone() const
Implicit Constructor.
const BinUtility * binUtility() const
Return the BinUtility - returns the steering binUtility in this case.
T * nextObject(const Amg::Vector3D &, const Amg::Vector3D &, bool) const
Returns the pointer to the templated class object from the BinnedArray.
Cached unique_ptr with atomic update.
virtual ~BinnedArray1D1D()
Virtual Destructor.
T * object(const Amg::Vector2D &lp) const
Returns the pointer to the templated class object from the BinnedArray, it returns 0 if not defined.
Ensure that the ATLAS eigen extensions are properly loaded.
BinnedArraySpan< T const *const > arrayObjects() const
Return all objects of the Array const T.
Eigen::Matrix< double, 3, 1 > Vector3D
T * object(const Amg::Vector3D &gp) const
Returns the pointer to the templated class object from the BinnedArray, it returns 0 if not defined.
std::shared_ptr< T > SharedObject
BinUtility * 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