16#ifndef ALICEO2_ITSMFT_CLUSTERSPERLAYER_H
17#define ALICEO2_ITSMFT_CLUSTERSPERLAYER_H
53 LOGP(fatal,
"Clusters container cannot be initialized for {} layers, must be within 1:{}", nLr,
MaxClusLayers);
63 if (lr < 0 || lr >= mNLayers) {
64 LOGP(fatal,
"Clusters container was initialized for {} layers, cannot fill the layer {}", mNLayers, lr);
66 mLrFirst[lr] = int(mClusters.size());
73 mLrFirst[lr] = int(mClusters.size());
90 auto getNClusters(
int lr)
const {
return mLrFirst[lr + 1] - mLrFirst[lr]; }
91 auto size()
const {
return mClusters.size(); }
92 bool empty()
const {
return mClusters.empty(); }
102 std::vector<T> mClusters{};
103 std::array<int, MaxClusLayers + 1> mLrFirst{};
Composition/decomposition of the ITS/MFT cluster IDs referring to per-layer cluster arrays.
auto getFirstIndex(int lr) const
void clear()
the clusters of all layers, to be appended to by the caller between beginLayer and finalize
const auto & getClusters() const
void beginLayer(int lr)
to be called once all the layers were filled
auto getNClusters(int lr) const
void init(int nLr)
< prepare for filling nLr layer slots, discarding the previous content
bool empty() const
flat index of the cluster referred to by its composed ID
const T & operator[](int composedID) const
int flatIndex(int composedID) const
constexpr int clusID2Layer(int id)
constexpr int MaxClusLayers
constexpr int clusID2Index(int id)