Changeset 11850 for trunk/FACT++/gui
- Timestamp:
- 08/08/11 19:40:10 (14 years ago)
- Location:
- trunk/FACT++/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r11847 r11850 1208 1208 delete d1; 1209 1209 delete d2; 1210 d0 = 0; 1211 d1 = 0; 1212 d2 = 0; 1210 1213 hf = 0; 1211 1214 } 1215 const int roi = fEventData->Roi>0 ? fEventData->Roi : 1; 1216 1217 c->cd(); 1212 1218 1213 1219 if (!hf) 1214 1220 { 1215 c->cd();1216 1217 const int roi = fEventData->Roi>0 ? fEventData->Roi : 1;1218 1219 1221 hf = new TH1F("Frame", "", roi, -0.5, roi-0.5); 1220 1222 hf->SetDirectory(0); … … 1241 1243 h->SetMarkerColor(kBlue); 1242 1244 1243 1245 hf->Draw(""); 1246 1247 if (dynamic_cast<TH2*>(h)) 1248 h->Draw("col same"); 1249 } 1250 1251 if (d0 && !(fDrsCalibBaselineOn->isChecked() && fDrsCalibBaseline->value()>0)) 1252 { 1253 delete d0; 1254 d0 = 0; 1255 } 1256 if (d1 && !(fDrsCalibGainOn->isChecked() && fDrsCalibGain->value()>0)) 1257 { 1258 delete d1; 1259 d1 = 0; 1260 } 1261 if (d2 && !(fDrsCalibTrgOffsetOn->isChecked() && fDrsCalibTrgOffset->value()>0)) 1262 { 1263 delete d2; 1264 d2 = 0; 1265 } 1266 1267 if (!d0 && fDrsCalibBaselineOn->isChecked() && fDrsCalibBaseline->value()>0) 1268 { 1244 1269 d0 = new TH1F("DrsCalib0", "", roi, -0.5, roi-0.5); 1245 1270 d0->SetDirectory(0); … … 1248 1273 d0->SetMarkerColor(kRed); 1249 1274 d0->SetLineColor(kRed); 1250 1275 d0->Draw("PEX0same"); 1276 } 1277 1278 if (!d1 && fDrsCalibGainOn->isChecked() && fDrsCalibGain->value()>0) 1279 { 1251 1280 d1 = new TH1F("DrsCalib1", "", roi, -0.5, roi-0.5); 1252 1281 d1->SetDirectory(0); … … 1254 1283 d1->SetMarkerStyle(kFullDotSmall); 1255 1284 d1->SetMarkerColor(kMagenta); 1256 d1->SetLineColor(kMagenta); 1257 1285 d1->SetLineColor(kMagenta); 1286 d1->Draw("PEX0same"); 1287 } 1288 1289 if (!d2 && fDrsCalibTrgOffsetOn->isChecked() && fDrsCalibTrgOffset->value()>0) 1290 { 1258 1291 d2 = new TH1F("DrsCalib2", "", roi, -0.5, roi-0.5); 1259 1292 d2->SetDirectory(0); … … 1261 1294 d2->SetMarkerStyle(kFullDotSmall); 1262 1295 d2->SetMarkerColor(kGreen); 1263 d2->SetLineColor(kGreen); 1264 1265 hf->Draw(""); 1266 1267 if (dynamic_cast<TH2*>(h)) 1268 h->Draw("col same"); 1269 1270 d0->Draw("PEX0same"); 1271 d1->Draw("PEX0same"); 1296 d2->SetLineColor(kGreen); 1272 1297 d2->Draw("PEX0same"); 1273 1274 if (!dynamic_cast<TH2*>(h)) 1275 h->Draw("PLsame"); 1276 1277 gPad = NULL; 1278 } 1298 } 1299 1300 if (!dynamic_cast<TH2*>(h) && !c->GetListOfPrimitives()->FindObject(h)) 1301 h->Draw("PLsame"); 1279 1302 1280 1303 // ----------------------------------------------------------- … … 1301 1324 const int16_t start = fEventData->StartPix[p]; 1302 1325 1303 if (fDrsCalibBaseline->value()==0 || start<0) 1326 fDrsCalibBaseline->setEnabled(fDrsCalibBaseline->value()>0); 1327 fDrsCalibGain->setEnabled(fDrsCalibGain->value()>0); 1328 fDrsCalibTrgOffset->setEnabled(fDrsCalibTrgOffset->value()>0); 1329 1330 if (d0)//fDrsCalibBaseline->value()==0 || start<0) 1304 1331 d0->Reset(); 1305 if ( fDrsCalibGain->value()==0 || start<0)1332 if (d1)//fDrsCalibGain->value()==0 || start<0) 1306 1333 d1->Reset(); 1307 if ( fDrsCalibTrgOffset->value()==0 || start<0)1334 if (d2)//fDrsCalibTrgOffset->value()==0 || start<0) 1308 1335 d2->Reset(); 1309 1336 1310 1337 if (!dynamic_cast<TH2*>(h)) 1311 1338 h->Reset(); 1312 d0->SetEntries(0); 1313 d1->SetEntries(0); 1314 d2->SetEntries(0); 1339 if (d0) 1340 d0->SetEntries(0); 1341 if (d1) 1342 d1->SetEntries(0); 1343 if (d2) 1344 d2->SetEntries(0); 1315 1345 1316 1346 for (int i=0; i<fEventData->Roi; i++) … … 1323 1353 continue; 1324 1354 1325 if ( fDrsCalibBaseline->value()>0)1355 if (d0) 1326 1356 { 1327 1357 d0->SetBinContent(i+1, fDrsCalibration[1440*1024*0 + p*1024+(start+i)%1024]); … … 1329 1359 1330 1360 } 1331 if ( fDrsCalibGain->value()>0)1361 if (d1) 1332 1362 { 1333 1363 d1->SetBinContent(i+1, fDrsCalibration[1440*1024*2 + p*1024+(start+i)%1024]); 1334 1364 d1->SetBinError(i+1, fDrsCalibration[1440*1024*3 + p*1024+(start+i)%1024]); 1335 1365 } 1336 if ( fDrsCalibTrgOffset->value()>0)1366 if (d2) 1337 1367 { 1338 1368 d2->SetBinContent(i+1, fDrsCalibration[1440*1024*4 + p*1024 + i]); … … 1395 1425 h2.SetDirectory(0); 1396 1426 hd.SetLineColor(h->GetLineColor()); 1397 h0.SetLineColor(d0->GetLineColor()); 1398 h1.SetLineColor(d1->GetLineColor()); 1399 h2.SetLineColor(d2->GetLineColor()); 1427 if (d0) 1428 h0.SetLineColor(d0->GetLineColor()); 1429 if (d1) 1430 h1.SetLineColor(d1->GetLineColor()); 1431 if (d2) 1432 h2.SetLineColor(d2->GetLineColor()); 1400 1433 1401 1434 for (int i=0; i<fEventData->Roi; i++) … … 1403 1436 if (!dynamic_cast<TH2*>(h)) 1404 1437 hd.Fill(h->GetBinContent(i+1)); 1405 h0.Fill(d0->GetBinContent(i+1)); 1406 h1.Fill(d1->GetBinContent(i+1)); 1407 h2.Fill(d2->GetBinContent(i+1)); 1438 if (d0) 1439 h0.Fill(d0->GetBinContent(i+1)); 1440 if (d1) 1441 h1.Fill(d1->GetBinContent(i+1)); 1442 if (d2) 1443 h2.Fill(d2->GetBinContent(i+1)); 1408 1444 } 1409 1445 -
trunk/FACT++/gui/design.ui
r11847 r11850 11 11 <x>0</x> 12 12 <y>0</y> 13 <width>12 06</width>13 <width>1236</width> 14 14 <height>885</height> 15 15 </rect> … … 53 53 </property> 54 54 <property name="currentIndex"> 55 <number> 7</number>55 <number>5</number> 56 56 </property> 57 57 <property name="documentMode"> … … 3974 3974 </item> 3975 3975 <item> 3976 <spacer name="horizontalSpacer_54"> 3977 <property name="orientation"> 3978 <enum>Qt::Horizontal</enum> 3979 </property> 3980 <property name="sizeHint" stdset="0"> 3981 <size> 3982 <width>40</width> 3983 <height>20</height> 3984 </size> 3985 </property> 3986 </spacer> 3987 </item> 3988 <item> 3976 3989 <widget class="QGroupBox" name="groupBox_10"> 3977 3990 <property name="title"> … … 7219 7232 </item> 7220 7233 <item> 7221 <widget class="QSpinBox" name="fDrsCalibBaseline"> 7222 <property name="alignment"> 7223 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 7224 </property> 7225 <property name="readOnly"> 7226 <bool>true</bool> 7227 </property> 7228 <property name="buttonSymbols"> 7229 <enum>QAbstractSpinBox::NoButtons</enum> 7230 </property> 7231 <property name="prefix"> 7232 <string/> 7233 </property> 7234 <property name="maximum"> 7235 <number>9999</number> 7236 </property> 7237 </widget> 7234 <layout class="QHBoxLayout" name="horizontalLayout_40"> 7235 <property name="topMargin"> 7236 <number>0</number> 7237 </property> 7238 <item> 7239 <widget class="QCheckBox" name="fDrsCalibBaselineOn"> 7240 <property name="sizePolicy"> 7241 <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> 7242 <horstretch>0</horstretch> 7243 <verstretch>0</verstretch> 7244 </sizepolicy> 7245 </property> 7246 <property name="minimumSize"> 7247 <size> 7248 <width>0</width> 7249 <height>0</height> 7250 </size> 7251 </property> 7252 <property name="maximumSize"> 7253 <size> 7254 <width>20</width> 7255 <height>16777215</height> 7256 </size> 7257 </property> 7258 <property name="text"> 7259 <string/> 7260 </property> 7261 <property name="checked"> 7262 <bool>true</bool> 7263 </property> 7264 </widget> 7265 </item> 7266 <item> 7267 <widget class="QSpinBox" name="fDrsCalibBaseline"> 7268 <property name="alignment"> 7269 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 7270 </property> 7271 <property name="readOnly"> 7272 <bool>true</bool> 7273 </property> 7274 <property name="buttonSymbols"> 7275 <enum>QAbstractSpinBox::NoButtons</enum> 7276 </property> 7277 <property name="prefix"> 7278 <string/> 7279 </property> 7280 <property name="maximum"> 7281 <number>9999</number> 7282 </property> 7283 </widget> 7284 </item> 7285 </layout> 7238 7286 </item> 7239 7287 <item> … … 7245 7293 </item> 7246 7294 <item> 7247 <widget class="QSpinBox" name="fDrsCalibGain"> 7248 <property name="alignment"> 7249 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 7250 </property> 7251 <property name="readOnly"> 7252 <bool>true</bool> 7253 </property> 7254 <property name="buttonSymbols"> 7255 <enum>QAbstractSpinBox::NoButtons</enum> 7256 </property> 7257 <property name="prefix"> 7258 <string/> 7259 </property> 7260 <property name="maximum"> 7261 <number>9999</number> 7262 </property> 7263 </widget> 7295 <layout class="QHBoxLayout" name="horizontalLayout_41"> 7296 <property name="topMargin"> 7297 <number>0</number> 7298 </property> 7299 <item> 7300 <widget class="QCheckBox" name="fDrsCalibGainOn"> 7301 <property name="sizePolicy"> 7302 <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> 7303 <horstretch>0</horstretch> 7304 <verstretch>0</verstretch> 7305 </sizepolicy> 7306 </property> 7307 <property name="minimumSize"> 7308 <size> 7309 <width>0</width> 7310 <height>0</height> 7311 </size> 7312 </property> 7313 <property name="maximumSize"> 7314 <size> 7315 <width>20</width> 7316 <height>16777215</height> 7317 </size> 7318 </property> 7319 <property name="text"> 7320 <string/> 7321 </property> 7322 <property name="checked"> 7323 <bool>true</bool> 7324 </property> 7325 </widget> 7326 </item> 7327 <item> 7328 <widget class="QSpinBox" name="fDrsCalibGain"> 7329 <property name="alignment"> 7330 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 7331 </property> 7332 <property name="readOnly"> 7333 <bool>true</bool> 7334 </property> 7335 <property name="buttonSymbols"> 7336 <enum>QAbstractSpinBox::NoButtons</enum> 7337 </property> 7338 <property name="prefix"> 7339 <string/> 7340 </property> 7341 <property name="maximum"> 7342 <number>9999</number> 7343 </property> 7344 </widget> 7345 </item> 7346 </layout> 7264 7347 </item> 7265 7348 <item> … … 7271 7354 </item> 7272 7355 <item> 7273 <widget class="QSpinBox" name="fDrsCalibTrgOffset"> 7274 <property name="alignment"> 7275 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 7276 </property> 7277 <property name="readOnly"> 7278 <bool>true</bool> 7279 </property> 7280 <property name="buttonSymbols"> 7281 <enum>QAbstractSpinBox::NoButtons</enum> 7282 </property> 7283 <property name="prefix"> 7284 <string/> 7285 </property> 7286 <property name="maximum"> 7287 <number>9999</number> 7288 </property> 7289 </widget> 7356 <layout class="QHBoxLayout" name="horizontalLayout_42"> 7357 <property name="topMargin"> 7358 <number>0</number> 7359 </property> 7360 <item> 7361 <widget class="QCheckBox" name="fDrsCalibTrgOffsetOn"> 7362 <property name="sizePolicy"> 7363 <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> 7364 <horstretch>0</horstretch> 7365 <verstretch>0</verstretch> 7366 </sizepolicy> 7367 </property> 7368 <property name="minimumSize"> 7369 <size> 7370 <width>0</width> 7371 <height>0</height> 7372 </size> 7373 </property> 7374 <property name="maximumSize"> 7375 <size> 7376 <width>20</width> 7377 <height>16777215</height> 7378 </size> 7379 </property> 7380 <property name="text"> 7381 <string/> 7382 </property> 7383 <property name="checked"> 7384 <bool>true</bool> 7385 </property> 7386 </widget> 7387 </item> 7388 <item> 7389 <widget class="QSpinBox" name="fDrsCalibTrgOffset"> 7390 <property name="alignment"> 7391 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> 7392 </property> 7393 <property name="readOnly"> 7394 <bool>true</bool> 7395 </property> 7396 <property name="buttonSymbols"> 7397 <enum>QAbstractSpinBox::NoButtons</enum> 7398 </property> 7399 <property name="prefix"> 7400 <string/> 7401 </property> 7402 <property name="maximum"> 7403 <number>9999</number> 7404 </property> 7405 </widget> 7406 </item> 7407 </layout> 7290 7408 </item> 7291 7409 </layout> … … 13105 13223 <x>0</x> 13106 13224 <y>0</y> 13107 <width>12 06</width>13225 <width>1236</width> 13108 13226 <height>21</height> 13109 13227 </rect>
Note:
See TracChangeset
for help on using the changeset viewer.