Changeset 3577
- Timestamp:
- 03/22/04 16:56:21 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHFalseSource.cc
r3574 r3577 257 257 // 258 258 // calculates the significance according to Li & Ma 259 // ApJ 272 (1983) 317 260 // 261 // s: total number of events in signal region 262 // 263 // Double_t fGamma; // Nbg = Non - gamma * Noff 264 // - the effective number of background events (fNoff), and fGamma : 265 // 266 // fGamma = b / fNoff; 267 // fGamma = fdNbg / sqrt(fNoff); 268 // fGamma = fdNbg*fdNbg / fNbg; 269 // fNoff = b*b / (fdNbg*fdNbg); 270 // Double_t fNbg; // number of background events in signal region 271 // b = fNOff *fGamma; 272 /* 273 Double_t MHFindSignificance::SignificanceLiMa(Double_t non, Double_t noff, Double_t gamma) 274 { 275 if (gamma <= 0.0 || non <= 0.0 || noff <= 0.0) 276 { 277 *siglima = 0.0; 278 return kFALSE; 279 } 280 281 Double_t help1 = TMath::Log( (gamma+1)*s / (gamma*(s+noff)) ); 282 Double_t help2 = TMath::Log( (gamma+1)*noff / ( s+noff ) ); 283 284 Double_t siglima = TMath::Sqrt((s*help1+noff*help2)*2); 285 286 return non<gamma*noff ? -siglima : siglima; 287 } 288 */ 259 // ApJ 272 (1983) 317, Formula 17 260 // 261 Double_t MHFalseSource::SignificanceLiMa(Double_t s, Double_t b, Double_t alpha) 262 { 263 if (s+b<=0) 264 return 0; 265 266 const Double_t k = s/(s+b); 267 268 const Double_t a = s*TMath::Log(k*(alpha+1)/alpha); 269 const Double_t b = b*TMath::Log(k*(alpha+1) ); 270 271 return TMath::Sqrt((a+b)*2); 272 } 273 289 274 // -------------------------------------------------------------------------- 290 275 //
Note:
See TracChangeset
for help on using the changeset viewer.