Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • rrabadan/LHCb
  • talin/LHCb
  • imjelde/LHCb
  • mstahl/LHCb
  • padeken/LHCb
  • mimazure/LHCb
  • roiser/LHCb
  • conrad/LHCb
  • kklimasz/LHCb
  • rcurrie/LHCb
  • wkrzemie/LHCb
  • fkeizer/LHCb
  • valassi/LHCb
  • hschrein/LHCb
  • anstahll/LHCb
  • jonrob/LHCb
  • graven/LHCb
  • clemenci/LHCb
  • chaen/LHCb
  • sstahl/LHCb
  • lhcb/LHCb
21 results
Show changes
Commits on Source (2)
......@@ -206,20 +206,19 @@ namespace Rich::DAQ {
EventID( const EventID& ) = default;
/// Constructor from value and number of bits
template <class NUMTYPE>
EventID( const NUMTYPE id, const ShortType aBits )
: NumericType<LLongType>( (LLongType)id ), m_nActiveBits( aBits ) {}
EventID( const NUMTYPE id, const ShortType aBits ) noexcept
: NumericType<Type>( static_cast<Type>( id ) ), m_nActiveBits( aBits ) {}
/// Constructor from value
template <class NUMTYPE>
explicit EventID( const NUMTYPE id )
: NumericType<LLongType>( (LLongType)id ), m_nActiveBits( 8 * sizeof( NUMTYPE ) ) {}
explicit EventID( const NUMTYPE id ) noexcept : EventID( id, 8 * sizeof( NUMTYPE ) ) {}
/// Return the number of active bits
inline ShortType activeBits() const noexcept { return m_nActiveBits; }
inline auto activeBits() const noexcept { return m_nActiveBits; }
/// Set the number of active bits
inline void setActiveBits( const ShortType bits ) noexcept { m_nActiveBits = bits; }
public:
/// Operator LLongtype
inline operator LLongType() const noexcept { return data(); }
inline operator Type() const noexcept { return data(); }
public:
/// Overloaded output to ostream
......@@ -246,7 +245,7 @@ namespace Rich::DAQ {
private:
/// Number of sensitive bits in this EventID
ShortType m_nActiveBits{8 * sizeof( LLongType )};
ShortType m_nActiveBits{8 * sizeof( Type )};
};
/** @class BXID RichUtils/RichDAQDefinitions.h
......@@ -262,21 +261,21 @@ namespace Rich::DAQ {
BXID() = default;
/// Copy Constructor
BXID( const BXID& ) = default;
/// Constructor from value
template <class NUMTYPE>
explicit BXID( const NUMTYPE id ) noexcept
: NumericType<LongType>( (LongType)id ), m_nActiveBits( 8 * sizeof( NUMTYPE ) ) {}
/// Constructor from value and number of bits
template <class NUMTYPE>
BXID( const NUMTYPE id, const ShortType aBits ) : NumericType<LongType>( (LongType)id ), m_nActiveBits( aBits ) {}
BXID( const NUMTYPE id, const ShortType aBits )
noexcept : NumericType<Type>( static_cast<Type>( id ) ), m_nActiveBits( aBits ) {}
/// Constructor from value
template <class NUMTYPE>
explicit BXID( const NUMTYPE id ) noexcept : BXID( id, 8 * sizeof( NUMTYPE ) ) {}
/// Return the number of active bits
inline ShortType activeBits() const noexcept { return m_nActiveBits; }
inline auto activeBits() const noexcept { return m_nActiveBits; }
/// Set the number of active bits
inline void setActiveBits( const ShortType bits ) noexcept { m_nActiveBits = bits; }
public:
/// Operator LongType
inline operator LongType() const noexcept { return data(); }
/// Operator to underlying Type
inline operator Type() const noexcept { return data(); }
public:
/// Overloaded output to ostream
......@@ -303,7 +302,7 @@ namespace Rich::DAQ {
private:
/// Number of sensitive bits in this BXID
ShortType m_nActiveBits{8 * sizeof( LongType )};
ShortType m_nActiveBits{8 * sizeof( Type )};
};
/** @class PDHardwareID RichUtils/RichDAQDefinitions.h
......@@ -317,7 +316,7 @@ namespace Rich::DAQ {
class PDHardwareID final : public NumericType<LongType> {
public:
/// Use base constructors
using NumericType<LongType>::NumericType;
using NumericType<Type>::NumericType;
};
/** @class PDCopyNumber RichUtils/RichDAQDefinitions.h
......@@ -330,7 +329,7 @@ namespace Rich::DAQ {
class PDCopyNumber final : public NumericType<ShortType> {
public:
/// Use base constructors
using NumericType<ShortType>::NumericType;
using NumericType<Type>::NumericType;
};
/** @class PDPanelIndex RichUtils/RichDAQDefinitions.h
......@@ -343,7 +342,7 @@ namespace Rich::DAQ {
class PDPanelIndex final : public NumericType<ShortType> {
public:
/// Use base constructors
using NumericType<ShortType>::NumericType;
using NumericType<Type>::NumericType;
};
/** @class PDModuleNumber RichUtils/RichDAQDefinitions.h
......@@ -356,7 +355,7 @@ namespace Rich::DAQ {
class PDModuleNumber final : public NumericType<std::int32_t> {
public:
/// Use base constructors
using NumericType<std::int32_t>::NumericType;
using NumericType<Type>::NumericType;
};
/** @class SourceID RichUtils/RichDAQDefinitions.h
......@@ -367,13 +366,17 @@ namespace Rich::DAQ {
* @date 27/06/2020
*/
class SourceID final : public NumericType<std::int16_t> {
public:
/// Type for data fields
using FieldType = std::uint16_t;
private:
/// The partition values for RICH1 and RICH2
enum Partition { RICH1 = 4, RICH2 = 9 };
private:
// For the bit unpacking
using I = std::uint16_t;
using I = FieldType;
static constexpr const I BitsPayload = 10; ///< The Tel40 specific number
static constexpr const I BitsSide = 1; ///< The SIDE bit
static constexpr const I BitsPartition = 5; ///< The Partition number
......@@ -386,13 +389,15 @@ namespace Rich::DAQ {
private:
/// Set the given data into the given field
constexpr void set( const I value, const I shift, const I mask ) noexcept {
constexpr void set( const FieldType value, const FieldType shift, const FieldType mask ) noexcept {
setData( ( ( value << shift ) & mask ) | ( data() & ~mask ) );
}
public:
/// Get the partition
inline constexpr auto partition() const noexcept { return ( data() & MaskPartition ) >> ShiftPartition; }
inline constexpr auto partition() const noexcept {
return FieldType( ( data() & MaskPartition ) >> ShiftPartition );
}
/// Get the RICH type
inline constexpr auto rich() const noexcept {
......@@ -406,19 +411,19 @@ namespace Rich::DAQ {
inline constexpr auto side() const noexcept { return Rich::Side( ( data() & MaskSide ) >> ShiftSide ); }
/// Get the SourceID payload
inline constexpr auto payload() const noexcept { return ( ( data() & MaskPayload ) >> ShiftPayload ); }
inline constexpr auto payload() const noexcept { return FieldType( ( data() & MaskPayload ) >> ShiftPayload ); }
/// Check ID is valid
inline constexpr bool isValid() const noexcept {
return ( this->NumericType<std::int16_t>::isValid() && rich() != Rich::InvalidDetector );
return ( this->NumericType<Type>::isValid() && rich() != Rich::InvalidDetector );
}
public:
/// Use base constructors
using NumericType<std::int16_t>::NumericType;
using NumericType<Type>::NumericType;
/// Constructor from individual data fields
SourceID( const Rich::DetectorType r, const Rich::Side s, const std::uint16_t p ) {
constexpr SourceID( const Rich::DetectorType r, const Rich::Side s, const FieldType p ) noexcept {
set( ( Rich::Rich1 == r ? RICH1 : RICH2 ), ShiftPartition, MaskPartition );
set( s, ShiftSide, MaskSide );
set( p, ShiftPayload, MaskPayload );
......@@ -456,7 +461,7 @@ namespace Rich::DAQ {
class Tel40Connector final : public NumericType<std::int8_t> {
public:
/// Use base constructors
using NumericType<std::int8_t>::NumericType;
using NumericType<Type>::NumericType;
};
/** @class PDMDBID RichUtils/RichDAQDefinitions.h
......@@ -469,7 +474,7 @@ namespace Rich::DAQ {
class PDMDBID final : public NumericType<std::int8_t> {
public:
/// Use base constructors
using NumericType<std::int8_t>::NumericType;
using NumericType<Type>::NumericType;
};
/** @class PDMDBFrame RichUtils/RichDAQDefinitions.h
......@@ -482,7 +487,7 @@ namespace Rich::DAQ {
class PDMDBFrame final : public NumericType<std::int8_t> {
public:
/// Use base constructors
using NumericType<std::int8_t>::NumericType;
using NumericType<Type>::NumericType;
};
/** @class FrameBitIndex RichUtils/RichDAQDefinitions.h
......@@ -495,7 +500,7 @@ namespace Rich::DAQ {
class FrameBitIndex final : public NumericType<std::int8_t> {
public:
/// Use base constructors
using NumericType<std::int8_t>::NumericType;
using NumericType<Type>::NumericType;
};
/** @class ElementaryCell RichUtils/RichDAQDefinitions.h
......@@ -508,7 +513,7 @@ namespace Rich::DAQ {
class ElementaryCell final : public NumericType<std::int8_t> {
public:
/// Use base constructors
using NumericType<std::int8_t>::NumericType;
using NumericType<Type>::NumericType;
};
/** @class PMTInEC RichUtils/RichDAQDefinitions.h
......@@ -521,7 +526,7 @@ namespace Rich::DAQ {
class PMTInEC final : public NumericType<std::int8_t> {
public:
/// Use base constructors
using NumericType<std::int8_t>::NumericType;
using NumericType<Type>::NumericType;
};
/** @class AnodeIndex RichUtils/RichDAQDefinitions.h
......@@ -534,7 +539,7 @@ namespace Rich::DAQ {
class AnodeIndex final : public NumericType<std::int8_t> {
public:
/// Use base constructors
using NumericType<std::int8_t>::NumericType;
using NumericType<Type>::NumericType;
};
//--------------------------------------------------------------------------------------
......