CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/CalibCalorimetry/HcalAlgos/src/HcalAlgoUtils.cc File Reference

#include "CalibCalorimetry/HcalAlgos/interface/HcalAlgoUtils.h"
#include <math.h>

Go to the source code of this file.

Functions

void getLinearizedADC (const HcalQIEShape &shape, const HcalQIECoder *coder, int bins, int capid, float &lo, float &hi)
float maxDiff (float one, float two, float three, float four)

Function Documentation

void getLinearizedADC ( const HcalQIEShape shape,
const HcalQIECoder coder,
int  bins,
int  capid,
float &  lo,
float &  hi 
)

Definition at line 4 of file HcalAlgoUtils.cc.

References HcalQIECoder::charge(), and launcher::step.

                                {
  
  float low = coder->charge(shape,0,capid); 
  float high = coder->charge(shape,bins-1,capid);
  float step = (high-low)/(bins-1);
  low -= step/2.0; high += step/2.0;
  lo = low; hi = high;
  return;
}
float maxDiff ( float  one,
float  two,
float  three,
float  four 
)

Definition at line 18 of file HcalAlgoUtils.cc.

References max(), and min.

                                                            {
  float max=-1000; float min = 1000;
  if(one>max) max = one;      if(one<min) min = one;
  if(two>max) max = two;      if(two<min) min = two;
  if(three>max) max = three;  if(three<min) min = three;
  if(four>max) max = four;    if(four<min) min = four;
  return fabs(max-min);
}