Ignore:
Timestamp:
04/29/03 09:18:03 (22 years ago)
Author:
moralejo
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhistmc
Files:
2 edited

Legend:

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

    r2015 r2036  
    4040#include "MHMcEnergyImpact.h"
    4141
     42#include "MLog.h"
     43#include "MLogManip.h"
     44
    4245ClassImp(MHMcCollectionArea);
    4346
     
    223226//  flag
    224227//
    225 void MHMcCollectionArea::CalcEfficiency(UInt_t numevts, Float_t angle)
     228void MHMcCollectionArea::CalcEfficiency(UInt_t numevts, Float_t emin, Float_t emax, Float_t index)
    226229{
    227230    // Here we estimate the total number of showers in each energy bin
     
    238241    MH::SetBinning(fHistCol, &xaxis);
    239242
    240     // TO BE FIXED! In forthcoming camera versions emin, emax and index
    241     // will be available in a run header, and should be read from it.
    242 
    243     const Float_t emin  = 10.;
    244     const Float_t emax  = 30000.;  // Energies in GeV.
    245     const Float_t index = 2.6;     // Differential spectral Index.
    246 
    247     const Float_t expo = 1.-index;
     243    const Float_t expo = 1+index;
    248244
    249245    const Float_t k = (Float_t)numevts / (pow(emax,expo) - pow(emin,expo));
     
    267263
    268264    // -----------------------------------------------------------
    269 
    270     // Impact parameter range:
     265    //
     266    // Impact parameter range:  TO BE FIXED! Impact parameter shoud be
     267    // read from run header, but it is not yet in!!
     268    //
    271269    const Float_t r1 = 0;
    272     const Float_t r2 = 400;
    273 
    274     const Float_t dr = TMath::Pi() * (r2*r2 - r1*r1);
    275 
    276     angle *= TMath::Pi()/180;
     270    const Float_t r2 = 300;
     271
     272    *fLog << warn << endl << dbginf << "WARNING! I will assume a maximum impact parameter of 300 meters for the MC events. Check that this is the true one!" <<endl<<endl;
     273    const Float_t area = TMath::Pi() * (r2*r2 - r1*r1);
    277274
    278275    for (Int_t ix=1; ix<=nbinx; ix++)
     
    294291        const Double_t eff = Ns/Na;
    295292
    296         const Double_t err = sqrt((1.-eff)*Ns)/Na;
    297 
    298         const Float_t area = dr * cos(angle);
     293        const Double_t efferr = sqrt((1.-eff)*Ns)/Na;
    299294
    300295        fHistCol->SetBinContent(ix, eff*area);
    301         fHistCol->SetBinError(ix, err*area);
     296        fHistCol->SetBinError(ix, efferr*area);
    302297    }
    303298
     
    340335
    341336            const Double_t eff = h.GetCellContent(ix, iy);
    342             const Double_t err = h.GetCellError(ix, iy);
     337            const Double_t efferr = h.GetCellError(ix, iy);
    343338
    344339            colA += eff*A;
    345             errA += A*A * err*err;
     340            errA += A*A * efferr*efferr;
    346341        }
    347342
  • trunk/MagicSoft/Mars/mhistmc/MHMcCollectionArea.h

    r2015 r2036  
    3838
    3939    void CalcEfficiency();
    40     void CalcEfficiency(UInt_t allevts, Float_t theta);
     40    void CalcEfficiency(UInt_t allevts, Float_t emin, Float_t emax, Float_t index);
    4141
    4242    void Calc(const MHMcEnergyImpact &mcsel, const MHMcEnergyImpact &mcall);
Note: See TracChangeset for help on using the changeset viewer.