|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
16-bit damage word. More...
#include <Damage.hh>
Public Types | |
| enum | Value { Truncated = 0 , OutOfOrder = 1 , OutOfSynch = 2 , Corrupted = 3 , DroppedContribution = 4 , MissingData = 5 , TimedOut = 6 , UserDefined = 12 } |
| Bit positions of the damage flags; increase(Damage::Value) sets bit (1 << value). More... | |
| enum | { UserBitMask = 0xf000 , UserBitShift = 12 } |
| Position of the user bits (bits 15:12) in the damage word. More... | |
| enum | { ValueBitMask = 0x0fff } |
| Mask of the damage-flag bits. More... | |
Public Member Functions | |
| Damage () | |
| Default constructor; the damage word is left uninitialized. | |
| Damage (uint16_t v) | |
| Set the damage word to v. | |
| uint16_t | value () const |
| Return the full 16-bit damage word. | |
| void | increase (Damage::Value v) |
| OR bit (1 << v), masked with ValueBitMask, into the damage word. | |
| void | increase (uint16_t v) |
| OR (v & ValueBitMask) into the damage word; the user bits are not changed. | |
| uint16_t | bits () const |
| Return the damage word masked with ValueBitMask (bits 11:0). | |
| uint16_t | userBits () const |
| Return the damage word shifted right by UserBitShift (bits 15:12). | |
| void | userBits (uint16_t v) |
| Clear bits 15:12 and OR in (v << UserBitShift), truncated to 16 bits; bits 11:0 are kept. | |
16-bit damage word.
Bits 11:0 (ValueBitMask) are damage flags, one bit per Damage::Value; bits 15:12 (UserBitMask) are user bits.
Bit positions of the damage flags; increase(Damage::Value) sets bit (1 << value).
| Enumerator | |
|---|---|
| Truncated | Bit 0. |
| OutOfOrder | Bit 1. |
| OutOfSynch | Bit 2. |
| Corrupted | Bit 3. XtcIterator::iterate() does not descend into an xtc whose damage has this bit set. |
| DroppedContribution | Bit 4. |
| MissingData | Bit 5. |
| TimedOut | Bit 6. |
| UserDefined | Value 12. increase(Damage::Value) masks (1 << 12) with ValueBitMask, so it sets no bit for this value. |
|
inline |
Default constructor; the damage word is left uninitialized.
|
inline |
Set the damage word to v.
|
inline |
Return the damage word masked with ValueBitMask (bits 11:0).
|
inline |
OR bit (1 << v), masked with ValueBitMask, into the damage word.
Values of v at or above 12 set nothing.
OR (v & ValueBitMask) into the damage word; the user bits are not changed.
|
inline |
Return the damage word shifted right by UserBitShift (bits 15:12).
Clear bits 15:12 and OR in (v << UserBitShift), truncated to 16 bits; bits 11:0 are kept.
|
inline |
Return the full 16-bit damage word.