Changeset 5901 for trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
- Timestamp:
- 01/19/05 13:17:09 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MAlphaFitter.cc
r5776 r5901 65 65 fChiSqBg=0; 66 66 fIntegralMax=0; 67 fScaleFactor=1; 67 68 68 69 fCoefficients.Reset(); … … 210 211 } 211 212 212 Bool_t MAlphaFitter::Fit(TH1D &hon, TH1D &hof, Bool_t paint)213 Bool_t MAlphaFitter::Fit(TH1D &hon, TH1D &hof, Double_t alpha, Bool_t paint) 213 214 { 214 215 /* … … 224 225 fit.SetPolynomOrder(1); 225 226 226 if ( !fit.Fit(h, paint))227 if (alpha<=0 || !fit.Fit(h, paint)) 227 228 return kFALSE; 228 229 … … 237 238 fEventsSignal = hon.Integral(0, bin); 238 239 fEventsExcess = fEventsSignal-fEventsBackground; 239 fSignificance = MMath::SignificanceLiMaSigned(fEventsSignal, fEventsBackground); 240 fScaleFactor = alpha; 241 fSignificance = MMath::SignificanceLiMaSigned(fEventsSignal, fEventsBackground/alpha, alpha); 240 242 241 243 if (fEventsExcess<0) … … 399 401 h0->SetDirectory(0); 400 402 401 Scale(*h0, *h1); 402 403 const Bool_t rc = Fit(*h1, *h0, paint); 403 const Bool_t rc = ScaleAndFit(*h1, h0, paint); 404 404 405 405 delete h0; … … 419 419 h0->SetDirectory(0); 420 420 421 Scale(*h0, *h1); 422 423 const Bool_t rc = Fit(*h1, *h0, paint); 421 const Bool_t rc = ScaleAndFit(*h1, h0, paint); 424 422 425 423 delete h0; … … 439 437 h0->SetDirectory(0); 440 438 441 Scale(*h0, *h1); 442 443 const Bool_t rc = Fit(*h1, *h0, paint); 439 const Bool_t rc = ScaleAndFit(*h1, h0, paint); 444 440 445 441 delete h0; … … 449 445 } 450 446 451 voidMAlphaFitter::Scale(TH1D &of, const TH1D &on) const447 Double_t MAlphaFitter::Scale(TH1D &of, const TH1D &on) const 452 448 { 453 449 Float_t scaleon = 1; … … 456 452 { 457 453 case kNone: 458 return ;454 return 1; 459 455 460 456 case kEntries: … … 481 477 break; 482 478 479 // This is just to make some compiler happy 483 480 default: 484 return ;481 return 1; 485 482 } 486 483 487 484 if (scaleof!=0) 485 { 488 486 of.Scale(scaleon/scaleof); 487 return scaleon/scaleof; 488 } 489 489 else 490 { 490 491 of.Reset(); 491 } 492 return 0; 493 } 494 }
Note:
See TracChangeset
for help on using the changeset viewer.