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

Static Public Attributes

constexpr static unsigned dataMask = 0x7ff
 
constexpr static unsigned dataOffset = 0
 
constexpr static unsigned energyMask = 0x1
 
constexpr static unsigned energyOffset = 15
 
constexpr static unsigned sampleMask = 0xf
 
constexpr static 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.

33 : nhits_(nhits) {}

◆ 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.

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  }

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

◆ 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.

56 { return chargeArray_; }

References chargeArray_.

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

◆ nhits()

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

Definition at line 54 of file PHGCSimAccumulator.h.

54 { return nhits_; }

References nhits_.

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

◆ sampleIndex()

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

Definition at line 55 of file PHGCSimAccumulator.h.

55 { return (chargeArray_[0] >> sampleOffset) & sampleMask; }

References chargeArray_, sampleMask, and sampleOffset.

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

◆ timeArray()

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

Definition at line 57 of file PHGCSimAccumulator.h.

57 { return timeArray_; }

References timeArray_.

Referenced by PHGCSimAccumulator::TmpElem::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 static unsigned PHGCSimAccumulator::SimHitCollection::dataMask = 0x7ff
staticconstexpr

Definition at line 30 of file PHGCSimAccumulator.h.

◆ dataOffset

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

Definition at line 29 of file PHGCSimAccumulator.h.

◆ energyMask

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

Definition at line 26 of file PHGCSimAccumulator.h.

◆ energyOffset

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

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 static unsigned PHGCSimAccumulator::SimHitCollection::sampleMask = 0xf
staticconstexpr

Definition at line 28 of file PHGCSimAccumulator.h.

Referenced by sampleIndex().

◆ sampleOffset

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

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().

PHGCSimAccumulator::SimHitCollection::chargeArray_
std::vector< unsigned short > chargeArray_
Definition: PHGCSimAccumulator.h:61
mps_fire.i
i
Definition: mps_fire.py:355
PHGCSimAccumulator::SimHitCollection::timeArray_
std::vector< unsigned short > timeArray_
Definition: PHGCSimAccumulator.h:62
PHGCSimAccumulator::SimHitCollection::sampleOffset
constexpr static unsigned sampleOffset
Definition: PHGCSimAccumulator.h:27
PHGCSimAccumulator::SimHitCollection::energyOffset
constexpr static unsigned energyOffset
Definition: PHGCSimAccumulator.h:25
PHGCSimAccumulator::SimHitCollection::sampleMask
constexpr static unsigned sampleMask
Definition: PHGCSimAccumulator.h:28
PHGCSimAccumulator::SimHitCollection::nhits
unsigned int nhits() const
Definition: PHGCSimAccumulator.h:54
PHGCSimAccumulator::SimHitCollection::nhits_
unsigned int nhits_
Definition: PHGCSimAccumulator.h:60
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
ztail.d
d
Definition: ztail.py:151
ntuplemaker.time
time
Definition: ntuplemaker.py:310