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 = 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 34 of file PMTDSimAccumulator.h.

Constructor & Destructor Documentation

PMTDSimAccumulator::Data::Data ( )
inline

Definition at line 43 of file PMTDSimAccumulator.h.

43 : data_(0) {}
PMTDSimAccumulator::Data::Data ( unsigned short  ei,
unsigned short  si,
unsigned short  d 
)
inline

Definition at line 44 of file PMTDSimAccumulator.h.

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

Member Function Documentation

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

Definition at line 50 of file PMTDSimAccumulator.h.

References PMTDSimAccumulator::data_.

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

Definition at line 48 of file PMTDSimAccumulator.h.

References PMTDSimAccumulator::data_.

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

Definition at line 49 of file PMTDSimAccumulator.h.

References PMTDSimAccumulator::data_.

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

Member Data Documentation

unsigned short PMTDSimAccumulator::Data::data_
private

Definition at line 53 of file PMTDSimAccumulator.h.

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

Definition at line 41 of file PMTDSimAccumulator.h.

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

Definition at line 40 of file PMTDSimAccumulator.h.

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

Definition at line 37 of file PMTDSimAccumulator.h.

Referenced by mtd_digitizer::saveSimHitAccumulator().

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

Definition at line 36 of file PMTDSimAccumulator.h.

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

Definition at line 39 of file PMTDSimAccumulator.h.

Referenced by mtd_digitizer::saveSimHitAccumulator().

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