CMS 3D CMS Logo

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

#include <PMTDSimAccumulator.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 = 0xffff
 
static constexpr unsigned energyMask = 0x3
 
static constexpr unsigned energyOffset = 4
 
static constexpr unsigned sampleMask = 0xf
 

Private Attributes

unsigned short data_
 
unsigned char indices_
 

Detailed Description

Definition at line 30 of file PMTDSimAccumulator.h.

Constructor & Destructor Documentation

◆ Data() [1/2]

PMTDSimAccumulator::Data::Data ( )
inline

Definition at line 37 of file PMTDSimAccumulator.h.

37 : data_(0), indices_(0) {}

◆ Data() [2/2]

PMTDSimAccumulator::Data::Data ( unsigned short  ei,
unsigned short  si,
unsigned short  d 
)
inline

Definition at line 38 of file PMTDSimAccumulator.h.

38 : data_(d), indices_((ei << energyOffset) | si) {}
static constexpr unsigned energyOffset
d
Definition: ztail.py:151

Member Function Documentation

◆ data()

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

Definition at line 42 of file PMTDSimAccumulator.h.

References data_, and dataMask.

Referenced by PMTDSimAccumulator::TmpElem::data().

42 { return data_ & dataMask; }
static constexpr unsigned dataMask

◆ energyIndex()

unsigned int PMTDSimAccumulator::Data::energyIndex ( ) const
inline

Definition at line 40 of file PMTDSimAccumulator.h.

References energyOffset, and indices_.

Referenced by PMTDSimAccumulator::TmpElem::energyIndex().

40 { return indices_ >> energyOffset; }
static constexpr unsigned energyOffset

◆ sampleIndex()

unsigned int PMTDSimAccumulator::Data::sampleIndex ( ) const
inline

Definition at line 41 of file PMTDSimAccumulator.h.

References indices_, and sampleMask.

Referenced by PMTDSimAccumulator::TmpElem::sampleIndex().

41 { return indices_ & sampleMask; }
static constexpr unsigned sampleMask

Member Data Documentation

◆ data_

unsigned short PMTDSimAccumulator::Data::data_
private

Definition at line 45 of file PMTDSimAccumulator.h.

Referenced by data().

◆ dataMask

constexpr unsigned PMTDSimAccumulator::Data::dataMask = 0xffff
static

◆ energyMask

constexpr unsigned PMTDSimAccumulator::Data::energyMask = 0x3
static

◆ energyOffset

constexpr unsigned PMTDSimAccumulator::Data::energyOffset = 4
static

Definition at line 32 of file PMTDSimAccumulator.h.

Referenced by energyIndex().

◆ indices_

unsigned char PMTDSimAccumulator::Data::indices_
private

Definition at line 46 of file PMTDSimAccumulator.h.

Referenced by energyIndex(), and sampleIndex().

◆ sampleMask

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