Changeset 4716 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 08/23/04 17:49:53 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MMath.cc
r3666 r4716 47 47 const Double_t f = s+k*k*b; 48 48 49 return f==0 ? 0 : (s-b)/ TMath::Sqrt(f);49 return f==0 ? 0 : (s-b)/Sqrt(f); 50 50 } 51 51 … … 86 86 return -1; 87 87 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) ); 90 90 91 return l+m<0 ? -1 : TMath::Sqrt((l+m)*2);91 return l+m<0 ? -1 : Sqrt((l+m)*2); 92 92 } 93 93 … … 104 104 return 0; 105 105 106 return TMath::Sign(sig, s-b);106 return Sign(sig, s-b); 107 107 } 108 109 // -------------------------------------------------------------------------- 110 // 111 // Returns: 2/(sigma*sqrt(2))*integral[0,x](exp(-(x-mu)^2/(2*sigma^2))) 112 // 113 Double_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 9 9 { 10 10 public: 11 static Double_t GaussProb(Double_t x, Double_t sigma, Double_t mean=0); 12 11 13 static Double_t Significance(Double_t s, Double_t b); 12 14 static Double_t SignificanceSym(Double_t s, Double_t b);
Note:
See TracChangeset
for help on using the changeset viewer.