Ignore:
Timestamp:
02/28/02 16:36:54 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhist/MHMcCollectionArea.cc

    r1088 r1227  
    3030
    3131#include "MH.h"
     32#include "MHMcEfficiency.h"
    3233
    3334ClassImp(MHMcCollectionArea);
     
    192193}
    193194
     195void 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
    194232// --------------------------------------------------------------------------
    195233//
     
    201239    // Description!
    202240
     241    /*
    203242    //
    204243    //  first of all calculate the efficency
     
    258297        fHistCol->SetBinContent(ix, colA);
    259298        fHistCol->SetBinError(ix, sqrt(errA));
    260     }
     299        }
     300        */
     301    MHMcEfficiency heff;
     302    heff.Calc(fHistSel, fHistAll);
     303
     304    Calc(&heff);
    261305
    262306    SetReadyToSave();
Note: See TracChangeset for help on using the changeset viewer.