Changeset 3666 for trunk/MagicSoft/Mars/mbase/MMath.cc
- Timestamp:
- 04/06/04 13:41:56 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MMath.cc
r3597 r3666 52 52 // -------------------------------------------------------------------------- 53 53 // 54 // Symmetrized significance - this is somehow analog to 55 // SignificanceLiMaSigned 56 // 57 // Returns Significance(s,b) if s>b otherwise -Significance(b, s); 58 // 59 Double_t MMath::SignificanceSym(Double_t s, Double_t b) 60 { 61 return s>b ? Significance(s, b) : -Significance(b, s); 62 } 63 64 // -------------------------------------------------------------------------- 65 // 54 66 // calculates the significance according to Li & Ma 55 67 // ApJ 272 (1983) 317, Formula 17 … … 58 70 // b // b: number of off events 59 71 // alpha = t_on/t_off; // t: observation time 72 // 73 // The significance has the same (positive!) value for s>b and b>s. 60 74 // 61 75 // Returns -1 if sum<0 or alpha<0 or the argument of sqrt<0 … … 77 91 return l+m<0 ? -1 : TMath::Sqrt((l+m)*2); 78 92 } 93 94 // -------------------------------------------------------------------------- 95 // 96 // Calculates MMath::SignificanceLiMa(s, b, alpha). Returns 0 if the 97 // calculation has failed. Otherwise the Li/Ma significance which was 98 // calculated. If s<b a negative value is returned. 99 // 100 Double_t MMath::SignificanceLiMaSigned(Double_t s, Double_t b, Double_t alpha) 101 { 102 const Double_t sig = SignificanceLiMa(s, b, alpha); 103 if (sig<=0) 104 return 0; 105 106 return TMath::Sign(sig, s-b); 107 }
Note:
See TracChangeset
for help on using the changeset viewer.