Ignore:
Timestamp:
03/23/04 09:11:11 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r3578 r3583  
    119119#include "MAstroSky2Local.h"
    120120#include "MStatusDisplay.h"
     121#include "MMath.h"
    121122
    122123#include "MBinning.h"
     
    248249Double_t MHFalseSource::Significance(Double_t s, Double_t b)
    249250{
    250     const Double_t k = b==0 ? 0 : s/b;
    251     const Double_t f = s+k*k*b;
    252 
    253     return f==0 ? 0 : (s-b)/TMath::Sqrt(f);
     251    return MMath::Significance(s, b);
    254252}
    255253
     
    265263Double_t MHFalseSource::SignificanceLiMa(Double_t s, Double_t b, Double_t alpha)
    266264{
    267     const Double_t sum = s+b;
    268 
    269     if (sum<=0 || alpha<=0)
    270         return 0;
    271 
    272     const Double_t l = s*TMath::Log(s/sum*(alpha+1)/alpha);
    273     const Double_t m = b*TMath::Log(b/sum*(alpha+1)      );
    274 
    275     return TMath::Sqrt((l+m)*2);
     265    return MMath::SignificanceLiMa(s, b);
    276266}
    277267
     
    712702    const Int_t nx = fHist.GetXaxis()->GetNbins();
    713703    const Int_t ny = fHist.GetYaxis()->GetNbins();
     704    const Int_t nr = nx*nx+ny*ny;
    714705
    715706    Double_t maxalpha0=0;
     
    825816                h6.Fill(sig);
    826817
    827             if (sig>maxs)
     818            if (sig>maxs && ix*ix+iy*iy<nr*nr/9)
    828819            {
    829820                maxs = sig;
Note: See TracChangeset for help on using the changeset viewer.