Go to the documentation of this file. 1 #ifndef DataFormats_HcalRecHit_CaloRecHitAuxSetter_h_
2 #define DataFormats_HcalRecHit_CaloRecHitAuxSetter_h_
8 constexpr
inline void setField(uint32_t* u,
const unsigned mask,
const unsigned offset,
const unsigned value) {
13 constexpr
inline unsigned getField(
const uint32_t u,
const unsigned mask,
const unsigned offset) {
14 return (u >>
offset) & mask;
17 constexpr
inline void setBit(uint32_t* u,
const unsigned bitnum,
const bool b) {
21 *u &= ~(1
U << bitnum);
25 constexpr
inline void orBit(uint32_t* u,
const unsigned bitnum,
const bool b) {
31 constexpr
inline void andBit(uint32_t* u,
const unsigned bitnum,
const bool b) {
33 *u &= ~(1
U << bitnum);
37 constexpr
inline bool getBit(
const uint32_t u,
const unsigned bitnum) {
return u & (1
U << bitnum); }
40 #endif // DataFormats_HcalRecHit_CaloRecHitAuxSetter_h_
constexpr void setField(uint32_t *u, const unsigned mask, const unsigned offset, const unsigned value)
constexpr void setBit(uint32_t *u, const unsigned bitnum, const bool b)
constexpr void orBit(uint32_t *u, const unsigned bitnum, const bool b)
constexpr void andBit(uint32_t *u, const unsigned bitnum, const bool b)
constexpr unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
constexpr bool getBit(const uint32_t u, const unsigned bitnum)