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 28 of file PHGCSimAccumulator.h.

Constructor & Destructor Documentation

PHGCSimAccumulator::Data::Data ( )
inline

Definition at line 37 of file PHGCSimAccumulator.h.

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

Definition at line 38 of file PHGCSimAccumulator.h.

38  :
39  data_((ei << energyOffset) | (si << sampleOffset) | d)
40  {}
static constexpr unsigned sampleOffset
static constexpr unsigned energyOffset

Member Function Documentation

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

Definition at line 44 of file PHGCSimAccumulator.h.

References PHGCSimAccumulator::data_.

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

Definition at line 42 of file PHGCSimAccumulator.h.

References PHGCSimAccumulator::data_.

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

Definition at line 43 of file PHGCSimAccumulator.h.

References PHGCSimAccumulator::data_.

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

Member Data Documentation

unsigned short PHGCSimAccumulator::Data::data_
private

Definition at line 47 of file PHGCSimAccumulator.h.

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

Definition at line 35 of file PHGCSimAccumulator.h.

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

Definition at line 34 of file PHGCSimAccumulator.h.

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

Definition at line 31 of file PHGCSimAccumulator.h.

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

Definition at line 30 of file PHGCSimAccumulator.h.

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

Definition at line 33 of file PHGCSimAccumulator.h.

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

Definition at line 32 of file PHGCSimAccumulator.h.