Skip to content
Snippets Groups Projects

Enforce centre-to-edge convention on the global indices of FT mat and sipm

Merged Louis Henry requested to merge lohenry-correctIdx into master
All threads resolved!
1 file
+ 8
3
Compare changes
  • Side-by-side
  • Inline
@@ -300,11 +300,14 @@ namespace LHCb::Detector {
/// Retrieve global mat index [0..1023]
[[nodiscard]] constexpr unsigned int globalMatIdx() const {
return FTConstants::nMats * globalModuleIdx() + to_unsigned( mat() );
return FTConstants::nMats * globalModuleIdx() + localMatIdx();
}
/// Retrieve global sipm index [4095]
[[nodiscard]] constexpr unsigned int globalSipmIdx() const { return FTConstants::nSiPM * globalMatIdx() + sipm(); }
/// Center-to-edge convention
[[nodiscard]] constexpr unsigned int globalSipmIdx() const {
return FTConstants::nSiPM * globalMatIdx() + localSiPMIdx();
}
/// Local idx functions. Starting at 0, centre-to-edge, contiguous
/// Returns the local index of the module ordered from left to right
@@ -317,15 +320,17 @@ namespace LHCb::Detector {
return nModulesInQuarter() * ( FTConstants::nQuarters * to_unsigned( layer() ) + to_unsigned( quarter() ) ) +
localModuleIdx();
}
// Center-to-edge convention
[[nodiscard]] constexpr unsigned int localChannelIdx() const {
return ( readoutFromCtoE() ) ? channel() : FTConstants::nChannels - 1 - channel();
}
// Center-to-edge convention
[[nodiscard]] constexpr unsigned int localSiPMIdx() const {
return ( readoutFromCtoE() ) ? sipm() : FTConstants::nSiPM - 1 - sipm();
}
// Center-to-edge convention
[[nodiscard]] constexpr unsigned int localMatIdx() const {
return ( readoutFromCtoE() ) ? to_unsigned( mat() ) : FTConstants::nMats - 1 - to_unsigned( mat() );
}
Loading