Changeset 8978 for trunk/MagicSoft/Mars/mjobs
- Timestamp:
- 06/18/08 21:39:50 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mjobs/MJSpectrum.cc
r8977 r8978 48 48 #include "MLogManip.h" 49 49 50 #include "MMath.h" 50 51 #include "MDirIter.h" 51 52 … … 292 293 293 294 const Double_t ufl = vstime->GetBinContent(0); 295 const Double_t ofl = vstime->GetBinContent(vstime->GetNbinsX()+1); 296 const Double_t eff = vstime->Integral()+ufl+ofl; 294 297 if (ufl>0) 295 298 { … … 301 304 *fLog << warn << "WARNING - " << Form("%.1f%% (%.0fs)", 100*ufl/eff, ufl) << " of the eff. observation time is in the underflow bin." << endl; 302 305 } 303 304 const Double_t ofl = vstime->GetBinContent(vstime->GetNbinsX()+1);305 const Double_t eff = vstime->Integral()+ufl+ofl;306 306 if (ofl>0) 307 307 *fLog << warn << "WARNING - " << Form("%.1f%% (%.0fs)", 100*ofl/eff, ofl) << " of the eff. observation time is in the overflow bin." << endl; … … 872 872 TString MJSpectrum::FormString(const TF1 &f, Byte_t type) 873 873 { 874 const Double_t p0 = f.GetParameter(0); 875 const Double_t p1 = f.GetParameter(1); 876 877 const Double_t e0 = f.GetParError(0); 878 const Double_t e1 = f.GetParError(1); 879 880 const Int_t np = TMath::Nint(TMath::Floor(TMath::Log10(p1))); 881 const Double_t exp = TMath::Power(10, np); 882 883 const Float_t fe0 = TMath::Log10(e0); 884 const Float_t fe1 = TMath::Log10(e1); 885 886 // calc number of (gueltige ziffern) digits to be displayed 887 const char *f0 = fe0-TMath::Floor(fe0)>0.3 ? "3.1" : "1.0"; 888 const char *f1 = fe1-TMath::Floor(fe1)>0.3 ? "3.1" : "1.0"; 874 Double_t p0 = f.GetParameter(0); 875 Double_t p1 = f.GetParameter(1); 876 877 Double_t e0 = f.GetParError(0); 878 Double_t e1 = f.GetParError(1); 879 880 MMath::Format(p0, e0); 881 MMath::Format(p1, e1); 889 882 890 883 TString str; … … 893 886 case 0: 894 887 { 895 const TString fmt0 = Form("(%%%sf#pm%%%sf)\\bullet10^{%%d}", f1, f1);896 const TString fmt1 = Form("(\\frac{E}{500GeV})^{%%%sf#pm%%%sf}", f0, f0);897 898 str = Form( fmt0.Data(), p1/exp, e1/exp, np);899 str += Form( fmt1.Data(), p0, e0);888 const Int_t i = TMath::FloorNint(TMath::Log10(p1)); 889 const Double_t exp = TMath::Power(10, i); 890 891 str = Form("(%f#pm%f)\\bullet10^{%d}", p1/exp, e1/exp, i); 892 str += Form("(\\frac{E}{500GeV})^{%f#pm%f}", p0, e0); 900 893 str += "\\frac{ph}{TeVm^{2}s}"; 901 894 }
Note:
See TracChangeset
for help on using the changeset viewer.