Changeset 8989 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 07/01/08 15:04:01 (17 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MMath.cc
r8988 r8989 1 1 /* ======================================================================== *\ 2 ! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.4 0 2008-06-30 09:36:35tbretz Exp $2 ! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.41 2008-07-01 14:03:58 tbretz Exp $ 3 3 ! -------------------------------------------------------------------------- 4 4 ! … … 172 172 // 173 173 // Return Li/Ma (5) for the error of the excess, under the assumption that 174 // the existance of a signal is already known. 175 // 176 Double_t MMath::SignificanceLiMaExc(Double_t s, Double_t b, Double_t alpha) 177 { 178 Double_t Ns = s - alpha*b; 179 Double_t sN = s + alpha*alpha*b; 180 181 if (Ns<0 || sN<0) 174 // the existance of a signal is already known. (basically signal/error 175 // calculated by error propagation) 176 // 177 Double_t MMath::SignificanceExc(Double_t s, Double_t b, Double_t alpha) 178 { 179 const Double_t error = ErrorExc(s, b, alpha); 180 if (error==0) 182 181 return 0; 183 182 184 if (Ns==0 && sN==0) 185 return 0; 186 187 return Ns/TMath::Sqrt(sN); 183 const Double_t Ns = s - alpha*b; 184 185 return Ns/error; 186 } 187 188 // -------------------------------------------------------------------------- 189 // 190 // Calculate the error of s-alpha*b by error propagation 191 // 192 Double_t MMath::ErrorExc(Double_t s, Double_t b, Double_t alpha) 193 { 194 const Double_t sN = s + alpha*alpha*b; 195 return sN<0 ? 0 : TMath::Sqrt(sN); 188 196 } 189 197 -
trunk/MagicSoft/Mars/mbase/MMath.h
r8978 r8989 37 37 Double_t SignificanceLiMa(Double_t s, Double_t b, Double_t alpha=1); 38 38 Double_t SignificanceLiMaSigned(Double_t s, Double_t b, Double_t alpha=1); 39 Double_t SignificanceLiMaExc(Double_t s, Double_t b, Double_t alpha=1); 39 Double_t SignificanceExc(Double_t s, Double_t b, Double_t alpha=1); 40 Double_t ErrorExc(Double_t s, Double_t b, Double_t alpha=1); 40 41 41 42 void ReducePrecision(Float_t &val);
Note:
See TracChangeset
for help on using the changeset viewer.