Changeset 11426 for trunk/Mars


Ignore:
Timestamp:
07/15/11 15:46:14 (13 years ago)
Author:
tbretz
Message:
Added GaussProb2D
Location:
trunk/Mars/mbase
Files:
2 edited

Legend:

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

    r10166 r11426  
    223223}
    224224
     225// --------------------------------------------------------------------------
     226//
     227// Returns: 1 - exp((x/sigma)^2 / 2)
     228//
     229Double_t MMath::GaussProb2D(Double_t x, Double_t sigma)
     230{
     231    const Double_t xs = x/sigma;
     232    return 1 - TMath::Exp(-xs*xs/2);
     233}
     234
    225235// ------------------------------------------------------------------------
    226236//
     
    720730//     Q := (3*b - a^2)/9
    721731//     R := (9*b*a - 27*c - 2*a^3)/54
    722 //     D := Q^3 + R^2                          % polynomial discriminant
     732//     D := R^2 -Q^3                           % polynomial discriminant
    723733//
    724734//     if (D >= 0) then                        % complex or duplicate roots
  • trunk/Mars/mbase/MMath.h

    r9226 r11426  
    1717{
    1818    Double_t GaussProb(Double_t x, Double_t sigma=1, Double_t mean=0);
     19    Double_t GaussProb2D(Double_t x, Double_t sigma=1);
    1920
    2021    template <class Size, class Element> void ReSortImp(Size n, Element *a, Bool_t down=kFALSE);
Note: See TracChangeset for help on using the changeset viewer.