Uploaded image for project: 'ROOT'
  1. ROOT
  2. ROOT-5529

plotting RooRealSumPdf with RelativeExpected does not work first time

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • High
    • master, 6.26/00
    • 5.34/00
    • RooFit/RooStats
    • None
    • slc6

    Description

      I am finding that plotting RooRealSumPdf the first time, with the Normalization(1.,RooAbsReal::RelativeExpected) option does not normalize to the expected number of events the first time the pdf is drawn. Here's a not-so-minimal example:

        using namespace RooFit;
        TH1D* h = new TH1D("h","h",2,0,2);
        h->SetBinContent(1,2); h->SetBinContent(2,5);
        h->SetBinError(1,1.1); h->SetBinError(2,3.3);
        RooRealVar x("x","x",0,2);x.setBins(2);
       
        RooDataHist d("d","d",RooArgList(x),h);
        RooHistFunc nominals("f","f",x,d);
       
        RooRealVar binWidth("binWidth","binWidth",1);
        RooRealSumPdf m("m","m",RooArgList(nominals),RooArgList(binWidth),true);
       
        RooPlot* f = x.frame();
        m.plotOn(f,Normalization(1.0,RooAbsReal::RelativeExpected));
        m.plotOn(f,Normalization(1.0,RooAbsReal::RelativeExpected),LineColor(kRed));
        f->Draw();

      Attachments

        Activity

          People

            rembserj Jonas Rembser
            will Will Buttinger
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: