FACT++  1.0
void UIConnector::pixelChanged ( int  pixel)
slot

Definition at line 1986 of file RawEventsViewer.cc.

References PixelMapEntry::board(), PixelMapEntry::crate(), i, PixelMapEntry::index, PixelMapEntry::patch(), PixelMapEntry::pixel(), xval, and yval.

1987 {
1988  RMS_window->fWhite = pixel;
1989  Mean_window->fWhite = pixel;
1990  Max_window->fWhite = pixel;
1991  PosOfMax_window->fWhite = pixel;
1992  if (pixel != -1)
1993  {
1994  RMS_window->fWhitePatch = RMS_window->pixelsPatch[pixel];
1995  Mean_window->fWhitePatch = Mean_window->pixelsPatch[pixel];
1996  Max_window->fWhitePatch = Max_window->pixelsPatch[pixel];
1997  PosOfMax_window->fWhitePatch = PosOfMax_window->pixelsPatch[pixel];
1998  }
1999  else
2000  {
2001  RMS_window->fWhitePatch = -1;
2002  Mean_window->fWhitePatch = -1;
2003  Max_window->fWhitePatch = -1;
2004  PosOfMax_window->fWhitePatch = -1;
2005  }
2006  if (pixel == -1)
2007  return;
2008  int softwarePix = pixel;
2009 // if (!GLWindow->_softwareOrdering)
2010  pixel = GLWindow->hardwareMapping[pixel];
2011 
2012  HwIDBox->setValue(pixel);
2013 
2014  if (!GLWindow->nRoi)
2015  return;
2016 
2017 int currentPixel = pixel;
2018 
2019  for (int i=0;i<GLWindow->nRoi;i++)
2020  {
2021  xval[i] = i;
2022  yval[i] = GLWindow->eventData[GLWindow->nRoi*currentPixel + i];
2023  }
2024 
2025 
2026 int realNumSamples = GLWindow->nRoi;
2027  if (GLWindow->nRoiTM != 0)
2028  {
2029  const PixelMapEntry& mapEntry = GLWindow->fPixelMap.index(softwarePix);
2030  const int pixelIdInPatch = mapEntry.pixel();
2031  const int patchId = mapEntry.patch();
2032  const int boardId = mapEntry.board();
2033  const int crateId = mapEntry.crate();
2034  if (pixelIdInPatch == 8)
2035  {
2036  int TMIndex = 0;
2037  int xIndex = GLWindow->nRoi;
2038  int arrayIndex = GLWindow->nRoi;
2039  if (GLWindow->offSetRoi < 0)
2040  TMIndex -= GLWindow->offSetRoi;
2041  if (GLWindow->offSetRoi > 0)
2042  xIndex += GLWindow->offSetRoi;
2043  for (int i=TMIndex;i<GLWindow->nRoiTM;i++, xIndex++, arrayIndex++)
2044  {
2045  xval[arrayIndex] = xIndex;
2046  yval[arrayIndex] = GLWindow->eventData[GLWindow->nRoi*1440 + GLWindow->nRoiTM*(40*crateId + 4*boardId + patchId) + i];
2047  }
2048  realNumSamples += GLWindow->nRoiTM - TMIndex;
2049  }
2050  // cout << pixelIdInPatch << " " ;
2051  }
2052 
2053 #if QWT_VERSION < 0x060000
2054  pixelValueCurveItem.setData(xval, yval, realNumSamples);
2055 #else
2056  pixelValueCurveItem.setSamples(xval, yval, realNumSamples);
2057 #endif
2058 
2059 //now compute the average value of all pixels
2060  currentPixel = 0;
2061  for (int i=0;i<GLWindow->nRoi;i++)
2062  yval[i] = 0;
2063  for (int j=0;j<1440;j++) {
2064  currentPixel = j;
2065  for (int i=0;i<GLWindow->nRoi;i++)
2066  {
2067  xval[i] = i;
2068  yval[i] += GLWindow->eventData[GLWindow->nRoi*currentPixel + i];
2069  }
2070  }
2071  for (int i=0;i<GLWindow->nRoi;i++)
2072  yval[i] /= 1440;
2073 #if QWT_VERSION < 0x060000
2074  pixelAverageCurveItem.setData(xval, yval, GLWindow->nRoi);
2075 #else
2076  pixelAverageCurveItem.setSamples(xval, yval, realNumSamples);
2077 #endif
2078 
2079  QStack< QRectF > stack;
2080  stack.push(scaleBoundingRectangle(pixelValueCurveItem.boundingRect(), 1.5f));
2081  curveZoom->setZoomBase(scaleBoundingRectangle(pixelValueCurveItem.boundingRect(), 1.5f));
2082  curveZoom->setZoomStack(stack);
2083  stack.pop();
2084  stack.push(scaleBoundingRectangle(pixelAverageCurveItem.boundingRect(), 1.5f));
2085  averageCurveZoom->setZoomBase(scaleBoundingRectangle(pixelAverageCurveItem.boundingRect(), 1.5f));
2086  averageCurveZoom->setZoomStack(stack);
2087  stack.pop();
2088 
2091 }
QwtPlotCurve pixelValueCurveItem
void on_autoScaleColor_clicked()
int crate() const
Bias supply channel.
Definition: PixelMap.h:35
int patch() const
Definition: PixelMap.h:37
int i
Definition: db_dim_client.c:21
QwtPlotZoomer * curveZoom
double yval[50000]
void displaySliceValue()
double xval[50000]
int pixel() const
Definition: PixelMap.h:38
int board() const
Definition: PixelMap.h:36
QwtPlotCurve pixelAverageCurveItem
QwtPlotZoomer * averageCurveZoom
QRectF scaleBoundingRectangle(QRectF rectangle, float scale)

+ Here is the call graph for this function: