Ignore:
Timestamp:
04/06/04 13:41:56 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r3597 r3666  
    5252// --------------------------------------------------------------------------
    5353//
     54// Symmetrized significance - this is somehow analog to
     55// SignificanceLiMaSigned
     56//
     57// Returns Significance(s,b) if s>b otherwise -Significance(b, s);
     58//
     59Double_t MMath::SignificanceSym(Double_t s, Double_t b)
     60{
     61    return s>b ? Significance(s, b) : -Significance(b, s);
     62}
     63
     64// --------------------------------------------------------------------------
     65//
    5466//  calculates the significance according to Li & Ma
    5567//  ApJ 272 (1983) 317, Formula 17
     
    5870//  b                    // b: number of off events
    5971//  alpha = t_on/t_off;  // t: observation time
     72//
     73//  The significance has the same (positive!) value for s>b and b>s.
    6074//
    6175//  Returns -1 if sum<0 or alpha<0 or the argument of sqrt<0
     
    7791    return l+m<0 ? -1 : TMath::Sqrt((l+m)*2);
    7892}
     93
     94// --------------------------------------------------------------------------
     95//
     96// Calculates MMath::SignificanceLiMa(s, b, alpha). Returns 0 if the
     97// calculation has failed. Otherwise the Li/Ma significance which was
     98// calculated. If s<b a negative value is returned.
     99//
     100Double_t MMath::SignificanceLiMaSigned(Double_t s, Double_t b, Double_t alpha)
     101{
     102    const Double_t sig = SignificanceLiMa(s, b, alpha);
     103    if (sig<=0)
     104        return 0;
     105
     106    return TMath::Sign(sig, s-b);
     107}
Note: See TracChangeset for help on using the changeset viewer.