FPGATrackSimGenScanArray: multidimensional array tool for FPGATrackSimGenScan algorithm
This is the first merge request of a series for a new EF track pattern recognition algorithm called FPGATrackSimGenScan
Here is a brief description of the tool:
- In order to efficiently navigate and iterate over the 5d bins in FPGATrackSimGenScanTool, 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 dimensions. The size in each dimension set in the constructor or later by the "setsize" method.
- The implementation uses an std::vector to avoid an direct memory management. The required size is calculated from the m_dims vector.
- For accessing elements, it converts an index std::vector of length Ndim into a single integer 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 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