CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HcalLaserDigi Class Reference

#include <HcalLaserDigi.h>

Public Member Functions

void addTDCHit (int channel, int hittime)
 
int attenuator1 () const
 
int attenuator2 () const
 
 HcalLaserDigi ()
 
int hitChannel (size_t ihit) const
 
double hitNS (size_t ihit) const
 
int hitRaw (size_t ihit) const
 
uint16_t qadc (int i) const
 
int selector () const
 
void setLaserControl (int att1, int att2, int select)
 
void setQADC (const std::vector< uint16_t > &values)
 
size_t tdcHits () const
 

Private Attributes

int32_t attenuator1_
 
int32_t attenuator2_
 
uint16_t qadcraw_ [32]
 
int32_t selector_
 
std::vector< uint32_t > tdcraw_
 

Detailed Description

Definition at line 8 of file HcalLaserDigi.h.

Constructor & Destructor Documentation

◆ HcalLaserDigi()

HcalLaserDigi::HcalLaserDigi ( )

Definition at line 3 of file HcalLaserDigi.cc.

3  {
4  for (int i = 0; i < 32; ++i)
5  qadcraw_[i] = 0;
6  attenuator1_ = 0;
7  attenuator2_ = 0;
8  selector_ = 0;
9 }

References attenuator1_, attenuator2_, mps_fire::i, qadcraw_, and selector_.

Member Function Documentation

◆ addTDCHit()

void HcalLaserDigi::addTDCHit ( int  channel,
int  hittime 
)

Definition at line 16 of file HcalLaserDigi.cc.

16  {
17  uint32_t packed = (hittime & 0xFFFFFF) | ((channel & 0xFF) << 24);
18  tdcraw_.push_back(packed);
19 }

References tdcraw_.

Referenced by HcalLaserUnpacker::unpack().

◆ attenuator1()

int HcalLaserDigi::attenuator1 ( ) const
inline

Definition at line 19 of file HcalLaserDigi.h.

19 { return attenuator1_; }

References attenuator1_.

◆ attenuator2()

int HcalLaserDigi::attenuator2 ( ) const
inline

Definition at line 20 of file HcalLaserDigi.h.

20 { return attenuator2_; }

References attenuator2_.

◆ hitChannel()

int HcalLaserDigi::hitChannel ( size_t  ihit) const

Definition at line 21 of file HcalLaserDigi.cc.

21  {
22  if (ihit < tdcraw_.size())
23  return tdcraw_[ihit] >> 24;
24  else
25  return -1;
26 }

References tdcraw_.

◆ hitNS()

double HcalLaserDigi::hitNS ( size_t  ihit) const

Definition at line 35 of file HcalLaserDigi.cc.

35 { return hitRaw(ihit) * 0.8; }

References hitRaw().

◆ hitRaw()

int HcalLaserDigi::hitRaw ( size_t  ihit) const

Definition at line 28 of file HcalLaserDigi.cc.

28  {
29  if (ihit < tdcraw_.size())
30  return tdcraw_[ihit] & 0xFFFFFF;
31  else
32  return -1;
33 }

References tdcraw_.

Referenced by hitNS().

◆ qadc()

uint16_t HcalLaserDigi::qadc ( int  i) const
inline

Definition at line 12 of file HcalLaserDigi.h.

12 { return ((i >= 0 && i < 32) ? (qadcraw_[i]) : (0)); }

References mps_fire::i, and qadcraw_.

◆ selector()

int HcalLaserDigi::selector ( void  ) const
inline

Definition at line 21 of file HcalLaserDigi.h.

21 { return selector_; }

References selector_.

◆ setLaserControl()

void HcalLaserDigi::setLaserControl ( int  att1,
int  att2,
int  select 
)

Definition at line 37 of file HcalLaserDigi.cc.

37  {
38  attenuator1_ = att1;
39  attenuator2_ = att2;
40  selector_ = select;
41 }

References attenuator1_, attenuator2_, singleTopDQM_cfi::select, and selector_.

◆ setQADC()

void HcalLaserDigi::setQADC ( const std::vector< uint16_t > &  values)

Definition at line 11 of file HcalLaserDigi.cc.

11  {
12  for (size_t i = 0; i < values.size() && i < 32; ++i)
13  qadcraw_[i] = values[i];
14 }

References mps_fire::i, qadcraw_, and contentValuesCheck::values.

Referenced by HcalLaserUnpacker::unpack().

◆ tdcHits()

size_t HcalLaserDigi::tdcHits ( ) const
inline

Definition at line 14 of file HcalLaserDigi.h.

14 { return tdcraw_.size(); }

References tdcraw_.

Member Data Documentation

◆ attenuator1_

int32_t HcalLaserDigi::attenuator1_
private

Definition at line 26 of file HcalLaserDigi.h.

Referenced by attenuator1(), HcalLaserDigi(), and setLaserControl().

◆ attenuator2_

int32_t HcalLaserDigi::attenuator2_
private

Definition at line 26 of file HcalLaserDigi.h.

Referenced by attenuator2(), HcalLaserDigi(), and setLaserControl().

◆ qadcraw_

uint16_t HcalLaserDigi::qadcraw_[32]
private

Definition at line 24 of file HcalLaserDigi.h.

Referenced by HcalLaserDigi(), qadc(), and setQADC().

◆ selector_

int32_t HcalLaserDigi::selector_
private

Definition at line 27 of file HcalLaserDigi.h.

Referenced by HcalLaserDigi(), selector(), and setLaserControl().

◆ tdcraw_

std::vector<uint32_t> HcalLaserDigi::tdcraw_
private

Definition at line 25 of file HcalLaserDigi.h.

Referenced by addTDCHit(), hitChannel(), hitRaw(), and tdcHits().

mps_fire.i
i
Definition: mps_fire.py:428
HcalLaserDigi::attenuator1_
int32_t attenuator1_
Definition: HcalLaserDigi.h:26
singleTopDQM_cfi.select
select
Definition: singleTopDQM_cfi.py:50
HcalLaserDigi::qadcraw_
uint16_t qadcraw_[32]
Definition: HcalLaserDigi.h:24
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
HcalLaserDigi::attenuator2_
int32_t attenuator2_
Definition: HcalLaserDigi.h:26
HcalLaserDigi::hitRaw
int hitRaw(size_t ihit) const
Definition: HcalLaserDigi.cc:28
HcalLaserDigi::tdcraw_
std::vector< uint32_t > tdcraw_
Definition: HcalLaserDigi.h:25
HcalLaserDigi::selector_
int32_t selector_
Definition: HcalLaserDigi.h:27