Skip to content
Snippets Groups Projects

LArProvenance bit-pattern: Use an Enum instead of hardcoded numbers

Merged Walter Lampl requested to merge wlampl/athena:LArProvEnum into main
2 files
+ 11
7
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -33,13 +33,12 @@ namespace LArProv {
};
inline bool test(const uint16_t prov, const LArProvenance check) {
if (check<0xF) {
//The first four bits are a number
return ((prov & 0xF) == check);
if (check & 0xF) {
//The first four bits are a number, require exact match
if ((prov & 0xF) != (check &0xF)) return false;
}
else
//The remaining bits are independent
return ((prov & check) == check);
//The remaining bits are independent, check only if 'check' bits are set
return (((prov >>4) & (check >>4)) == (check >>4));
}
@@ -60,7 +59,7 @@ Bits 4 to 15 are flags:
5 -> 0x20 RAMPDB
6 -> 0x40 PEDSAMPLEZERO
7 -> 0x80 PEDDB
8 -> 0x0100 ITERCONVERGED
8 -> 0x0100 ITERCONVERGED
9
10 -> 0x0400 SATURATED
11 -> 0x0800 MASKED
Loading