Changeset 12395 for trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
- Timestamp:
- 11/05/11 19:43:05 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r12390 r12395 356 356 void RawDataViewer::drawPixelCurve() 357 357 { 358 if (!nRoi)359 return;360 358 float xZoom, yZoom; 361 359 xZoom = yZoom = 1.0f; 360 float xRange = bboxMax[0] - bboxMin[0]; 361 float yRange = bboxMax[1] - bboxMin[1]; 362 362 363 363 glBegin(GL_LINES); 364 364 glLineWidth(1.0f); 365 glColor3f(0. 5,0.5,0.5);365 glColor3f(0.0,0.0,0.0); 366 366 glVertex2f(bboxMin[0], bboxMin[1]); 367 367 glVertex2f(bboxMax[0], bboxMin[1]); … … 370 370 glVertex2f(bboxMin[0], (bboxMin[1]+bboxMax[1])/2.0f); 371 371 glVertex2f(bboxMax[0], (bboxMin[1]+bboxMax[1])/2.0f); 372 float xRange = bboxMax[0] - bboxMin[0]; 373 float yRange = bboxMax[1] - bboxMin[1]; 374 glColor3f(1.0,1.0,1.0); 372 glVertex2f(bboxMin[0] + xRange*nRoi/(float)(nRoi+nRoiTM), 373 bboxMin[1]); 374 glVertex2f(bboxMin[0] + xRange*nRoi/(float)(nRoi+nRoiTM), 375 bboxMax[1]); 376 glEnd(); 377 glTranslatef(0,0,0.1f); 378 if (!nRoi) 379 return; 380 glBegin(GL_LINES); 381 glColor3f(1.0f,1.0f,0.0f); 375 382 float divideMe = (float)(VALUES_SPAN-1); 376 383 float plusMe = VALUES_SPAN/2; … … 389 396 const int pixelIdInPatch = mapEntry.pixel(); 390 397 const int patchId = mapEntry.patch(); 398 const int boardId = mapEntry.board(); 399 const int crateId = mapEntry.crate(); 391 400 392 401 if (selectedPixel != -1) … … 403 412 bboxMin[1] + yRange*(d2) /divideMe); 404 413 } 405 414 glEnd(); 415 416 glColor3f(0.0f, 1.0f, 1.0f); 417 glBegin(GL_LINES); 406 418 if (pixelIdInPatch == 8)//this channel has a time marker 407 419 { 420 //link between pixel slices and TM slices. should I draw it ? 421 // float d1 = eventData[nRoi*hw + nRoi-1]+plusMe; 422 // float d2 = eventData[nRoi*1440 + nRoiTM*(40*crateId + 4*boardId + patchId)] + plusMe; 423 // glVertex2f(bboxMin[0] + xRange*(nRoi-1)/(float)(nRoi+nRoiTM), 424 // bboxMin[1] + yRange*(d1) /divideMe); 425 // glVertex2f(bboxMin[0] + xRange*(nRoi)/(float)(nRoi+nRoiTM), 426 // bboxMin[1] + yRange*(d2)/divideMe); 408 427 for (int i=0;i<nRoiTM-1;i++) 409 428 { 410 float d1 = eventData[nRoi*1440 + nRoiTM* patchId+ i] + plusMe;411 float d2 = eventData[nRoi*1440 + nRoiTM* patchId+ i+1] + plusMe;429 float d1 = eventData[nRoi*1440 + nRoiTM*(40*crateId + 4*boardId + patchId) + i] + plusMe; 430 float d2 = eventData[nRoi*1440 + nRoiTM*(40*crateId + 4*boardId + patchId) + i+1] + plusMe; 412 431 if (!finite(d1)) d1 = 20000; 413 432 if (!finite(d2)) d2 = 20000; … … 418 437 } 419 438 } 439 420 440 } 421 441 glEnd(); … … 423 443 glBegin(GL_LINES); 424 444 glColor3f(1.0,0.0,0.0); 425 glVertex2f(bboxMin[0] + xRange*whichSlice/(float) nRoi,445 glVertex2f(bboxMin[0] + xRange*whichSlice/(float)(nRoi+nRoiTM), 426 446 bboxMin[1]); 427 glVertex2f(bboxMin[0] + xRange*whichSlice/(float) nRoi,447 glVertex2f(bboxMin[0] + xRange*whichSlice/(float)(nRoi+nRoiTM), 428 448 bboxMax[1]); 429 449 … … 496 516 if (!mypMap.Read("FACTmap111030.txt")) 497 517 { 498 cerr << "ERROR - Problems reading FACTmap V5a.txt" << endl;518 cerr << "ERROR - Problems reading FACTmap111030.txt" << endl; 499 519 exit(-1); 500 520 } … … 751 771 inputFile->SetPtrAddress("StartCellData", startPix); 752 772 inputFile->SetPtrAddress("StartCellTimeMarker", startTM); 773 inputFile->SetPtrAddress("TimeMarker", &rawEventData[1440*nRoi]); 753 774 } 754 775 catch (const runtime_error &e) … … 1134 1155 } 1135 1156 1157 //hide the time markers 1158 int nSlicesToRemove = 60; 1159 float* backupData; 1160 if (nRoiTM == 0) //they are written into the regular channel 1161 { 1162 backupData = new float[nSlicesToRemove*160]; 1163 for (int i=0;i<1440;i++) 1164 { 1165 const PixelMapEntry& mapEntry = fPixelMap.index(i); 1166 const int pixelIdInPatch = mapEntry.pixel(); 1167 const int patchId = mapEntry.patch(); 1168 const int boardId = mapEntry.board(); 1169 const int crateId = mapEntry.crate(); 1170 1171 const int hw = mapEntry.hw(); 1172 if (pixelIdInPatch == 8) 1173 { 1174 // cout << patchId << " "; 1175 for (int j=0;j<nSlicesToRemove;j++) 1176 { 1177 backupData[(40*crateId + 4*boardId + patchId)*nSlicesToRemove+j] = eventData[(hw*nRoi) + (nRoi-nSlicesToRemove) + j]; 1178 eventData[(hw*nRoi) + (nRoi-nSlicesToRemove) + j] = eventData[hw*nRoi + (nRoi-nSlicesToRemove) - 1]; 1179 } 1180 } 1181 } 1182 } 1183 1136 1184 vector<float> pixelStatsData(1440*4); 1137 1185 DrsCalibrate::GetPixelStats(pixelStatsData.data(), eventData, nRoi); … … 1140 1188 RMSvalues[it->index] = pixelStatsData[1*1440+it->hw()]; 1141 1189 1190 if (nRoiTM == 0)//move back the data back in place 1191 { 1192 for (int i=0;i<1440;i++) 1193 { 1194 const PixelMapEntry& mapEntry = fPixelMap.index(i); 1195 const int pixelIdInPatch = mapEntry.pixel(); 1196 const int patchId = mapEntry.patch(); 1197 const int boardId = mapEntry.board(); 1198 const int crateId = mapEntry.crate(); 1199 if (patchId > 160) 1200 cout << "Voila mon probleme: " << patchId << endl; 1201 const int hw = mapEntry.hw(); 1202 if (pixelIdInPatch == 8) 1203 { 1204 // cout << "|" << crateId << " " << boardId << " " << patchId << " " << hw << "| "; 1205 for (int j=0;j<nSlicesToRemove;j++) 1206 { 1207 eventData[(hw*nRoi) + (nRoi - nSlicesToRemove) + j] = backupData[(40*crateId + 4*boardId + patchId)*nSlicesToRemove+j]; 1208 } 1209 } 1210 } 1211 delete[] backupData; 1212 } 1142 1213 if (isVisible()) 1143 1214 updateGL();
Note:
See TracChangeset
for help on using the changeset viewer.