- Timestamp:
- 05/18/06 17:22:42 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7713 r7715 39 39 * callisto.cc: 40 40 - fixed typo in output 41 42 * mhflux/MHThreshold.cc: 43 - enabled grids 44 - slightly improved calculation of shown threshold 41 45 42 46 -
trunk/MagicSoft/Mars/mhflux/MHThreshold.cc
r7302 r7715 74 74 75 75 fHEnergy.SetName("Threshold"); 76 fHEnergy.SetTitle("Energy Thr shold");76 fHEnergy.SetTitle("Energy Threshold"); 77 77 fHEnergy.SetXTitle("E [GeV]"); 78 78 fHEnergy.SetYTitle("dN/dE [GeV^{-1}]"); … … 81 81 fHEnergy.Sumw2(); 82 82 83 MBinning binse( 80, 10, 1000000, "", "log");83 MBinning binse(50, 20, 50000, "", "log"); 84 84 binse.Apply(fHEnergy); 85 85 } … … 108 108 void MHThreshold::Paint(Option_t *option) 109 109 { 110 const TAxis &axe = *fHEnergy.GetXaxis(); 110 if (fHEnergy.GetEntries()==0) 111 return; 111 112 112 const Int_t bin = fHEnergy.GetMaximumBin(); 113 TH1D h(fHEnergy); 114 115 Int_t min=1; 116 while (min<h.GetNbinsX() && h.GetBinContent(min)==0) 117 min++; 118 Int_t max=h.GetNbinsX(); 119 while (max>min && h.GetBinContent(max)==0) 120 max--; 121 122 if (max-min<5) 123 return; 124 125 h.Smooth(1, min, max); 126 127 const Int_t bin = h.GetMaximumBin(); 128 const TAxis &axe = *h.GetXaxis(); 113 129 114 130 // Assume that the energy binning is logarithmic 115 131 const Axis_t maxe = TMath::Sqrt(axe.GetBinLowEdge(bin)*axe.GetBinUpEdge(bin)); 116 132 117 TLatex text(0.30, 0.95, Form("E_{max}=%dGeV", TMath::Nint(maxe))); 133 TLatex text(0.30, 0.95, Form("E_{max}=%dGeV (%dGeV,%dGeV)", TMath::Nint(maxe), 134 TMath::Nint(axe.GetBinLowEdge(bin)), 135 TMath::Nint(axe.GetBinUpEdge(bin)))); 118 136 text.SetBit(TLatex::kTextNDC); 119 137 text.SetTextSize(0.04); … … 131 149 gPad->SetLogx(); 132 150 gPad->SetLogy(); 151 gPad->SetGridx(); 152 gPad->SetGridy(); 133 153 134 154 fHEnergy.Draw();
Note:
See TracChangeset
for help on using the changeset viewer.