FACT++  1.0
static double DrsCalibrate::GetPixelStats ( float *  ptr,
const float *  data,
uint16_t  roi,
uint16_t  begskip = 0,
uint16_t  endskip = 0 
)
inlinestatic

Definition at line 855 of file DrsCalib.h.

References end, i, and DrsCalibrate::Step::pos.

Referenced by EventBuilderWrapper::applyCalib(), and RawDataViewer::ApplyCalibration().

856  {
857  if (roi==0)
858  return -1;
859 
860  // Skip first 10 samples
861  const uint beg = roi>begskip ? begskip : 0;
862  const uint end = roi-beg>endskip ? roi-endskip : roi;
863  const uint len = end-beg;
864 
865  double max = 0;
866  double patch = 0;
867  for (uint i=0; i<1440; i++)
868  {
869  const float *vec = data+i*roi;
870 
871  uint pos = beg;
872  double sum = vec[beg];
873  double sum2 = vec[beg]*vec[beg];
874 
875  for (uint j=beg+1; j<end; j++)
876  {
877  sum += vec[j];
878  sum2 += vec[j]*vec[j];
879 
880  if (vec[j]>vec[pos])
881  pos = j;
882  }
883  sum /= len;
884  sum2 /= len;
885  sum2 -= sum*sum;
886 
887  if (i%9!=8)
888  patch += vec[pos];
889  else
890  {
891  if (patch > max)
892  max = patch;
893  patch = 0;
894  }
895 
896  *(ptr+0*1440+i) = sum;
897  *(ptr+1*1440+i) = sum2<0 ? 0 : sqrt(sum2);
898  *(ptr+2*1440+i) = vec[pos];
899  *(ptr+3*1440+i) = pos;
900  }
901 
902  return max/8;
903  }
int i
Definition: db_dim_client.c:21
double end
float data[4 *1440]

+ Here is the caller graph for this function: