CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalCalibrationQIECoder.cc
Go to the documentation of this file.
1 
8 #include <iostream>
9 
11 
12 float HcalCalibrationQIECoder::charge (unsigned fAdc) const {
13  const float* data = base ();
14  if (fAdc >= 31) return (3*data[31]-data[30])/2.; // extrapolation
15  return (data[fAdc]+data[fAdc+1])/2;
16 }
17 
18 unsigned HcalCalibrationQIECoder::adc (float fCharge) const {
19  const float* data = base ();
20  unsigned adc = 1;
21  for (; adc < 32; adc++) {
22  if (fCharge < data[adc]) return adc-1;
23  }
24  return 31; // overflow
25 }
26 
27 float HcalCalibrationQIECoder::minCharge (unsigned fBin) const {
28  const float* data = base ();
29  return fBin < 32 ? data[fBin] : data[31];
30 }
31 
32 const float* HcalCalibrationQIECoder::minCharges () const {
33  const float* data = base ();
34  return data;
35 }
36 
37 
38 void HcalCalibrationQIECoder::setMinCharge (unsigned fBin, float fValue) {
39  float* data = base ();
40  if (fBin < 32) data [fBin] = fValue;
41 }
42 
43 void HcalCalibrationQIECoder::setMinCharges (const float fValue [32]) {
44  float* data = base ();
45  for (int i = 0; i < 32; i++) data[i] = fValue[i];
46 }
int i
Definition: DBlmapReader.cc:9
float minCharge(unsigned fBin) const
float charge(const unsigned fAdc) const
ADC [0..31] -&gt; fC conversion.
unsigned adc(const float fCharge) const
fC -&gt; ADC conversion
void setMinCharges(const float fValue[32])
const float * base() const
void setMinCharge(unsigned fBin, float fValue)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
const float * minCharges() const