CMS 3D CMS Logo

HcalLaserDigi.cc
Go to the documentation of this file.
2 
4  for (int i = 0; i < 32; ++i)
5  qadcraw_[i] = 0;
6  attenuator1_ = 0;
7  attenuator2_ = 0;
8  selector_ = 0;
9 }
10 
11 void HcalLaserDigi::setQADC(const std::vector<uint16_t>& values) {
12  for (size_t i = 0; i < values.size() && i < 32; ++i)
13  qadcraw_[i] = values[i];
14 }
15 
16 void HcalLaserDigi::addTDCHit(int channel, int hittime) {
17  uint32_t packed = (hittime & 0xFFFFFF) | ((channel & 0xFF) << 24);
18  tdcraw_.push_back(packed);
19 }
20 
21 int HcalLaserDigi::hitChannel(size_t ihit) const {
22  if (ihit < tdcraw_.size())
23  return tdcraw_[ihit] >> 24;
24  else
25  return -1;
26 }
27 
28 int HcalLaserDigi::hitRaw(size_t ihit) const {
29  if (ihit < tdcraw_.size())
30  return tdcraw_[ihit] & 0xFFFFFF;
31  else
32  return -1;
33 }
34 
35 double HcalLaserDigi::hitNS(size_t ihit) const { return hitRaw(ihit) * 0.8; }
36 
37 void HcalLaserDigi::setLaserControl(int att1, int att2, int select) {
38  attenuator1_ = att1;
39  attenuator2_ = att2;
40  selector_ = select;
41 }
void setLaserControl(int att1, int att2, int select)
int32_t attenuator2_
Definition: HcalLaserDigi.h:26
void addTDCHit(int channel, int hittime)
uint16_t qadcraw_[32]
Definition: HcalLaserDigi.h:24
int hitRaw(size_t ihit) const
void setQADC(const std::vector< uint16_t > &values)
std::vector< uint32_t > tdcraw_
Definition: HcalLaserDigi.h:25
double hitNS(size_t ihit) const
int32_t selector_
Definition: HcalLaserDigi.h:27
int hitChannel(size_t ihit) const
int32_t attenuator1_
Definition: HcalLaserDigi.h:26