diff --git a/Detector/VP/include/Detector/VP/VPChannelID.h b/Detector/VP/include/Detector/VP/VPChannelID.h index db611ce0b36706c11a2351b84073490df5e3130f..c2fa2f9dc01db954155eb0490769dfbb0f9fa5d2 100644 --- a/Detector/VP/include/Detector/VP/VPChannelID.h +++ b/Detector/VP/include/Detector/VP/VPChannelID.h @@ -57,9 +57,10 @@ namespace LHCb::Detector { } template <Mask m, typename T> - void set( T val ) { + constexpr VPChannelID& set( T val ) { m_channelID &= ~static_cast<unsigned int>( m ); m_channelID |= shift<m>( to_unsigned( val ) ); + return *this; } public: @@ -132,7 +133,7 @@ namespace LHCb::Detector { } /// Update pixel row - void setRow( RowID row ) { set<Mask::row>( row ); } + constexpr VPChannelID& setRow( RowID row ) { return set<Mask::row>( row ); } /// Retrieve pixel column [[nodiscard]] constexpr ColumnID col() const { @@ -141,7 +142,7 @@ namespace LHCb::Detector { } /// Update pixel column - void setCol( ColumnID col ) { set<Mask::col>( col ); } + constexpr VPChannelID& setCol( ColumnID col ) { return set<Mask::col>( col ); } /// Retrieve chip number [[nodiscard]] constexpr ChipID chip() const { @@ -150,7 +151,7 @@ namespace LHCb::Detector { } /// Update chip number - void setChip( ChipID chip ) { set<Mask::chip>( chip ); } + constexpr VPChannelID& setChip( ChipID chip ) { return set<Mask::chip>( chip ); } /// Retrieve sensor number [[nodiscard]] constexpr SensorID sensor() const { @@ -159,7 +160,7 @@ namespace LHCb::Detector { } /// Update sensor number - void setSensor( SensorID sensor ) { set<Mask::sensor>( sensor ); } + constexpr VPChannelID& setSensor( SensorID sensor ) { return set<Mask::sensor>( sensor ); } /// Retrieve orfy [[nodiscard]] constexpr OrfyID orfy() const { @@ -168,7 +169,7 @@ namespace LHCb::Detector { } /// Update orfy - void setOrfy( OrfyID orfy ) { set<Mask::orfy>( orfy ); } + constexpr VPChannelID& setOrfy( OrfyID orfy ) { return set<Mask::orfy>( orfy ); } /// Retrieve orfx [[nodiscard]] constexpr OrfxID orfx() const { @@ -177,7 +178,7 @@ namespace LHCb::Detector { } /// Update orfx - void setOrfx( OrfxID orfx ) { set<Mask::orfx>( orfx ); } + constexpr VPChannelID& setOrfx( OrfxID orfx ) { return set<Mask::orfx>( orfx ); } /// Retrieve scol [[nodiscard]] constexpr ScolID scol2() const { @@ -186,7 +187,7 @@ namespace LHCb::Detector { } /// Update scol - void setScol( ScolID scol2 ) { set<Mask::scol>( scol2 ); } + constexpr VPChannelID& setScol( ScolID scol2 ) { return set<Mask::scol>( scol2 ); } friend std::ostream& operator<<( std::ostream& str, const VPChannelID& obj );