Changeset 11897 for trunk/FACT++/gui/RawEventsViewer
- Timestamp:
- 08/12/11 11:12:01 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/RawEventsViewer/RawEventsViewer.cc
r11753 r11897 682 682 delete inputFile; 683 683 } 684 if (eventData != NULL) 684 if (eventData != NULL) { 685 685 delete[] eventData; 686 delete[] rawEventData; 687 } 686 688 } 687 689 /************************************************************ … … 902 904 entriesToCheck.push_back("CAMERA"); 903 905 entriesToCheck.push_back("DAQ"); 904 entriesToCheck.push_back("ADC COUNT");906 entriesToCheck.push_back("ADCRANGE"); 905 907 entriesToCheck.push_back("TSTART"); 906 908 entriesToCheck.push_back("TSTOP"); … … 932 934 camera = inputFile->GetStr("CAMERA"); 933 935 daq = inputFile->GetStr("DAQ"); 934 adcCount = inputFile->GetFloat("ADC COUNT");936 adcCount = inputFile->GetFloat("ADCRANGE"); 935 937 nbOk = inputFile->GetInt("NBEVTOK"); 936 938 nbRej = inputFile->GetInt("NBEVTREJ"); … … 943 945 #endif 944 946 945 if (eventData != NULL) 947 if (eventData != NULL) { 946 948 delete[] eventData; 947 eventData = new int16_t[(1440+160)*nRoi]; 948 if (!inputFile->SetPtrAddress("Data", eventData)){ 949 delete[] rawEventData; 950 } 951 eventData = new float[(1440+160)*nRoi]; 952 rawEventData = new int16_t[(1440+160)*nRoi]; 953 if (!inputFile->SetPtrAddress("Data", rawEventData)){ 949 954 cout << "Missing column " << "Data" << " Aborting load..." << endl; 950 955 nRoi = nRows = 0;return;} … … 1001 1006 calibInputFile->GetNextRow(); 1002 1007 1008 for (int i=0;i<1024;i++) 1009 cout << gainMean[i] << " "; 1010 cout << endl << endl; 1011 1003 1012 delete calibInputFile; 1004 1013 … … 1048 1057 return; 1049 1058 inputFile->GetRow(rowNum); 1059 for (int i=0;i<(1440+160)*nRoi;i++) 1060 eventData[i] = (float)rawEventData[i]; 1050 1061 #endif 1051 1062 1052 if (drawCalibrationLoaded )1063 if (drawCalibrationLoaded && calibrationLoaded) 1053 1064 { 1054 1065 for (int i=0;i<1440;i++) 1055 1066 for (int j=0;j<nRoi;j++) 1056 1067 { 1057 eventData[i*1024+j] /= 2;1068 eventData[i*1024+j] *= 2000.f/4096.f; 1058 1069 eventData[i*1024+j] -= (baseLineMean[i*1024+j]+triggerOffsetMean[i*1024+j]); 1059 1070 eventData[i*1024+j] /= gainMean[i*1024+j]; 1071 eventData[i*1024+j] *= (50000.f/65536.f) * 2500.f; 1060 1072 } 1061 1073 } … … 1136 1148 for (int j=0;j<viewer->nRoi;j++) 1137 1149 { 1138 viewer->eventData[i*1024+j] /= 2; 1150 // cout << "start value: " << viewer->eventData[i*1024+j] << " baseline: " << viewer->baseLineMean[i*1024+j]; 1151 // cout << " triggerOffset: " << viewer->triggerOffsetMean[i*1024+j] << " gain: " << viewer->gainMean[i*1024+j]; 1152 viewer->eventData[i*1024+j] *= 2000.f/4096.f; 1139 1153 viewer->eventData[i*1024+j] -= (viewer->baseLineMean[i*1024+j]+viewer->triggerOffsetMean[i*1024+j]); 1140 1154 viewer->eventData[i*1024+j] /= viewer->gainMean[i*1024+j]; 1155 viewer->eventData[i*1024+j] *= (50000.f/65536.f) * 2500.f; 1156 // cout << " end value: " << viewer->eventData[i*1024+j] << endl; 1141 1157 } 1142 1158 viewer->updateGL(); … … 1155 1171 for (int j=0;j<viewer->nRoi;j++) 1156 1172 { 1173 1174 viewer->eventData[i*1024+j] /= (50000.f/65536.f) * 2500.f; 1157 1175 viewer->eventData[i*1024+j] *= viewer->gainMean[i*1024+j]; 1158 1176 viewer->eventData[i*1024+j] += (viewer->baseLineMean[i*1024+j]+viewer->triggerOffsetMean[i*1024+j]); 1159 viewer->eventData[i*1024+j] *= 2;1177 viewer->eventData[i*1024+j] /= 2000.f/4096.f; 1160 1178 } 1161 1179 viewer->updateGL(); … … 2069 2087 } 2070 2088 } 2089 2090 2091 2071 2092 void PrintHelp() 2072 2093 { … … 2370 2391 return app.exec(); 2371 2392 } 2393
Note:
See TracChangeset
for help on using the changeset viewer.