FACT++  1.0
void RawDataViewer::drawPixelCurve ( )
private

Definition at line 260 of file RawEventsViewer.cc.

References bboxMax, bboxMin, PixelMapEntry::board(), PixelMapEntry::crate(), i, PixelMapEntry::index, PixelMapEntry::patch(), and PixelMapEntry::pixel().

Referenced by paintGL().

261 {
262  float xRange = bboxMax[0] - bboxMin[0];
263  float yRange = bboxMax[1] - bboxMin[1];
264 
265  glBegin(GL_LINES);
266  glLineWidth(1.0f);
267  glColor3f(0.0,0.0,0.0);
268  glVertex2f(bboxMin[0], bboxMin[1]);
269  glVertex2f(bboxMax[0], bboxMin[1]);
270  glVertex2f(bboxMin[0], bboxMin[1]);
271  glVertex2f(bboxMin[0], bboxMax[1]);
272  glVertex2f(bboxMin[0], (bboxMin[1]+bboxMax[1])/2.0f);
273  glVertex2f(bboxMax[0], (bboxMin[1]+bboxMax[1])/2.0f);
274  glVertex2f(bboxMin[0] + xRange*nRoi/(float)(nRoi+nRoiTM),
275  bboxMin[1]);
276  glVertex2f(bboxMin[0] + xRange*nRoi/(float)(nRoi+nRoiTM),
277  bboxMax[1]);
278  glEnd();
279  glTranslatef(0,0,0.1f);
280  if (!nRoi)
281  return;
282  glBegin(GL_LINES);
283  glColor3f(1.0f,1.0f,0.0f);
284  float divideMe = (float)(VALUES_SPAN-1);
285  float plusMe = (float)(VALUES_SPAN)/2;
286  if (divideMe <= 0)
287  divideMe = 1;
288 
289  /*
290  if (drawCalibrationLoaded)
291  plusMe += 0;//VALUES_SPAN/2;
292  if (drawCalibrationLoaded && calibrationLoaded)
293  {
294  divideMe /=2;
295  plusMe = 0 ;///=2;
296  }*/
297 
298 // int mapping = _softwareOrdering ? selectedPixel : hardwareMapping[selectedPixel];
299  int mapping = hardwareMapping[selectedPixel];
300  const int hw = mapping;
301  const PixelMapEntry& mapEntry = fPixelMap.index(selectedPixel);
302  const int pixelIdInPatch = mapEntry.pixel();
303  const int patchId = mapEntry.patch();
304  const int boardId = mapEntry.board();
305  const int crateId = mapEntry.crate();
306 
307  if (selectedPixel != -1)
308  {
309  for (int i=0;i<nRoi-1;i++)
310  {
311  float d1 = eventData[nRoi*hw + i]+plusMe;
312  float d2 = eventData[nRoi*hw + i+1]+plusMe;
313  if (!finite(d1)) d1 = 20000;
314  if (!finite(d2)) d2 = 20000;
315  glVertex2f(bboxMin[0] + xRange*i/(float)(nRoi+nRoiTM),
316  bboxMin[1] + yRange*(d1) /divideMe);
317  glVertex2f(bboxMin[0] + xRange*(i+1)/(float)(nRoi+nRoiTM),
318  bboxMin[1] + yRange*(d2) /divideMe);
319  }
320  glEnd();
321 
322  glColor3f(0.0f, 1.0f, 1.0f);
323  glBegin(GL_LINES);
324  if (pixelIdInPatch == 8)//this channel has a time marker
325  {
326 
327  for (int i=0;i<nRoiTM-1;i++)
328  {
329  float d1 = eventData[nRoi*1440 + nRoiTM*(40*crateId + 4*boardId + patchId) + i] + plusMe;
330  float d2 = eventData[nRoi*1440 + nRoiTM*(40*crateId + 4*boardId + patchId) + i+1] + plusMe;
331  if (!finite(d1)) d1 = 20000;
332  if (!finite(d2)) d2 = 20000;
333  glVertex2f(bboxMin[0] + xRange*(i+nRoi)/(float)(nRoi+nRoiTM),
334  bboxMin[1] + yRange*(d1)/divideMe);
335  glVertex2f(bboxMin[0] + xRange*(i+1+nRoi)/(float)(nRoi+nRoiTM),
336  bboxMin[1] + yRange*(d2) / divideMe);
337  }
338  }
339 
340  }
341  glEnd();
342  glTranslatef(0,0,0.1f);
343  glBegin(GL_LINES);
344  glColor3f(1.0,0.0,0.0);
345  glVertex2f(bboxMin[0] + xRange*whichSlice/(float)(nRoi+nRoiTM),
346  bboxMin[1]);
347  glVertex2f(bboxMin[0] + xRange*whichSlice/(float)(nRoi+nRoiTM),
348  bboxMax[1]);
349 
350  glEnd();
351 
352 }
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
float bboxMin[2]
int pixel() const
Definition: PixelMap.h:38
float bboxMax[2]
int board() const
Definition: PixelMap.h:36
const PixelMapEntry & index(int idx) const
Definition: PixelMap.h:107
static PixelMap fPixelMap
Definition: BasicGlCamera.h:60
static int hardwareMapping[NPIX]

+ Here is the call graph for this function:

+ Here is the caller graph for this function: