CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Private Attributes
PHGCSimAccumulator::Data Class Reference

#include <PHGCSimAccumulator.h>

Public Member Functions

 Data ()
 
 Data (unsigned short ei, unsigned short si, unsigned short d)
 
unsigned int data () const
 
unsigned int energyIndex () const
 
unsigned int sampleIndex () const
 

Static Public Attributes

static constexpr unsigned dataMask = 0x7ff
 
static constexpr unsigned dataOffset = 0
 
static constexpr unsigned energyMask = 0x1
 
static constexpr unsigned energyOffset = 15
 
static constexpr unsigned sampleMask = 0xf
 
static constexpr unsigned sampleOffset = 11
 

Private Attributes

unsigned short data_
 

Detailed Description

Definition at line 36 of file PHGCSimAccumulator.h.

Constructor & Destructor Documentation

PHGCSimAccumulator::Data::Data ( )
inline

Definition at line 45 of file PHGCSimAccumulator.h.

45 : data_(0) {}
PHGCSimAccumulator::Data::Data ( unsigned short  ei,
unsigned short  si,
unsigned short  d 
)
inline

Definition at line 46 of file PHGCSimAccumulator.h.

46  :
47  data_((ei << energyOffset) | (si << sampleOffset) | d)
48  {}
static constexpr unsigned sampleOffset
static constexpr unsigned energyOffset

Member Function Documentation

unsigned int PHGCSimAccumulator::Data::data ( ) const
inline

Definition at line 52 of file PHGCSimAccumulator.h.

References PHGCSimAccumulator::data_.

52 { return data_ & dataMask; }
static constexpr unsigned dataMask
unsigned int PHGCSimAccumulator::Data::energyIndex ( ) const
inline

Definition at line 50 of file PHGCSimAccumulator.h.

References PHGCSimAccumulator::data_.

50 { return data_ >> energyOffset; }
static constexpr unsigned energyOffset
unsigned int PHGCSimAccumulator::Data::sampleIndex ( ) const
inline

Definition at line 51 of file PHGCSimAccumulator.h.

References PHGCSimAccumulator::data_.

51 { return (data_ >> sampleOffset) & sampleMask; }
static constexpr unsigned sampleMask
static constexpr unsigned sampleOffset

Member Data Documentation

unsigned short PHGCSimAccumulator::Data::data_
private

Definition at line 55 of file PHGCSimAccumulator.h.

constexpr unsigned PHGCSimAccumulator::Data::dataMask = 0x7ff
static

Definition at line 43 of file PHGCSimAccumulator.h.

constexpr unsigned PHGCSimAccumulator::Data::dataOffset = 0
static

Definition at line 42 of file PHGCSimAccumulator.h.

constexpr unsigned PHGCSimAccumulator::Data::energyMask = 0x1
static

Definition at line 39 of file PHGCSimAccumulator.h.

constexpr unsigned PHGCSimAccumulator::Data::energyOffset = 15
static

Definition at line 38 of file PHGCSimAccumulator.h.

constexpr unsigned PHGCSimAccumulator::Data::sampleMask = 0xf
static

Definition at line 41 of file PHGCSimAccumulator.h.

constexpr unsigned PHGCSimAccumulator::Data::sampleOffset = 11
static

Definition at line 40 of file PHGCSimAccumulator.h.