FACT++  1.0
void RawDataViewer::computePulsesStatistics ( )

{

Definition at line 1006 of file RawEventsViewer.cc.

References aMeas, eventData, i, inputFile, n1mean, nRoi, selectedPixel, and vCorr.

1007 {
1008  if (!inputFile)
1009  {
1010  cout << "A FITS file must be open in order to complete this operation" << endl;
1011  return;
1012  }
1013 
1014 
1015 // for (int i=0;i<nRows;i++)//for all events
1016 // {
1017 // inputFile->GetRow(rowNum);
1018 // for (int i=0;i<(1440+160)*nRoi;i++)
1019 // eventData[i] = (float)rawEventData[i];
1020 
1021 // for (int j=0;j<ACTUAL_NUM_PIXELS;j++)
1023  int j = selectedPixel;
1024  if (j == -1)
1025  return;
1026  for (int i=0;i<nRoi;i++)
1027  {
1028  aMeas[i] = eventData[j*nRoi+i];// * adcCount;
1029 
1030  }
1031  for (int i=0;i<nRoi;i++)
1032  {
1033  if (i==0)
1034  n1mean[i] = aMeas[i+1];
1035  else
1036  {
1037  if (i==1023)
1038  n1mean[i] = aMeas[i-1];
1039  else
1040  n1mean[i] = (aMeas[i-1]+aMeas[i+1])/2.f;
1041  }
1042  }
1043  //find spike
1044  for (int i=0;i<nRoi-3;i++)
1045  {
1046  const float fract = 0.8f;
1047  float xx, xp, xpp;
1048  vCorr[i] = 0;//aMeas[i];
1049  xx = aMeas[i] - n1mean[i];
1050  if (xx < -8.f)
1051  {
1052  xp = aMeas[i+1] - n1mean[i+1];
1053  xpp = aMeas[i+2] - n1mean[i+2];
1054  if ((aMeas[i+2] - (aMeas[i] + aMeas[i+3])/2.f) > 10.f)
1055  {
1056  vCorr[i+1] = (aMeas[i] + aMeas[i+3])/2.f;
1057  vCorr[i+2] = (aMeas[i] + aMeas[i+3])/2.f;
1058  i = i+2;
1059  }
1060  else
1061  {
1062  if ((xp > -2.*xx*fract) && (xpp < -10.f))
1063  {
1064  vCorr[i+1] = n1mean[i+1];
1065  n1mean[i+2] = aMeas[i+1] - aMeas[i+3]/2.f;
1066  i++;
1067  }
1068  }
1069  }
1070  }
1071  for (int i=0;i<nRoi;i++)
1072  n1mean[i] = aMeas[i]-n1mean[i];
1073  // }
1074  // }
1075 }
int i
Definition: db_dim_client.c:21
double aMeas[1024]
double vCorr[1024]
double n1mean[1024]