Changeset 12295 for trunk/FACT++/gui
- Timestamp:
- 10/27/11 04:59:47 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/gui/FactGui.h
r12289 r12295 430 430 DimStampedInfo fDimFeedbackReference; 431 431 432 DimStampedInfo fDimRateScan; 433 432 434 map<string, DimInfo*> fServices; 433 435 … … 1997 1999 } 1998 2000 2001 const bool b = fBoardRatesEnabled->isChecked(); 2002 1999 2003 valarray<double> dat(0., 1440); 2000 2004 … … 2003 2007 { 2004 2008 const int ihw = fPixelMap.index(i).hw()/9; 2005 dat[i] = sdata.fPatchRate[ihw]; 2006 2007 // Was this meant for something? 2008 //fRatesCanv->SetEnable(ihw, fFtuStatus[ihw/4]); 2009 dat[i] = b ? sdata.fBoardRate[ihw/4] : sdata.fPatchRate[ihw]; 2009 2010 } 2010 2011 … … 2014 2015 2015 2016 int64_t fTimeStamp0; 2017 2018 void on_fBoardRatesEnabled_toggled(bool) 2019 { 2020 UpdateRatesCam(fTriggerRates); 2021 } 2016 2022 2017 2023 void UpdateRatesGraphs(const FTM::DimTriggerRates &sdata) … … 2158 2164 fGraphBoardRate[fRateBoard2->value()].Draw("PL"); 2159 2165 } 2166 2167 c->Modified(); 2168 c->Update(); 2160 2169 #endif 2161 2170 } … … 2602 2611 } 2603 2612 2613 // ======================= Rate Scan ==================================== 2614 2615 TGraph fGraphRateScan[201]; 2616 2617 void UpdateRateScan(uint32_t th, const float *rates) 2618 { 2619 #ifdef HAVE_ROOT 2620 TCanvas *c = fRateScanCanv->GetCanvas(); 2621 2622 TH1 *h = (TH1*)c->FindObject("Frame"); 2623 2624 if (fGraphRateScan[0].GetN()==0 || th<=fGraphRateScan[0].GetX()[0]) 2625 { 2626 for (int i=0; i<201; i++) 2627 fGraphRateScan[i].Set(0); 2628 2629 h->SetBins(1, th-10, th+10); 2630 h->SetMinimum(1); 2631 h->SetMaximum(rates[0]*2); 2632 2633 c->SetGrid(); 2634 c->SetLogy(); 2635 2636 for (int i=0; i<201; i++) 2637 fGraphRateScan[i].SetPoint(fGraphRateScan[i].GetN(), th, rates[i]); 2638 2639 c->Modified(); 2640 c->Update(); 2641 return; 2642 } 2643 2644 const double dac = h->GetXaxis()->GetXmin(); 2645 h->SetBins(h->GetNbinsX()+1, dac, th+10); 2646 2647 for (int i=0; i<201; i++) 2648 fGraphRateScan[i].SetPoint(fGraphRateScan[i].GetN(), th, rates[i]); 2649 2650 c->Modified(); 2651 c->Update(); 2652 #endif 2653 } 2654 2655 void DisplayRateScan() 2656 { 2657 #ifdef HAVE_ROOT 2658 TCanvas *c = fRateScanCanv->GetCanvas(); 2659 2660 while (c->FindObject("PatchRate")) 2661 c->GetListOfPrimitives()->Remove(c->FindObject("PatchRate")); 2662 2663 while (c->FindObject("BoardRate")) 2664 c->GetListOfPrimitives()->Remove(c->FindObject("BoardRate")); 2665 2666 c->cd(); 2667 2668 if (fRateScanPatch1->value()>=0) 2669 { 2670 fGraphRateScan[fRateScanPatch1->value()+41].SetLineColor(kRed); 2671 fGraphRateScan[fRateScanPatch1->value()+41].SetMarkerColor(kRed); 2672 fGraphRateScan[fRateScanPatch1->value()+41].Draw("PL"); 2673 } 2674 if (fRateScanPatch2->value()>=0) 2675 { 2676 fGraphRateScan[fRateScanPatch2->value()+41].SetLineColor(kGreen); 2677 fGraphRateScan[fRateScanPatch2->value()+41].SetMarkerColor(kGreen); 2678 fGraphRateScan[fRateScanPatch2->value()+41].Draw("PL"); 2679 } 2680 if (fRateScanBoard1->value()>=0) 2681 { 2682 fGraphRateScan[fRateScanBoard1->value()+1].SetLineColor(kMagenta); 2683 fGraphRateScan[fRateScanBoard1->value()+1].SetMarkerColor(kMagenta); 2684 fGraphRateScan[fRateScanBoard1->value()+1].Draw("PL"); 2685 } 2686 if (fRateScanBoard2->value()>=0) 2687 { 2688 fGraphRateScan[fRateScanBoard2->value()+1].SetLineColor(kCyan); 2689 fGraphRateScan[fRateScanBoard2->value()+1].SetMarkerColor(kCyan); 2690 fGraphRateScan[fRateScanBoard2->value()+1].Draw("PL"); 2691 } 2692 2693 c->Modified(); 2694 c->Update(); 2695 #endif 2696 } 2697 2698 void handleRateScan(const DimData &d) 2699 { 2700 if (!CheckSize(d, 204*sizeof(float))) 2701 return; 2702 2703 UpdateRateScan(d.get<uint32_t>(), d.ptr<float>(12)); 2704 } 2705 2604 2706 // ========================== FSC ======================================= 2605 2707 … … 3193 3295 if (getInfo()==&fDimFeedbackDeviation) 3194 3296 return PostInfoHandler(&FactGui::handleFeedbackDeviation); 3297 3298 if (getInfo()==&fDimRateScan) 3299 return PostInfoHandler(&FactGui::handleRateScan); 3195 3300 3196 3301 // if (getInfo()==&fDimFadFiles) … … 3760 3865 fDimFeedbackReference ("FEEDBACK/REFERENCE", (void*)NULL, 0, this), 3761 3866 //- 3867 fDimRateScan ("RATE_SCAN/DATA", (void*)NULL, 0, this), 3868 //- 3762 3869 fEventData(0), fDrsCalibration(1440*1024*6), 3763 3870 fTimeStamp0(0) … … 3972 4079 3973 4080 fGraphFeedbackCmd.Draw("LP"); 4081 4082 // -------------------------------------------------------------------------- 4083 4084 c = fRateScanCanv->GetCanvas(); 4085 //c->SetBit(TCanvas::kNoContextMenu); 4086 c->SetBorderMode(0); 4087 c->SetFrameBorderMode(0); 4088 c->SetFillColor(kWhite); 4089 c->SetRightMargin(0.03); 4090 c->SetTopMargin(0.03); 4091 c->SetGrid(); 4092 c->cd(); 4093 4094 TH1F *h=new TH1F("Frame", "", 1, 0, 1); 4095 h->SetDirectory(0); 4096 h->SetBit(kCanDelete); 4097 h->SetStats(kFALSE); 4098 h->SetXTitle("Threshold [DAC]"); 4099 h->SetYTitle("Rate [Hz]"); 4100 h->GetXaxis()->CenterTitle(); 4101 h->GetYaxis()->CenterTitle(); 4102 h->GetXaxis()->SetLabelSize(0.025); 4103 h->GetYaxis()->SetLabelSize(0.025); 4104 h->GetYaxis()->SetTitleOffset(1.2); 4105 h->Draw(); 4106 4107 fGraphRateScan[0].SetName("CameraRate"); 4108 for (int i=0; i<40; i++) 4109 { 4110 fGraphRateScan[i+1].SetName("BoardRate"); 4111 fGraphRateScan[i+1].SetMarkerStyle(kFullDotMedium); 4112 } 4113 for (int i=0; i<160; i++) 4114 { 4115 fGraphRateScan[i+41].SetName("PatchRate"); 4116 fGraphRateScan[i+41].SetMarkerStyle(kFullDotMedium); 4117 } 4118 4119 fGraphRateScan[0].SetLineColor(kBlue); 4120 fGraphRateScan[0].SetMarkerColor(kBlue); 4121 fGraphRateScan[0].SetMarkerStyle(kFullDotSmall); 4122 fGraphRateScan[0].Draw("LP"); 3974 4123 3975 4124 // --------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.