1 #ifndef DataFormats_HcalRecHit_CaloRecHitAuxSetter_h_ 2 #define DataFormats_HcalRecHit_CaloRecHitAuxSetter_h_ 11 {*u &= ~(mask <<
offset); *u |= ((value &
mask) << offset);}
15 {
return (u >> offset) &
mask;}
17 inline void setBit(uint32_t* u,
const unsigned bitnum,
const bool b)
18 {
if (b) {*u |= (1
U << bitnum);}
else {*u &= ~(1
U << bitnum);}}
20 inline void orBit(uint32_t* u,
const unsigned bitnum,
const bool b)
21 {
if (b) {*u |= (1
U << bitnum);}}
23 inline void andBit(uint32_t* u,
const unsigned bitnum,
const bool b)
24 {
if (!b) {*u &= ~(1
U << bitnum);}}
26 inline bool getBit(
const uint32_t u,
const unsigned bitnum)
27 {
return u & (1
U << bitnum);}
30 #endif // DataFormats_HcalRecHit_CaloRecHitAuxSetter_h_
void orBit(uint32_t *u, const unsigned bitnum, const bool b)
unsigned getField(const uint32_t u, const unsigned mask, const unsigned offset)
void setBit(uint32_t *u, const unsigned bitnum, const bool b)
void setField(uint32_t *u, const unsigned mask, const unsigned offset, const unsigned value)
void andBit(uint32_t *u, const unsigned bitnum, const bool b)
bool getBit(const uint32_t u, const unsigned bitnum)