Ignore:
Timestamp:
03/24/04 15:08:19 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MMath.cc

    r3595 r3597  
    5959//  alpha = t_on/t_off;  // t: observation time
    6060//
    61 //  Returns -1 if calculation failed...
     61//  Returns -1 if sum<0 or alpha<0 or the argument of sqrt<0
     62//  Returns  0 if s+b==0
    6263//
    6364Double_t MMath::SignificanceLiMa(Double_t s, Double_t b, Double_t alpha)
     
    6566    const Double_t sum = s+b;
    6667
    67     if (sum<=0 || alpha<=0)
     68    if (sum==0)
     69        return 0;
     70
     71    if (sum<0 || alpha<=0)
    6872        return -1;
    6973
     
    7175    const Double_t m = b*TMath::Log(b/sum*(alpha+1)      );
    7276
    73     return TMath::Sqrt((l+m)*2);
     77    return l+m<0 ? -1 : TMath::Sqrt((l+m)*2);
    7478}
Note: See TracChangeset for help on using the changeset viewer.