CMS 3D CMS Logo

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

#include <PHGCSimAccumulator.h>

Public Member Functions

const std::vector< unsigned short > & chargeArray () const
 
unsigned int nhits () const
 
unsigned int sampleIndex () const
 
 SimHitCollection ()
 
 SimHitCollection (unsigned int nhits)
 
 SimHitCollection (const unsigned short si, const std::vector< unsigned short > &accCharge, const std::vector< unsigned short > &time)
 
 SimHitCollection (const SimHitCollection &simhitcollection)=default
 
const std::vector< unsigned short > & timeArray () 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

std::vector< unsigned short > chargeArray_
 
unsigned int nhits_
 
std::vector< unsigned short > timeArray_
 

Detailed Description

Definition at line 23 of file PHGCSimAccumulator.h.

Constructor & Destructor Documentation

◆ SimHitCollection() [1/4]

PHGCSimAccumulator::SimHitCollection::SimHitCollection ( )
inline

Definition at line 32 of file PHGCSimAccumulator.h.

32 {}

◆ SimHitCollection() [2/4]

PHGCSimAccumulator::SimHitCollection::SimHitCollection ( unsigned int  nhits)
inline

Definition at line 33 of file PHGCSimAccumulator.h.

◆ SimHitCollection() [3/4]

PHGCSimAccumulator::SimHitCollection::SimHitCollection ( const unsigned short  si,
const std::vector< unsigned short > &  accCharge,
const std::vector< unsigned short > &  time 
)
inline

Definition at line 34 of file PHGCSimAccumulator.h.

References chargeArray_, ztail::d, data, energyOffset, mps_fire::i, nhits_, sampleOffset, protons_cff::time, and timeArray_.

37  : nhits_(accCharge.size()) {
38  chargeArray_.reserve(nhits_);
39  timeArray_.reserve(nhits_);
40  for (size_t i = 0; i < nhits_; ++i) {
41  unsigned short ei = 0;
42  unsigned short d = accCharge[i];
43  unsigned short data = ((ei << energyOffset) | (si << sampleOffset) | d);
44  chargeArray_.emplace_back(data);
45  }
46  for (size_t i = 0; i < nhits_; ++i) {
47  unsigned short ei = 1;
48  unsigned short d = time[i];
49  unsigned short data = ((ei << energyOffset) | (si << sampleOffset) | d);
50  timeArray_.emplace_back(data);
51  }
52  }
std::vector< unsigned short > timeArray_
static constexpr unsigned energyOffset
static constexpr unsigned sampleOffset
d
Definition: ztail.py:151
std::vector< unsigned short > chargeArray_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79

◆ SimHitCollection() [4/4]

PHGCSimAccumulator::SimHitCollection::SimHitCollection ( const SimHitCollection simhitcollection)
default

Member Function Documentation

◆ chargeArray()

const std::vector<unsigned short>& PHGCSimAccumulator::SimHitCollection::chargeArray ( ) const
inline

Definition at line 56 of file PHGCSimAccumulator.h.

References chargeArray_.

Referenced by PHGCSimAccumulator::TmpElem::chargeArray().

56 { return chargeArray_; }
std::vector< unsigned short > chargeArray_

◆ nhits()

unsigned int PHGCSimAccumulator::SimHitCollection::nhits ( ) const
inline

Definition at line 54 of file PHGCSimAccumulator.h.

References nhits_.

Referenced by PHGCSimAccumulator::TmpElem::nhits().

54 { return nhits_; }

◆ sampleIndex()

unsigned int PHGCSimAccumulator::SimHitCollection::sampleIndex ( ) const
inline

Definition at line 55 of file PHGCSimAccumulator.h.

References chargeArray_, sampleMask, and sampleOffset.

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

55 { return (chargeArray_[0] >> sampleOffset) & sampleMask; }
static constexpr unsigned sampleOffset
std::vector< unsigned short > chargeArray_
static constexpr unsigned sampleMask

◆ timeArray()

const std::vector<unsigned short>& PHGCSimAccumulator::SimHitCollection::timeArray ( ) const
inline

Definition at line 57 of file PHGCSimAccumulator.h.

References timeArray_.

Referenced by PHGCSimAccumulator::TmpElem::timeArray().

57 { return timeArray_; }
std::vector< unsigned short > timeArray_

Member Data Documentation

◆ chargeArray_

std::vector<unsigned short> PHGCSimAccumulator::SimHitCollection::chargeArray_
private

Definition at line 61 of file PHGCSimAccumulator.h.

Referenced by chargeArray(), sampleIndex(), and SimHitCollection().

◆ dataMask

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

Definition at line 30 of file PHGCSimAccumulator.h.

◆ dataOffset

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

Definition at line 29 of file PHGCSimAccumulator.h.

◆ energyMask

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

Definition at line 26 of file PHGCSimAccumulator.h.

◆ energyOffset

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

Definition at line 25 of file PHGCSimAccumulator.h.

Referenced by SimHitCollection().

◆ nhits_

unsigned int PHGCSimAccumulator::SimHitCollection::nhits_
private

Definition at line 60 of file PHGCSimAccumulator.h.

Referenced by nhits(), and SimHitCollection().

◆ sampleMask

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

Definition at line 28 of file PHGCSimAccumulator.h.

Referenced by sampleIndex().

◆ sampleOffset

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

Definition at line 27 of file PHGCSimAccumulator.h.

Referenced by sampleIndex(), and SimHitCollection().

◆ timeArray_

std::vector<unsigned short> PHGCSimAccumulator::SimHitCollection::timeArray_
private

Definition at line 62 of file PHGCSimAccumulator.h.

Referenced by SimHitCollection(), and timeArray().