Changeset 5143 for trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc
- Timestamp:
- 09/28/04 12:25:50 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc
r5012 r5143 304 304 // within the range (yq[0], yq[1]) there must be no empty bin; 305 305 // choose pedestrian approach as long as GetQuantiles is not available 306 Double_t xq[2] = { 0. 05, 0.95};306 Double_t xq[2] = { 0.6, 0.99 }; 307 307 Double_t yq[2]; 308 308 h->GetQuantiles(2, yq, xq); … … 321 321 //func.SetParNames("lambda", "N0", "del"); 322 322 323 func.SetParameter(0, 100); // Hz323 func.SetParameter(0, 200); // Hz 324 324 func.SetParameter(1, Nm); 325 325 func.FixParameter(2, Nmdel/Nm); … … 335 335 336 336 // was fit successful ? 337 const Bool_t ok = NDF>0 && chi2< 2.5*NDF;337 const Bool_t ok = NDF>0 && chi2<3*NDF; 338 338 339 339 if (paint) … … 343 343 func.Paint("same"); 344 344 } 345 346 if (!ok)347 return kFALSE;348 345 349 346 const Double_t lambda = func.GetParameter(0); … … 385 382 res[5] = NDF; 386 383 384 // Chi2 385 res[6] = chi2; 386 387 387 // Rdead (from fit) is the fraction from real time lost by the dead time 388 388 //fHRdead.SetBinContent(i, Rdead); 389 389 //fHRdead.SetBinError (i,dRdead); 390 390 391 return kTRUE;391 return ok; 392 392 } 393 393 … … 415 415 h = fH2DeltaT.ProjectionX(name, i, i, "E"); 416 416 417 Double_t res[ 6];417 Double_t res[7]; 418 418 if (!FitH(h, res)) 419 419 continue; … … 457 457 // Fit histogram 458 458 // 459 Double_t res[ 6];459 Double_t res[7]; 460 460 if (!FitH(&fH1DeltaT, res)) 461 461 return; … … 551 551 552 552 // 553 // If we reached the event number limit for the time-bins fit the histogram 554 // 555 if (fH1DeltaT.GetEntries()>=fNumEvents) 553 // If we reached the event number limit for the time-bins fit the 554 // histogram - if it fails try again when 1.6% more events available 555 // 556 const Int_t n = (Int_t)fH1DeltaT.GetEntries(); 557 if (n>=fNumEvents && n%(fNumEvents/60)==0) 556 558 FitTimeBin(); 557 559 … … 592 594 void MHEffectiveOnTime::PaintText(Double_t *res) const 593 595 { 594 TLatex text(0.2 5, 0.94, Form("T_{eff}=%.1fs\\pm%.1fs \\labda=%.1f\\pm%.1f p=%.1f%% NDF=%d",595 res[0], res[1], res[3], res[4], res[2], res[5]));596 TLatex text(0.27, 0.94, Form("T_{eff}=%.1fs\\pm%.1fs \\lambda=%.1f\\pm%.1fHz p=%.1f%% \\chi^{2}/%d=%.1f", 597 res[0], res[1], res[3], res[4], res[2], (int)res[5], res[6]/res[5])); 596 598 text.SetBit(TLatex::kTextNDC); 597 599 text.SetTextSize(0.04); … … 613 615 return; 614 616 615 TLatex text(0.4 5, 0.94, Form("\\bar{p} = %.1f%% (n=%d)", sum/n,n));617 TLatex text(0.47, 0.94, Form("\\bar{p} = %.1f%%", sum/n)); 616 618 text.SetBit(TLatex::kTextNDC); 617 619 text.SetTextSize(0.04); … … 692 694 if ((h = (TH1D*)gPad->FindObject(fNameProjDeltaT))) 693 695 { 694 Double_t res[ 6];696 Double_t res[7]; 695 697 FitH(h, res, kTRUE); 696 698 PaintText(res);
Note:
See TracChangeset
for help on using the changeset viewer.