Changeset 19373 for trunk/FACT++
- Timestamp:
- 11/11/18 13:31:26 (6 years ago)
- Location:
- trunk/FACT++/gui/RawEventsViewer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r19368 r19373 370 370 selectedPixel = 393; 371 371 inputFile = NULL; 372 eventData = NULL;373 372 drawPatch = false; 374 373 drawImpulse = true; … … 430 429 inputFile->close(); 431 430 delete inputFile; 432 }433 if (eventData != NULL) {434 delete[] eventData;435 delete[] rawEventData;436 delete[] waveLetArray;437 431 } 438 432 if (fZeroArray != NULL) … … 687 681 eventNum = 1; 688 682 689 if (eventData != NULL) { 690 delete[] eventData; 691 delete[] rawEventData; 692 delete[] waveLetArray; 693 } 694 eventData = new float[1440*nRoi + 160*nRoiTM];//(1440+160)*nRoi]; 695 696 rawEventData = new int16_t[1440*nRoi + 160*nRoiTM];//(1440+160)*nRoi]; 697 waveLetArray = new int16_t[1024*1440]; 683 eventData.resize(1440*nRoi + 160*nRoiTM); 684 rawEventData.resize(1440*nRoi + 160*nRoiTM); 685 waveLetArray.resize(1024*1440); 698 686 try 699 687 { 700 inputFile->SetPtrAddress("Data", rawEventData );688 inputFile->SetPtrAddress("Data", rawEventData.data()); 701 689 if (inputFile->HasColumn("EventNum")) 702 690 inputFile->SetPtrAddress("EventNum", &eventNum); … … 724 712 cout << "Warning: could not find column \"StartCellTimeMarker\"" << endl; 725 713 if (inputFile->HasColumn("TimeMarker")) 726 inputFile->SetPtrAddress("TimeMarker", &rawEventData[1440*nRoi]);714 inputFile->SetPtrAddress("TimeMarker", rawEventData.data()+1440*nRoi); 727 715 else 728 716 cout << "Warning: could not find column \"TimeMarker\"" << endl; … … 804 792 const int roiTM) 805 793 { 806 807 eventData = new float[1440*roi + 160*roiTM];//(1440+160)*nRoi]; 794 eventData.assign(inputData.begin(), inputData.end()); 808 795 nRoi=roi; 809 796 nRoiTM=roiTM; … … 813 800 mean=0; 814 801 for (int i=0;i<1440*roi + 160*roiTM;i++) { 815 eventData[i] = (float)inputData[i];816 802 mean += inputData[i]; 817 803 if (inputData[i] > max) … … 854 840 void RawDataViewer::ApplyCalibration() 855 841 { 856 for (int i=0;i<1440*nRoi + 160*nRoiTM;i++)//(1440+160)*nRoi;i++) 857 eventData[i] = (float)rawEventData[i]; 842 eventData.assign(rawEventData.begin(), rawEventData.end()); 858 843 859 844 if (fIsDrsCalibration) 860 845 { 861 fDrsCalib.Apply(eventData , rawEventData, startPix, nRoi);862 DrsCalibrate::RemoveSpikes(eventData , nRoi);846 fDrsCalib.Apply(eventData.data(), rawEventData.data(), startPix, nRoi); 847 DrsCalibrate::RemoveSpikes(eventData.data(), nRoi); 863 848 //TODO apply calibration to the Time markers 864 849 } … … 891 876 892 877 vector<float> pixelStatsData(1440*4); 893 DrsCalibrate::GetPixelStats(pixelStatsData.data(), eventData , nRoi);878 DrsCalibrate::GetPixelStats(pixelStatsData.data(), eventData.data(), nRoi); 894 879 895 880 for (vector<PixelMapEntry>::const_iterator it=fPixelMap.begin(); it!=fPixelMap.end(); it++) … … 951 936 cout << "Warning: did not expect Time Markers data from Monte-Carlo simulations. These will not be mapped properly." << endl; 952 937 //first copy the data 953 int16_t* tempData = new int16_t[1440*nRoi]; 954 for (int i=0;i<1440*nRoi;i++) 955 tempData[i] = rawEventData[i]; 938 vector<int16_t> tempData(rawEventData.begin(), rawEventData.begin()+1440*nRoi); 956 939 //copy back the data and re-map it on the fly 957 940 for (int i=0;i<1440;i++) 958 941 for (int j=0;j<nRoi;j++) 959 942 rawEventData[i*nRoi + j] = tempData[softwareMapping[i]*nRoi + j]; 960 961 delete[] tempData;962 943 } 963 944 // cout << "Getting row " << rowNum << endl; … … 1178 1159 GLWindow->ApplyCalibration(); 1179 1160 1180 threeD_Window->setData(GLWindow->eventData );1161 threeD_Window->setData(GLWindow->eventData.data()); 1181 1162 1182 1163 on_autoScaleColor_clicked(); … … 1490 1471 PosOfMax_window->SetData(GLWindow->PosOfMaxvalues); 1491 1472 Max_window->SetData(GLWindow->Maxvalues); 1492 threeD_Window->setData(GLWindow->eventData );//rawEventData);1473 threeD_Window->setData(GLWindow->eventData.data());//rawEventData); 1493 1474 1494 1475 if (RMS_window->isVisible()) … … 1590 1571 str.str(""); 1591 1572 str << i << " | "; 1592 for (int j=0;j<GLWindow->nRoi ;j++)1593 { 1594 int value = GLWindow->eventData[1440*GLWindow->nRoi + i*GLWindow->nRoi + j];1573 for (int j=0;j<GLWindow->nRoiTM;j++) 1574 { 1575 int value = GLWindow->eventData[1440*GLWindow->nRoi + i*GLWindow->nRoiTM + j]; 1595 1576 if (delayMap.find(value) != delayMap.end()) 1596 1577 delayMap[value]++; … … 2045 2026 } 2046 2027 2047 2048 2028 int realNumSamples = GLWindow->nRoi; 2049 2029 if (GLWindow->nRoiTM != 0) -
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.h
r19368 r19373 91 91 // void drawHexagon(int index, bool solid); 92 92 int selectedPixel; 93 float *eventData;94 float *rmsData;95 int16_t*rawEventData;96 int16_t*waveLetArray;93 vector<float> eventData; 94 //vector<float> rmsData; 95 vector<int16_t> rawEventData; 96 vector<int16_t> waveLetArray; 97 97 valarray<double> RMSvalues;//(1440); 98 98 valarray<double> Meanvalues;
Note:
See TracChangeset
for help on using the changeset viewer.