CMS 3D CMS Logo

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