CMS 3D CMS Logo

HcalADCSaturationFlag.cc
Go to the documentation of this file.
3 
4 namespace HcalSaturation {
5  // Template class that loops over digi collection, sets rechit
6  // saturation status bit on if ADC count is >= SaturationLevel_;
7 
8  template <class T, class V>
9  void checkADCSaturation(T& rechit, const V& digi, int level) {
10  // Loop over digi
11  for (int i = 0; i < digi.size(); ++i) {
12  if (digi.sample(i).adc() >= level) {
13  rechit.setFlagField(1, HcalCaloFlagLabels::ADCSaturationBit);
14  break;
15  }
16  }
17  return;
18  }
19 } // namespace HcalSaturation
20 
21 using namespace HcalSaturation;
22 
24  SaturationLevel_ = 127; // default saturation level (7-bit QIE)
25 }
26 
28  SaturationLevel_ = level; // allow user to specify saturation level
29 }
30 
32 
34  checkADCSaturation<HBHERecHit, HBHEDataFrame>(rechit, digi, SaturationLevel_);
35  return;
36 }
37 
39  checkADCSaturation<HORecHit, HODataFrame>(rechit, digi, SaturationLevel_);
40  return;
41 }
42 
44  checkADCSaturation<HFRecHit, HFDataFrame>(rechit, digi, SaturationLevel_);
45  return;
46 }
47 
49  checkADCSaturation<ZDCRecHit, ZDCDataFrame>(rechit, digi, SaturationLevel_);
50  return;
51 }
personalPlayback.level
level
Definition: personalPlayback.py:22
cms::cuda::V
cudaStream_t T uint32_t const T *__restrict__ const uint32_t *__restrict__ uint32_t int cudaStream_t V
Definition: HistoContainer.h:99
mps_fire.i
i
Definition: mps_fire.py:428
HcalADCSaturationFlag::HcalADCSaturationFlag
HcalADCSaturationFlag()
Definition: HcalADCSaturationFlag.cc:23
HORecHit
Definition: HORecHit.h:11
HBHERecHit
Definition: HBHERecHit.h:13
HcalADCSaturationFlag::~HcalADCSaturationFlag
~HcalADCSaturationFlag()
Definition: HcalADCSaturationFlag.cc:31
HcalADCSaturationFlag.h
HcalCaloFlagLabels::ADCSaturationBit
Definition: HcalCaloFlagLabels.h:53
HFRecHit
Definition: HFRecHit.h:11
HcalADCSaturationFlag::setSaturationFlag
void setSaturationFlag(HBHERecHit &rechit, const HBHEDataFrame &digi)
Definition: HcalADCSaturationFlag.cc:33
ZDCDataFrame
Definition: ZDCDataFrame.h:15
HBHEDataFrame
Definition: HBHEDataFrame.h:14
HcalCaloFlagLabels.h
HFDataFrame
Definition: HFDataFrame.h:14
HcalSaturation::checkADCSaturation
void checkADCSaturation(T &rechit, const V &digi, int level)
Definition: HcalADCSaturationFlag.cc:9
T
long double T
Definition: Basic3DVectorLD.h:48
HODataFrame
Definition: HODataFrame.h:14
ZDCRecHit
Definition: ZDCRecHit.h:11
HcalSaturation
Definition: HcalADCSaturationFlag.cc:4