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

Conversation

guitargeek
Copy link
Contributor

@guitargeek guitargeek commented Feb 23, 2024

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():

  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.

This PR was made in response to cms-sw/cmsdist#9025 (comment).

@cmsbuild
Copy link
Contributor

cmsbuild commented Feb 23, 2024

cms-bot internal usage

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-44064/39013

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @guitargeek for master.

It involves the following packages:

  • DQMOffline/EGamma (dqm)

@antoniovagnerini, @cmsbuild, @tjavaid, @nothingface0, @syuvivida, @rvenditti can you please review it and eventually sign? Thanks.
@rovere, @rociovilar this is something you requested to watch as well.
@rappoccio, @sextonkennedy, @antoniovilela you are the release manager for this.

cms-bot commands are listed here

@iarspider
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-124470/37633/summary.html
COMMIT: e92ae9e
CMSSW: CMSSW_14_1_X_2024-02-22-2300/el8_amd64_gcc12
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/44064/37633/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • You potentially added 29 lines to the logs
  • Reco comparison results: 48 differences found in the comparisons
  • DQMHistoTests: Total files compared: 48
  • DQMHistoTests: Total histograms compared: 3245365
  • DQMHistoTests: Total failures: 3
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3245340
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 47 files compared)
  • Checked 200 log files, 161 edm output root files, 48 DQM output files
  • TriggerResults: no differences found

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`.
@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-44064/39026

  • This PR adds an extra 12KB to repository

@cmsbuild
Copy link
Contributor

Pull request #44064 was updated. @rvenditti, @antoniovagnerini, @cmsbuild, @tjavaid, @nothingface0, @syuvivida can you please check and sign again.

@guitargeek
Copy link
Contributor Author

Closing the PR in favor of a fix in ROOT:
root-project/root#14817

@guitargeek guitargeek closed this Feb 25, 2024
@guitargeek guitargeek deleted the PhotonDataCertification branch February 27, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants