Changeset 8879 for trunk/MagicSoft/Mars/mhflux
- Timestamp:
- 03/03/08 14:59:12 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/mhflux
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MHAlpha.cc
r8787 r8879 884 884 } 885 885 886 void MHAlpha::DrawNicePlot(Bool_t newc, const char *title, const char *watermark )886 void MHAlpha::DrawNicePlot(Bool_t newc, const char *title, const char *watermark, Int_t binlo, Int_t binhi) 887 887 { 888 888 if (!newc && !fDisplay) … … 909 909 910 910 // Get on-data 911 TH1D *hon = (TH1D*)fHist.ProjectionZ("Proj", -1, 9999, -1, 9999, "E");911 TH1D *hon = (TH1D*)fHist.ProjectionZ("Proj", -1, 9999, binlo, binhi, "E"); 912 912 hon->SetDirectory(NULL); 913 913 hon->SetBit(kCanDelete); … … 921 921 if (fOffData) 922 922 { 923 hoff = (TH1D*)fOffData->ProjectionZ("ProjOff", -1, 9999, -1, 9999, "E");923 hoff = (TH1D*)fOffData->ProjectionZ("ProjOff", -1, 9999, binlo, binhi, "E"); 924 924 hoff->SetDirectory(NULL); 925 925 hoff->SetBit(kCanDelete); … … 947 947 948 948 // scale off-data 949 fFit.Scale(*hoff, *hon); 949 950 MAlphaFitter fit(fFit); 951 fit.ScaleAndFit(*hon, hoff); 950 952 951 953 hon->SetMinimum(0); … … 971 973 text.SetTextSize(0.07); 972 974 text.SetTextAngle(2.5); 973 if (watermark) 974 text.DrawLatex(0.45, 0.2, watermark); 975 976 TString wm(watermark); 977 if (binlo>=1 || binhi<hon->GetNbinsX()) 978 { 979 wm += wm.IsNull() ? "(" : " ("; 980 if (binlo>=1) 981 wm += Form("%.1fGeV", fHist.GetYaxis()->GetBinLowEdge(binlo)); 982 wm += "-"; 983 if (binhi<hon->GetNbinsX()) 984 wm += Form("%.1fGeV", fHist.GetYaxis()->GetBinLowEdge(binhi+1)); 985 wm += ")"; 986 } 987 if (!wm.IsNull()) 988 text.DrawLatex(0.45, 0.2, wm); 975 989 //enum { kTextNDC = BIT(14) }; 976 990 … … 995 1009 // fFit.GetSignificance(), fFit.GetScaleFactor(), fFit.GetGausSigma()); 996 1010 sprintf(txt, "Significance %.1f\\sigma, off-scale %.2f", 997 f Fit.GetSignificance(), fFit.GetScaleFactor());1011 fit.GetSignificance(), fit.GetScaleFactor()); 998 1012 ptxt = pave->AddText(txt); 999 1013 ptxt->SetTextAlign(23); 1000 1014 1001 1015 sprintf(txt, "%.1f excess events, %.1f background events", 1002 f Fit.GetEventsExcess(), fFit.GetEventsBackground());1016 fit.GetEventsExcess(), fit.GetEventsBackground()); 1003 1017 ptxt = pave->AddText(txt); 1004 1018 ptxt->SetTextAlign(23); -
trunk/MagicSoft/Mars/mhflux/MHAlpha.h
r8775 r8879 139 139 } 140 140 141 void DrawNicePlot(const char *title="MAGIC Telescope observation", const char *watermark="preliminary" ) { DrawNicePlot(kTRUE, title, watermark); } //*MENU*142 void DrawNicePlot(Bool_t newc, const char *title=0, const char *watermark=0 );141 void DrawNicePlot(const char *title="MAGIC Telescope observation", const char *watermark="preliminary", Int_t binlo=-1, Int_t binhi=9999) { DrawNicePlot(kTRUE, title, watermark, binlo, binhi); } //*MENU* 142 void DrawNicePlot(Bool_t newc, const char *title=0, const char *watermark=0, Int_t binlo=-1, Int_t binhi=9999); 143 143 void DrawAll() { DrawAll(kTRUE); } //*MENU* 144 144 void DrawAll(Bool_t newc);
Note:
See TracChangeset
for help on using the changeset viewer.