From 603a6da4769984ac99c7e2acded69ac1de02ff28 Mon Sep 17 00:00:00 2001 From: Sebastien Ponce Date: Tue, 20 Sep 2022 14:05:19 +0200 Subject: [PATCH] Added static access to nb cells and nb crates for calorimeters --- Detector/Calo/include/Detector/Calo/CaloCellID.h | 5 +++++ Detector/Calo/include/Detector/Calo/DeCalorimeter.h | 13 +++++++++++++ 2 files changed, 18 insertions(+) diff --git a/Detector/Calo/include/Detector/Calo/CaloCellID.h b/Detector/Calo/include/Detector/Calo/CaloCellID.h index ab81cdc152..a517a746fd 100644 --- a/Detector/Calo/include/Detector/Calo/CaloCellID.h +++ b/Detector/Calo/include/Detector/Calo/CaloCellID.h @@ -423,6 +423,11 @@ namespace LHCb::Detector::Calo { return DenseIndex::details::offsetAfter< DenseIndex::details::Constants>(); } + static constexpr int nbEcalCells() { + return DenseIndex::details::offsetAfter< + DenseIndex::details::Constants>(); + } + static constexpr int nbHcalCells() { return max() - nbEcalCells(); } }; } // namespace LHCb::Detector::Calo diff --git a/Detector/Calo/include/Detector/Calo/DeCalorimeter.h b/Detector/Calo/include/Detector/Calo/DeCalorimeter.h index c3afe37cd5..e8d4fa4ea8 100644 --- a/Detector/Calo/include/Detector/Calo/DeCalorimeter.h +++ b/Detector/Calo/include/Detector/Calo/DeCalorimeter.h @@ -208,6 +208,19 @@ namespace LHCb::Detector::Calo { return plane( this->access()->toLocalTransform( global ).Z() ); } + // These crate numbers are the ones for Run3. + // Run 2 would have 21/22 instead of 13/14 and 25 instead of 17. + // due to this, no run2 data can be used with this + template + static inline constexpr unsigned int minCrate = ( calo == LHCb::Detector::Calo::CellCode::Index::EcalCalo ? 0 + : 14 ); + template + static inline constexpr unsigned int maxCrate = ( calo == LHCb::Detector::Calo::CellCode::Index::EcalCalo ? 13 + : 17 ); + template + static inline constexpr unsigned int nbCrates = ( calo == LHCb::Detector::Calo::CellCode::Index::EcalCalo ? 14 + : 4 ); + // accessing the calibration parameters double maxEtInCenter( unsigned int reg = 0 ) const { return ( reg < this->access()->maxEtInCenter.size() ) ? this->access()->maxEtInCenter[reg] -- GitLab