FACT++  1.0
static double DrsCalibrate::FindStep ( const size_t  ch0,
const float *  vec,
int16_t  roi,
const int16_t  pos,
const uint16_t *  map = NULL 
)
inlinestatic

Definition at line 424 of file DrsCalib.h.

Referenced by CorrectStep().

425  {
426  // We have about 1% of all cases which are not ahndled here,
427  // because the baseline jumps up just before the readout window
428  // and down just after it. In this cases we could determine the jump
429  // from the board time difference or throw the event away.
430  if (pos==0 || pos>=roi)
431  return 0;
432 
433  double step = 0; // before
434  double rms = 0; // before
435  int cnt = 0;
436 
437  // Exclude TM channel
438  for (int p=0; p<8; p++)
439  {
440  const size_t hw = ch0+p;
441  const size_t sw = (map?map[hw]:hw)*roi + pos;
442 
443  const double diff = vec[sw]-vec[sw-1];
444 
445  step += diff;
446  rms += (vec[sw]-vec[sw-1])*(vec[sw]-vec[sw-1]);
447 
448  cnt++;
449  }
450 
451  return cnt==0 ? 0 : step/cnt;
452  }

+ Here is the caller graph for this function: