Changeset 3583 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 03/23/04 09:11:11 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHFalseSource.cc
r3578 r3583 119 119 #include "MAstroSky2Local.h" 120 120 #include "MStatusDisplay.h" 121 #include "MMath.h" 121 122 122 123 #include "MBinning.h" … … 248 249 Double_t MHFalseSource::Significance(Double_t s, Double_t b) 249 250 { 250 const Double_t k = b==0 ? 0 : s/b; 251 const Double_t f = s+k*k*b; 252 253 return f==0 ? 0 : (s-b)/TMath::Sqrt(f); 251 return MMath::Significance(s, b); 254 252 } 255 253 … … 265 263 Double_t MHFalseSource::SignificanceLiMa(Double_t s, Double_t b, Double_t alpha) 266 264 { 267 const Double_t sum = s+b; 268 269 if (sum<=0 || alpha<=0) 270 return 0; 271 272 const Double_t l = s*TMath::Log(s/sum*(alpha+1)/alpha); 273 const Double_t m = b*TMath::Log(b/sum*(alpha+1) ); 274 275 return TMath::Sqrt((l+m)*2); 265 return MMath::SignificanceLiMa(s, b); 276 266 } 277 267 … … 712 702 const Int_t nx = fHist.GetXaxis()->GetNbins(); 713 703 const Int_t ny = fHist.GetYaxis()->GetNbins(); 704 const Int_t nr = nx*nx+ny*ny; 714 705 715 706 Double_t maxalpha0=0; … … 825 816 h6.Fill(sig); 826 817 827 if (sig>maxs )818 if (sig>maxs && ix*ix+iy*iy<nr*nr/9) 828 819 { 829 820 maxs = sig;
Note:
See TracChangeset
for help on using the changeset viewer.