Changeset 3578 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
03/22/04 16:59:44 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mhist
Files:
2 edited

Legend:

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

    r3577 r3578  
    259259//  ApJ 272 (1983) 317, Formula 17
    260260//
     261//  s                    // s: number of on events
     262//  b                    // b: number of off events
     263//  alpha = t_on/t_off;  // t: observation time
     264//
    261265Double_t MHFalseSource::SignificanceLiMa(Double_t s, Double_t b, Double_t alpha)
    262266{
    263     if (s+b<=0)
     267    const Double_t sum = s+b;
     268
     269    if (sum<=0 || alpha<=0)
    264270        return 0;
    265271
    266     const Double_t k = s/(s+b);
    267 
    268     const Double_t a = s*TMath::Log(k*(alpha+1)/alpha);
    269     const Double_t b = b*TMath::Log(k*(alpha+1)      );
    270 
    271     return TMath::Sqrt((a+b)*2);
     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);
    272276}
    273277
  • trunk/MagicSoft/Mars/mhist/MHFalseSource.h

    r3568 r3578  
    6666
    6767    static Double_t Significance(Double_t s, Double_t b);
     68    static Double_t SignificanceLiMa(Double_t s, Double_t b, Double_t alpha=1);
    6869
    6970    ClassDef(MHFalseSource, 1) //3D-histogram in alpha, x and y
Note: See TracChangeset for help on using the changeset viewer.