Changeset 3597 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 03/24/04 15:08:19 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MMath.cc
r3595 r3597 59 59 // alpha = t_on/t_off; // t: observation time 60 60 // 61 // Returns -1 if calculation failed... 61 // Returns -1 if sum<0 or alpha<0 or the argument of sqrt<0 62 // Returns 0 if s+b==0 62 63 // 63 64 Double_t MMath::SignificanceLiMa(Double_t s, Double_t b, Double_t alpha) … … 65 66 const Double_t sum = s+b; 66 67 67 if (sum<=0 || alpha<=0) 68 if (sum==0) 69 return 0; 70 71 if (sum<0 || alpha<=0) 68 72 return -1; 69 73 … … 71 75 const Double_t m = b*TMath::Log(b/sum*(alpha+1) ); 72 76 73 return TMath::Sqrt((l+m)*2);77 return l+m<0 ? -1 : TMath::Sqrt((l+m)*2); 74 78 }
Note:
See TracChangeset
for help on using the changeset viewer.