Simple utilities to deal with bit enumerators. More...
Classes | |
struct | mask_t |
Functions | |
Generic bit functions | |
template<typename EnumType > | |
mask_t< EnumType > | makeMask (typename mask_t< EnumType >::maskbits_t bits) noexcept |
Converts a integral type into a mask. More... | |
template<typename EnumType > | |
constexpr auto | value (EnumType bit) |
Returns the value of specified bit (conversion like enum to int ). More... | |
template<typename EnumType , typename... OtherBits> | |
constexpr mask_t< EnumType > | mask (EnumType bit, OtherBits...otherBits) |
Returns a mask with all specified bits set. More... | |
template<typename EnumType > | |
constexpr bool | hasBitSet (mask_t< EnumType > bitMask, EnumType bit) |
Returns whether the specified bit is set in bitMask . More... | |
template<typename EnumType > | |
std::string | name (EnumType bit) |
Returns the name of the specified bit . Delegates to bitName() . More... | |
template<typename EnumType > | |
std::vector< std::string > | names (mask_t< EnumType > mask) |
Simple utilities to deal with bit enumerators.
A few simple concepts:
0
, 1
, 2
...)enum class
)name()
)mask()
, value()
and hasBitSet()
help with the conversions between enum class
and the underlying integral type using sbn::bits::gateSelectionMask = typedef mask_t<gateSelection> |
Definition at line 174 of file BeamBits.h.
using sbn::bits::triggerLocationMask = typedef mask_t<triggerLocation> |
Type of mask with triggerLocation
bits.
Definition at line 125 of file BeamBits.h.
using sbn::bits::triggerSourceMask = typedef mask_t<triggerSource> |
Type of mask with triggerSource
bits.
Definition at line 109 of file BeamBits.h.
using sbn::bits::triggerTypeMask = typedef mask_t<triggerType> |
Type of mask with triggerType
bits.
Definition at line 136 of file BeamBits.h.
|
strong |
Enabled gates in the trigger configuration. See register 0X00050008 in docdb SBN-doc-23778-v1.
Definition at line 149 of file BeamBits.h.
|
strong |
Location or locations generating a trigger.
Definition at line 113 of file BeamBits.h.
|
strong |
Type of beam or beam gate or other trigger source.
Definition at line 97 of file BeamBits.h.
|
strong |
Type representing the type(s) of this trigger.
Enumerator | |
---|---|
Majority |
A minimum number of close-by PMT pairs above threshold was reached. |
MinimumBias |
Data collected at gate opening with no further requirement imposed. |
NBits |
Number of bits currently supported. |
Definition at line 128 of file BeamBits.h.
|
strong |
Trigger window mode.
Enumerator | |
---|---|
Separated |
Separated, non-overlapping contigous window. |
Overlapping |
Overlaping windows. |
NBits |
Number of Bits currently supported. |
Definition at line 139 of file BeamBits.h.
|
inline |
Returns a mnemonic short name of the beam type.
Definition at line 267 of file BeamBits.h.
|
inline |
Returns a mnemonic short name of the trigger location.
Definition at line 285 of file BeamBits.h.
|
inline |
Returns a mnemonic short name of the trigger type.
Definition at line 302 of file BeamBits.h.
|
inline |
Returns a mnemonic short name for the trigger window mode.
Definition at line 314 of file BeamBits.h.
|
inline |
Returns a mnemonic short name for the trigger window mode.
Definition at line 327 of file BeamBits.h.
constexpr bool sbn::bits::hasBitSet | ( | mask_t< EnumType > | bitMask, |
EnumType | bit | ||
) |
Returns whether the specified bit
is set in bitMask
.
Definition at line 232 of file BeamBits.h.
|
noexcept |
Converts a integral type into a mask.
constexpr mask_t<EnumType> sbn::bits::mask | ( | EnumType | bit, |
OtherBits... | otherBits | ||
) |
Returns a mask with all specified bits set.
std::string sbn::bits::name | ( | EnumType | bit | ) |
Returns the name of the specified bit
. Delegates to bitName()
.
Definition at line 238 of file BeamBits.h.
std::vector< std::string > sbn::bits::names | ( | mask_t< EnumType > | mask | ) |
Returns a list of the names of all the bits set in mask
. Mask is interpreted as made of only bits of type EnumType
.
Definition at line 244 of file BeamBits.h.
constexpr auto sbn::bits::value | ( | EnumType | bit | ) |
Returns the value of specified bit
(conversion like enum
to int
).
Definition at line 215 of file BeamBits.h.