Ignore:
Timestamp:
08/23/04 17:49:53 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mbase
Files:
2 edited

Legend:

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

    r3666 r4716  
    4747    const Double_t f = s+k*k*b;
    4848
    49     return f==0 ? 0 : (s-b)/TMath::Sqrt(f);
     49    return f==0 ? 0 : (s-b)/Sqrt(f);
    5050}
    5151
     
    8686        return -1;
    8787
    88     const Double_t l = s*TMath::Log(s/sum*(alpha+1)/alpha);
    89     const Double_t m = b*TMath::Log(b/sum*(alpha+1)      );
     88    const Double_t l = s*Log(s/sum*(alpha+1)/alpha);
     89    const Double_t m = b*Log(b/sum*(alpha+1)      );
    9090
    91     return l+m<0 ? -1 : TMath::Sqrt((l+m)*2);
     91    return l+m<0 ? -1 : Sqrt((l+m)*2);
    9292}
    9393
     
    104104        return 0;
    105105
    106     return TMath::Sign(sig, s-b);
     106    return Sign(sig, s-b);
    107107}
     108
     109// --------------------------------------------------------------------------
     110//
     111// Returns: 2/(sigma*sqrt(2))*integral[0,x](exp(-(x-mu)^2/(2*sigma^2)))
     112//
     113Double_t MMath::GaussProb(Double_t x, Double_t sigma, Double_t mean)
     114{
     115    static const Double_t sqrt2 = Sqrt(2.);
     116    return Erf((x-mean)/(sigma*sqrt2));
     117}
     118
  • trunk/MagicSoft/Mars/mbase/MMath.h

    r3666 r4716  
    99{
    1010public:
     11    static Double_t GaussProb(Double_t x, Double_t sigma, Double_t mean=0);
     12
    1113    static Double_t Significance(Double_t s, Double_t b);
    1214    static Double_t SignificanceSym(Double_t s, Double_t b);
Note: See TracChangeset for help on using the changeset viewer.