CMS 3D CMS Logo

HcalAlgoUtils.cc
Go to the documentation of this file.
2 #include <cmath>
3 
4 void getLinearizedADC(const HcalQIEShape& shape,
5  const HcalQIECoder* coder,
6  int bins,int capid,
7  float& lo,
8  float& hi){
9 
10  float low = coder->charge(shape,0,capid);
11  float high = coder->charge(shape,bins-1,capid);
12  float step = (high-low)/(bins-1);
13  low -= step/2.0; high += step/2.0;
14  lo = low; hi = high;
15  return;
16 }
17 
18 float maxDiff(float one, float two, float three, float four){
19  float max=-1000; float min = 1000;
20  if(one>max) max = one;
21  if(one<min) min = one;
22  if(two>max) max = two;
23  if(two<min) min = two;
24  if(three>max) max = three;
25  if(three<min) min = three;
26  if(four>max) max = four;
27  if(four<min) min = four;
28  return fabs(max-min);
29 }
float maxDiff(float one, float two, float three, float four)
void getLinearizedADC(const HcalQIEShape &shape, const HcalQIECoder *coder, int bins, int capid, float &lo, float &hi)
Definition: HcalAlgoUtils.cc:4
T min(T a, T b)
Definition: MathUtil.h:58
step
float charge(const HcalQIEShape &fShape, unsigned fAdc, unsigned fCapId) const
ADC [0..127] + capid [0..3] -> fC conversion.
Definition: HcalQIECoder.cc:22