From c86d448a535cb31bacc6ab48ec841d92b8ef25de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Wed, 25 Nov 2026 09:39:25 +0100 Subject: [PATCH] Add lutSize method to FlatLutEntry class Added lutSize method to calculate the number of LUT entries. --- ALICE3/Core/FlatLutEntry.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ALICE3/Core/FlatLutEntry.h b/ALICE3/Core/FlatLutEntry.h index c7cc6b7c508..6bf78dea6b1 100644 --- a/ALICE3/Core/FlatLutEntry.h +++ b/ALICE3/Core/FlatLutEntry.h @@ -122,6 +122,14 @@ class FlatLutData */ void initialize(const lutHeader_t& header); + /** + * @brief the number of entries in the LUT, based on the cached dimensions. + */ + [[nodiscard]] size_t lutSize() const { return mNchBins * mRadBins * mEtaBins * mPtBins; } + + /** + * @brief Calculate the linear index of a LUT entry based on its bin indices. + */ [[nodiscard]] size_t getEntryIndex(int nch_bin, int rad_bin, int eta_bin, int pt_bin) const { // Linear index: nch varies slowest, pt varies fastest