Changeset 1227 for trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc
- Timestamp:
- 02/28/02 16:36:54 (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc
r1088 r1227 30 30 31 31 #include "MH.h" 32 #include "MHMcEfficiency.h" 32 33 33 34 ClassImp(MHMcCollectionArea); … … 192 193 } 193 194 195 void MHMcCollectionArea::Calc(MHMcEfficiency *heff) 196 { 197 // 198 // now calculate the Collection area for different 199 // energies 200 // 201 TH2D &h = (TH2D&)*heff->GetHist(); 202 203 const Int_t nbinx = h.GetXaxis()->GetNbins(); 204 const Int_t nbiny = h.GetYaxis()->GetNbins(); 205 206 for (Int_t ix=1; ix<=nbinx; ix++) 207 { 208 Double_t errA = 0; 209 Double_t colA = 0; 210 211 for (Int_t iy=1; iy<=nbiny; iy++) 212 { 213 TAxis *yaxis = h.GetYaxis(); 214 215 const Double_t r1 = yaxis->GetBinLowEdge(iy); 216 const Double_t r2 = yaxis->GetBinLowEdge(iy+1); 217 218 const Double_t A = TMath::Pi() * (r2*r2 - r1*r1); 219 220 const Double_t eff = h.GetCellContent(ix, iy); 221 const Double_t err = h.GetCellError(ix, iy); 222 223 colA += eff*A; 224 errA += A*A * err*err; 225 } 226 227 fHistCol->SetBinContent(ix, colA); 228 fHistCol->SetBinError(ix, sqrt(errA)); 229 } 230 } 231 194 232 // -------------------------------------------------------------------------- 195 233 // … … 201 239 // Description! 202 240 241 /* 203 242 // 204 243 // first of all calculate the efficency … … 258 297 fHistCol->SetBinContent(ix, colA); 259 298 fHistCol->SetBinError(ix, sqrt(errA)); 260 } 299 } 300 */ 301 MHMcEfficiency heff; 302 heff.Calc(fHistSel, fHistAll); 303 304 Calc(&heff); 261 305 262 306 SetReadyToSave();
Note:
See TracChangeset
for help on using the changeset viewer.