CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/DataFormats/HcalDigi/src/HcalLaserDigi.cc

Go to the documentation of this file.
00001 #include "DataFormats/HcalDigi/interface/HcalLaserDigi.h"
00002 
00003 HcalLaserDigi::HcalLaserDigi() {
00004   for (int i=0; i<32; ++i) qadcraw_[i]=0;
00005   attenuator1_=0;
00006   attenuator2_=0;
00007   selector_=0;
00008 }
00009 
00010 void HcalLaserDigi::setQADC(const std::vector<uint16_t>& values) {
00011   for (size_t  i=0; i<values.size() && i<32; ++i)
00012     qadcraw_[i]=values[i];
00013 }
00014 
00015 void HcalLaserDigi::addTDCHit(int channel, int hittime) {
00016   uint32_t packed=(hittime&0xFFFFFF)|((channel&0xFF)<<24);
00017   tdcraw_.push_back(packed);
00018 }
00019 
00020 int HcalLaserDigi::hitChannel(size_t ihit) const {
00021   if (ihit<tdcraw_.size()) return tdcraw_[ihit]>>24;
00022   else return -1;
00023 }
00024 
00025 int HcalLaserDigi::hitRaw(size_t ihit) const {
00026   if (ihit<tdcraw_.size()) return tdcraw_[ihit]&0xFFFFFF;
00027   else return -1;
00028 }
00029 
00030 double HcalLaserDigi::hitNS(size_t ihit) const {
00031   return hitRaw(ihit)*0.8;
00032 }
00033 
00034 void HcalLaserDigi::setLaserControl(int att1, int att2, int select) {
00035   attenuator1_=att1;
00036   attenuator2_=att2;
00037   selector_=select;
00038 }