lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
XtcData::Damage Class Reference

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.
 

Detailed Description

16-bit damage word.

Bits 11:0 (ValueBitMask) are damage flags, one bit per Damage::Value; bits 15:12 (UserBitMask) are user bits.

Member Enumeration Documentation

◆ anonymous enum

Position of the user bits (bits 15:12) in the damage word.

Enumerator
UserBitMask 

0xf000, mask of the user bits.

UserBitShift 

12, shift of the user bits.

◆ anonymous enum

Mask of the damage-flag bits.

Enumerator
ValueBitMask 

0x0fff, bits 11:0.

◆ Value

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.

Constructor & Destructor Documentation

◆ Damage() [1/2]

XtcData::Damage::Damage ( )
inline

Default constructor; the damage word is left uninitialized.

◆ Damage() [2/2]

XtcData::Damage::Damage ( uint16_t  v)
inline

Set the damage word to v.

Member Function Documentation

◆ bits()

uint16_t XtcData::Damage::bits ( ) const
inline

Return the damage word masked with ValueBitMask (bits 11:0).

◆ increase() [1/2]

void XtcData::Damage::increase ( Damage::Value  v)
inline

OR bit (1 << v), masked with ValueBitMask, into the damage word.

Values of v at or above 12 set nothing.

◆ increase() [2/2]

void XtcData::Damage::increase ( uint16_t  v)
inline

OR (v & ValueBitMask) into the damage word; the user bits are not changed.

◆ userBits() [1/2]

uint16_t XtcData::Damage::userBits ( ) const
inline

Return the damage word shifted right by UserBitShift (bits 15:12).

◆ userBits() [2/2]

void XtcData::Damage::userBits ( uint16_t  v)
inline

Clear bits 15:12 and OR in (v << UserBitShift), truncated to 16 bits; bits 11:0 are kept.

◆ value()

uint16_t XtcData::Damage::value ( ) const
inline

Return the full 16-bit damage word.


The documentation for this class was generated from the following file: