Skip to content
Snippets Groups Projects
Commit 8967f430 authored by Louis Henry's avatar Louis Henry
Browse files

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

parent 5a9f58e0
No related branches found
No related tags found
1 merge request!423Enforce centre-to-edge convention on the global indices of FT mat and sipm
Pipeline #5985184 passed
......@@ -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() );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment