ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimBinArray.h File Reference

Iterable Multidimensional Array Class for FPGATrackSimBinTool. More...

#include <vector>
#include <string>
#include <stdexcept>
#include <utility>
#include "CxxUtils/checker_macros.h"
Include dependency graph for FPGATrackSimBinArray.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FPGATrackSimBinArray< T >
struct  FPGATrackSimBinArray< T >::ConstIterator
struct  FPGATrackSimBinArray< T >::Iterator

Detailed Description

Iterable Multidimensional Array Class for FPGATrackSimBinTool.

Author
Elliot Lipeles
Date
Sept 10th, 2024

Declarations in this file:

Description of purpose/function:

  • In order to efficiently navigate and iterate over the 5d bins in FPGATrackSimBinTool, a dedicated array class has been developed. Multidimensional arrays in stl don't appear until c++23 at the earliest and have not been evaluated for appropriateness.
  • This array can have an arbitrary number of dimensions set by an std:vector (dims) with the size of the number of demensions and the size in each dimension set in the constructor or later by the "setsize" method.
  • The implemenatation uses an std::vector to avoid an direct memory management. The requried size is calcuated from the m_dims vector.
  • For accessing elements, it converts a index std::vector<unsigned> of length Ndim (idx) into a single int index into the 1d std::vector.
  • It has a standard iterator so you can iterate with "for (auto &bin : myArray)" where bin would be an iterator with two accessors bin.idx() gives the size N-dim std:vector<unsigned> which is N-dim index the iterator is on and bin.data() which is a reference to the content of the array for that index

Definition in file FPGATrackSimBinArray.h.