Changeset 8356 for trunk/MagicSoft
- Timestamp:
- 03/03/07 22:06:24 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhcalib/MHCalibrationRelTimeCam.cc
r8339 r8356 373 373 374 374 histhi.AddSaturated(1); 375 375 /* 376 376 // If lo-gain arrival time has been extracted successfully, 377 377 // the hi-gain has saturateed and the lo-gain is switched on … … 391 391 fSumsectorlo[sector] += time; 392 392 fNumsectorlo[sector] ++; 393 } 393 }*/ 394 394 } 395 395 … … 737 737 void MHCalibrationRelTimeCam::DrawDataCheckPixel(MHCalibrationPix &pix, const Float_t refline) 738 738 { 739 740 739 if (pix.IsEmpty()) 741 740 return; 741 742 TVirtualPad *pad = gPad; 743 pad->Divide(1,2, 1e-10, 1e-10); 744 pad->cd(1); 745 746 gPad->SetBorderMode(0); 747 748 gPad->SetTicks(); 749 if (!pix.IsEmpty() && !pix.IsOnlyOverflow() && !pix.IsOnlyUnderflow()) 750 gPad->SetLogy(); 751 752 TH1F *hist = pix.GetHGausHist(); 742 753 743 TVirtualPad *newpad = gPad; 744 newpad->Divide(1,2); 745 newpad->cd(1); 746 747 gPad->SetTicks(); 748 if (!pix.IsEmpty() && !pix.IsOnlyOverflow() && !pix.IsOnlyUnderflow()) 749 gPad->SetLogy(); 750 751 TH1F *hist = pix.GetHGausHist(); 752 753 TH1F *null = new TH1F("Null",hist->GetTitle(),100,0.,pix.GetLast()); 754 755 null->SetMaximum(1.1*hist->GetMaximum()); 756 null->SetDirectory(NULL); 757 null->SetBit(kCanDelete); 758 null->SetStats(kFALSE); 759 // 760 // set the labels bigger 761 // 762 TAxis *xaxe = null->GetXaxis(); 763 TAxis *yaxe = null->GetYaxis(); 764 xaxe->CenterTitle(); 765 yaxe->CenterTitle(); 766 xaxe->SetTitleSize(0.07); 767 yaxe->SetTitleSize(0.07); 768 xaxe->SetTitleOffset(0.65); 769 yaxe->SetTitleOffset(0.55); 770 xaxe->SetLabelSize(0.06); 771 yaxe->SetLabelSize(0.06); 772 xaxe->SetTitle(hist->GetXaxis()->GetTitle()); 773 yaxe->SetTitle(hist->GetYaxis()->GetTitle()); 774 775 null->Draw(); 776 hist->Draw("same"); 777 778 gStyle->SetOptFit(); 779 780 TF1 *fit = pix.GetFGausFit(); 781 782 if (fit) 783 { 784 switch ( fColor ) 785 { 786 case MCalibrationCam::kGREEN: 787 fit->SetLineColor(kGreen); 788 break; 789 case MCalibrationCam::kBLUE: 790 fit->SetLineColor(kBlue); 791 break; 792 case MCalibrationCam::kUV: 793 fit->SetLineColor(106); 794 break; 795 case MCalibrationCam::kCT1: 796 fit->SetLineColor(006); 797 break; 798 default: 799 fit->SetLineColor(kRed); 800 } 801 fit->Draw("same"); 802 } 803 804 DisplayRefLines(null,refline); 805 806 newpad->cd(2); 807 gPad->SetTicks(); 808 809 TH1F *null2 = new TH1F("Null2",hist->GetTitle(),100,0.,pix.GetEvents()->GetSize()/pix.GetEventFrequency()); 810 811 null2->SetMinimum(pix.GetMean()-10.*pix.GetSigma()); 812 null2->SetMaximum(pix.GetMean()+10.*pix.GetSigma()); 813 null2->SetDirectory(NULL); 814 null2->SetBit(kCanDelete); 815 null2->SetStats(kFALSE); 816 // 817 // set the labels bigger 818 // 819 TAxis *xaxe2 = null2->GetXaxis(); 820 TAxis *yaxe2 = null2->GetYaxis(); 821 xaxe2->CenterTitle(); 822 yaxe2->CenterTitle(); 823 xaxe2->SetTitleSize(0.07); 824 yaxe2->SetTitleSize(0.07); 825 xaxe2->SetTitleOffset(0.65); 826 yaxe2->SetTitleOffset(0.55); 827 xaxe2->SetLabelSize(0.06); 828 yaxe2->SetLabelSize(0.06); 829 830 pix.CreateGraphEvents(); 831 TGraph *gr = pix.GetGraphEvents(); 832 if (gr) 833 { 834 xaxe2->SetTitle(gr->GetXaxis()->GetTitle()); 835 yaxe2->SetTitle(gr->GetYaxis()->GetTitle()); 836 } 837 838 null2->Draw(); 839 840 pix.DrawEvents("same"); 841 842 return; 754 // 755 // set the labels bigger 756 // 757 TAxis *xaxe = hist->GetXaxis(); 758 TAxis *yaxe = hist->GetYaxis(); 759 xaxe->CenterTitle(); 760 yaxe->CenterTitle(); 761 xaxe->SetTitleSize(0.07); 762 yaxe->SetTitleSize(0.07); 763 xaxe->SetTitleOffset(0.65); 764 yaxe->SetTitleOffset(0.55); 765 xaxe->SetLabelSize(0.06); 766 yaxe->SetLabelSize(0.06); 767 xaxe->SetTitle(hist->GetXaxis()->GetTitle()); 768 yaxe->SetTitle(hist->GetYaxis()->GetTitle()); 769 xaxe->SetRange(hist->GetMaximumBin()-1500, hist->GetMaximumBin()+1500); 770 771 hist->Draw(); 772 773 gStyle->SetOptFit(); 774 775 TF1 *fit = pix.GetFGausFit(); 776 777 if (fit) 778 { 779 switch (fColor) 780 { 781 case MCalibrationCam::kGREEN: 782 fit->SetLineColor(kGreen); 783 break; 784 case MCalibrationCam::kBLUE: 785 fit->SetLineColor(kBlue); 786 break; 787 case MCalibrationCam::kUV: 788 fit->SetLineColor(106); 789 break; 790 case MCalibrationCam::kCT1: 791 fit->SetLineColor(006); 792 break; 793 default: 794 fit->SetLineColor(kRed); 795 } 796 fit->Draw("same"); 797 } 798 799 DisplayRefLines(hist, refline); 800 801 pad->cd(2); 802 gPad->SetBorderMode(0); 803 gPad->SetTicks(); 804 805 pix.CreateGraphEvents(); 806 TGraph *gr = pix.GetGraphEvents(); 807 if (gr) 808 { 809 TH1F *null2 = gr->GetHistogram(); 810 811 null2->SetMinimum(pix.GetMean()-10.*pix.GetSigma()); 812 null2->SetMaximum(pix.GetMean()+10.*pix.GetSigma()); 813 814 // 815 // set the labels bigger 816 // 817 TAxis *xaxe2 = null2->GetXaxis(); 818 TAxis *yaxe2 = null2->GetYaxis(); 819 xaxe2->CenterTitle(); 820 yaxe2->CenterTitle(); 821 xaxe2->SetTitleSize(0.07); 822 yaxe2->SetTitleSize(0.07); 823 xaxe2->SetTitleOffset(0.65); 824 yaxe2->SetTitleOffset(0.55); 825 xaxe2->SetLabelSize(0.06); 826 yaxe2->SetLabelSize(0.06); 827 xaxe2->SetRangeUser(0.,pix.GetEvents()->GetSize()/pix.GetEventFrequency()); 828 } 829 830 pix.DrawEvents(); 843 831 } 844 832 845 833 void MHCalibrationRelTimeCam::DisplayRefLines(const TH1F *hist, const Float_t refline) const 846 834 { 847 848 TGraph *gr = new TGraph(2); 849 gr->SetPoint(0,refline,0.); 850 gr->SetPoint(1,refline,hist->GetMaximum()); 851 gr->SetBit(kCanDelete); 852 gr->SetLineColor(kGreen); 853 gr->SetLineStyle(2); 854 gr->SetLineWidth(3); 855 gr->Draw("L"); 856 857 TLegend *leg = new TLegend(0.75,0.7,0.99,0.99); 858 leg->SetBit(kCanDelete); 859 leg->AddEntry(gr,"Trigger Calibration","l"); 860 leg->Draw(); 835 TLine *line = new TLine(refline, 0, refline, hist->GetMaximum()); 836 line->SetLineColor(kGreen); 837 line->SetLineStyle(2); 838 line->SetLineWidth(3); 839 line->SetBit(kCanDelete); 840 line->Draw(); 841 842 TLegend *leg = new TLegend(0.75,0.01,0.99,0.3); 843 leg->SetBit(kCanDelete); 844 leg->AddEntry(line, "Trigger Calibration", "l"); 845 leg->Draw(); 861 846 } 862 847
Note:
See TracChangeset
for help on using the changeset viewer.