Ignore:
Timestamp:
09/28/04 12:25:50 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mhflux/MHEffectiveOnTime.cc

    r5012 r5143  
    304304    // within the range (yq[0], yq[1]) there must be no empty bin;
    305305    // 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 };
    307307    Double_t yq[2];
    308308    h->GetQuantiles(2, yq, xq);
     
    321321    //func.SetParNames("lambda", "N0", "del");
    322322
    323     func.SetParameter(0, 100);       // Hz
     323    func.SetParameter(0, 200);       // Hz
    324324    func.SetParameter(1, Nm);
    325325    func.FixParameter(2, Nmdel/Nm);
     
    335335
    336336    // was fit successful ?
    337     const Bool_t ok = NDF>0 && chi2<2.5*NDF;
     337    const Bool_t ok = NDF>0 && chi2<3*NDF;
    338338
    339339    if (paint)
     
    343343        func.Paint("same");
    344344    }
    345 
    346     if (!ok)
    347         return kFALSE;
    348345
    349346    const Double_t lambda = func.GetParameter(0);
     
    385382    res[5] = NDF;
    386383
     384    // Chi2
     385    res[6] = chi2;
     386
    387387    // Rdead (from fit) is the fraction from real time lost by the dead time
    388388    //fHRdead.SetBinContent(i, Rdead);
    389389    //fHRdead.SetBinError  (i,dRdead);
    390390
    391     return kTRUE;
     391    return ok;
    392392}
    393393
     
    415415        h = fH2DeltaT.ProjectionX(name, i, i, "E");
    416416
    417         Double_t res[6];
     417        Double_t res[7];
    418418        if (!FitH(h, res))
    419419            continue;
     
    457457    // Fit histogram
    458458    //
    459     Double_t res[6];
     459    Double_t res[7];
    460460    if (!FitH(&fH1DeltaT, res))
    461461        return;
     
    551551
    552552    //
    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)
    556558        FitTimeBin();
    557559
     
    592594void MHEffectiveOnTime::PaintText(Double_t *res) const
    593595{
    594     TLatex text(0.25, 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]));
    596598    text.SetBit(TLatex::kTextNDC);
    597599    text.SetTextSize(0.04);
     
    613615        return;
    614616
    615     TLatex text(0.45, 0.94, Form("\\bar{p} = %.1f%%  (n=%d)", sum/n, n));
     617    TLatex text(0.47, 0.94, Form("\\bar{p} = %.1f%%", sum/n));
    616618    text.SetBit(TLatex::kTextNDC);
    617619    text.SetTextSize(0.04);
     
    692694        if ((h = (TH1D*)gPad->FindObject(fNameProjDeltaT)))
    693695        {
    694             Double_t res[6];
     696            Double_t res[7];
    695697            FitH(h, res, kTRUE);
    696698            PaintText(res);
Note: See TracChangeset for help on using the changeset viewer.