Skip to content
Snippets Groups Projects

Add SciFi hardware ID conversion from FTChannelID

Merged Lukas Witola requested to merge luwitola_ftchannelid into master
All threads resolved!
1 file
+ 21
3
Compare changes
  • Side-by-side
  • Inline
@@ -195,9 +195,6 @@ namespace LHCb::Detector {
/// Retrieve ID of the mat in the module
[[nodiscard]] constexpr MatID mat() const { return MatID{extract<Mask::mat>( m_channelID )}; }
/// Retrieve data link in module
[[nodiscard]] constexpr unsigned int dataLink() const { return ( to_unsigned( mat() ) << 2 | sipm() ); } // TO TEST
/// Retrieve Module id (0 - 5 or 0 - 6)
[[nodiscard]] constexpr ModuleID module() const { return ModuleID{extract<Mask::module>( m_channelID )}; }
@@ -210,6 +207,27 @@ namespace LHCb::Detector {
/// Retrieve Station id
[[nodiscard]] constexpr StationID station() const { return StationID{extract<Mask::station>( m_channelID )}; }
/// Retrieve HalfRob ID within module [0, 1]
[[nodiscard]] constexpr unsigned int halfRob() const { return mat() / 2; }
/// Retrieve data link ID within HalfRob [0..7]
[[nodiscard]] constexpr unsigned int dataLink() const { return ( 4 * mat() + sipm() ) % 8; }
/// Retrieve ClusterBoard ID within HalfRob [0..3]
[[nodiscard]] constexpr unsigned int clusterBoard() const { return dataLink() / 2; }
/// Retrieve PacificBoard ID within HalfRob [0..3]
[[nodiscard]] constexpr unsigned int pacificBoard() const { return clusterBoard(); }
/// Retrieve Pacific ID within PacificBoard [0, 1]
[[nodiscard]] constexpr unsigned int pacific() const { return ( channel() / 64 ) + 2 * ( dataLink() % 2 ); }
/// Retrieve Pacific channel ID within Pacific [0..63]
[[nodiscard]] constexpr unsigned int pacificChannel() const {
auto ch = channel() % 64;
return 32 * ( 1 - ch % 2 ) + ( ch / 2 );
}
/// Retrieve how many modules there are in that quarter
[[nodiscard]] constexpr unsigned int nModulesInQuarter() const { return ( to_unsigned( station() ) == 3 ) ? 6 : 5; }
Loading