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

Avoid fitting empy histograms in PhotonDataCertification #44064

Closed
wants to merge 1 commit into from
Closed

Avoid fitting empy histograms in PhotonDataCertification #44064

wants to merge 1 commit into from

Commits on Feb 24, 2024

  1. Avoid fitting empy histograms in PhotonDataCertification

    In ROOT master, RooFit doesn't want to fit empty histograms anymore.
    
    I have to think about a little bit about how I want to deal with this in
    ROOT master, because such fits are often user logic errors. Also, in the
    case of the `PhotonDataCertification::invMassZtest()`:
    
    ```c++
      RooMsgService::instance().setGlobalKillBelow(RooFit::WARNING);
      ...
      BreitWigner.fitTo(test, RooFit::Range(80, 100), RooFit::PrintLevel(-1000));
    
      if (std::abs(mRes.getValV() - ZMass) < ZWidth) {
        return 1.0;
      } else if (std::abs(mRes.getValV() - ZMass) < gamma.getValV()) {
        return 0.9;
      } else {
        return 0.0;
      }
    ```
    
    So far, RooFit just silently didn't do any fit if the `test` data was
    empty. This results in the `mRes` value not being changed from the
    default nominal `ZMass`, and then the function returns a summary value
    of `1.0`, indicating that the peak was within the Z width. Does that
    really make sense for an empty histogram?
    
    That is maybe something to think about for the DQM experts. For now,
    this commit simply keeps the old behavior, it just makes the
    `if (sumEntries() > 0.)` check explicit. Like this, it will continue
    working with ROOT `master`.
    guitargeek committed Feb 24, 2024
    Configuration menu
    Copy the full SHA
    a4267ca View commit details
    Browse the repository at this point in the history