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.

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

3  {
4  for (int i = 0; i < 32; ++i)
5  qadcraw_[i] = 0;
6  attenuator1_ = 0;
7  attenuator2_ = 0;
8  selector_ = 0;
9 }
int32_t attenuator2_
Definition: HcalLaserDigi.h:26
uint16_t qadcraw_[32]
Definition: HcalLaserDigi.h:24
int32_t selector_
Definition: HcalLaserDigi.h:27
int32_t attenuator1_
Definition: HcalLaserDigi.h:26

Member Function Documentation

◆ addTDCHit()

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

Definition at line 16 of file HcalLaserDigi.cc.

References tdcraw_.

Referenced by HcalLaserUnpacker::unpack().

16  {
17  uint32_t packed = (hittime & 0xFFFFFF) | ((channel & 0xFF) << 24);
18  tdcraw_.push_back(packed);
19 }
std::vector< uint32_t > tdcraw_
Definition: HcalLaserDigi.h:25

◆ attenuator1()

int HcalLaserDigi::attenuator1 ( ) const
inline

Definition at line 19 of file HcalLaserDigi.h.

References attenuator1_.

19 { return attenuator1_; }
int32_t attenuator1_
Definition: HcalLaserDigi.h:26

◆ attenuator2()

int HcalLaserDigi::attenuator2 ( ) const
inline

Definition at line 20 of file HcalLaserDigi.h.

References attenuator2_.

20 { return attenuator2_; }
int32_t attenuator2_
Definition: HcalLaserDigi.h:26

◆ hitChannel()

int HcalLaserDigi::hitChannel ( size_t  ihit) const

Definition at line 21 of file HcalLaserDigi.cc.

References tdcraw_.

21  {
22  if (ihit < tdcraw_.size())
23  return tdcraw_[ihit] >> 24;
24  else
25  return -1;
26 }
std::vector< uint32_t > tdcraw_
Definition: HcalLaserDigi.h:25

◆ hitNS()

double HcalLaserDigi::hitNS ( size_t  ihit) const

Definition at line 35 of file HcalLaserDigi.cc.

References hitRaw().

35 { return hitRaw(ihit) * 0.8; }
int hitRaw(size_t ihit) const

◆ hitRaw()

int HcalLaserDigi::hitRaw ( size_t  ihit) const

Definition at line 28 of file HcalLaserDigi.cc.

References tdcraw_.

Referenced by hitNS().

28  {
29  if (ihit < tdcraw_.size())
30  return tdcraw_[ihit] & 0xFFFFFF;
31  else
32  return -1;
33 }
std::vector< uint32_t > tdcraw_
Definition: HcalLaserDigi.h:25

◆ qadc()

uint16_t HcalLaserDigi::qadc ( int  i) const
inline

Definition at line 12 of file HcalLaserDigi.h.

References mps_fire::i, and qadcraw_.

12 { return ((i >= 0 && i < 32) ? (qadcraw_[i]) : (0)); }
uint16_t qadcraw_[32]
Definition: HcalLaserDigi.h:24

◆ selector()

int HcalLaserDigi::selector ( void  ) const
inline

Definition at line 21 of file HcalLaserDigi.h.

References selector_.

21 { return selector_; }
int32_t selector_
Definition: HcalLaserDigi.h:27

◆ setLaserControl()

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

Definition at line 37 of file HcalLaserDigi.cc.

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

37  {
38  attenuator1_ = att1;
39  attenuator2_ = att2;
40  selector_ = select;
41 }
int32_t attenuator2_
Definition: HcalLaserDigi.h:26
int32_t selector_
Definition: HcalLaserDigi.h:27
int32_t attenuator1_
Definition: HcalLaserDigi.h:26

◆ setQADC()

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

Definition at line 11 of file HcalLaserDigi.cc.

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

Referenced by HcalLaserUnpacker::unpack().

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

◆ tdcHits()

size_t HcalLaserDigi::tdcHits ( ) const
inline

Definition at line 14 of file HcalLaserDigi.h.

References tdcraw_.

14 { return tdcraw_.size(); }
std::vector< uint32_t > tdcraw_
Definition: HcalLaserDigi.h:25

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