Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RF] Several improvements in RooFit chi-square fitting #13651

Merged
merged 4 commits into from
Sep 18, 2023

Commits on Sep 17, 2023

  1. [RF] Remove multi-range chi-square fit logic from RooAbsPdf

    Almost a year ago, I fixed the support for comma-separated normalization
    ranges for pdfs, e.g. `pdf.setNormRange("range1,range2")` was fixed also
    for RooAddPdfs.
    
    As a result, the logic for multi-range likelihood fits was removed from
    `createNLL()`, because the multi-range fit didn't have to be treated as
    a special case anymore.
    
    The same applies also to chi-square fits. In fact, the reason why the
    `RooChi2Var` constructor and `RooAbsReal::createChi2()` methods had a
    `RooAbsPdf` overload was *only* this workaround! For regular
    RooAbsReals, the workaround was not necessary, because there is no
    normalization.
    
    Therefore, quite a few functions were removed in this commit.
    
    The multi-range chi2 fit is now also validated by the multi-range fit
    unit test in `testRooAbsPdf`.
    
    This is a follow-up to PR root-project#11455 (commit fa10523 in particular),
    where the same change was already make for regular likelihoods.
    guitargeek committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    9f7f1bd View commit details
    Browse the repository at this point in the history
  2. [RF] Avoid separate RooXYChi2Var constructors for pdfs and functions

    It can be checked at runtime if a given `RooAbsReal` is a pdf or not.
    Like this, we also don't need a separate override of
    `createChi2(RooDataSet &)` in RooAbsPdf.
    guitargeek committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    8fa8cc0 View commit details
    Browse the repository at this point in the history
  3. [RF] Support NumCPU() and Range() in createChi2() for RooDataSets

    This is achieved in the same was as in `createNLL()`, by forwarding the
    configuration options to the `RooAbsOptTestStatistic` base class.
    guitargeek committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    7b7b05b View commit details
    Browse the repository at this point in the history
  4. [RF] Bugfix in RooDataSet::reduce() by also copying the stored errors

    After adding support for subrange fits with the `RooXYChi2Var`, it
    initially didn't work because the y-value errors were missing in the
    dataset. This is because `RooDataSet::reduce()` is not copying the
    errors over to the reduced dataset, which is a bug.
    
    Fortunately, there is a straighforward solution. To create the reduced
    `RooDataSet`, it now doesn't use some buggy private constructor (that is
    now removed), but instead the trusty `RooAbsData::emptyClone()` method,
    for which I fixed the problem with the errors not being copied already
    some time ago.
    guitargeek committed Sep 17, 2023
    Configuration menu
    Copy the full SHA
    dc693dc View commit details
    Browse the repository at this point in the history