CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t V
void setSaturationFlag(HBHERecHit &rechit, const HBHEDataFrame &digi)
tuple level
Definition: testEve_cfg.py:47
void checkADCSaturation(T &rechit, const V &digi, int level)
long double T