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

THRatio: fix again division of histograms with different labels #2428

Merged

Conversation

aferrero2707
Copy link
Contributor

The ROOT Divide() function requires that bin labels, if present, are the same in the numerator and the denominator, otherwise it prints a warning message.

The changes in this commit fix the copy of bin labels from numerator to denominator in the THxRatio update() functions, that was broken by recent updates.

This should mute the frequent warning messages for the QC merger nodes, similar to those below:

Info in <o2::quality_control_modules::common::TH1Ratio<TH1F>::Divide>: Histograms have different labels task="alio2-cr1-hv-gw01.cern.ch:/opt/git/ControlWorkflows/tasks/jit-dab50f7f440359627025f1426c693f34bed54029-ITS-MERGER-ITSDECODING1l-0@4ca2b184b590c6547212a91c5f30499310ba0cd3#2pxoSbRF2EY"
Info in <o2::quality_control_modules::common::TH2Ratio<TH2F>::Divide>: Histograms have different labels task="alio2-cr1-hv-gw01.cern.ch:/opt/git/ControlWorkflows/tasks/jit-69a39e02ed4aa6dafaebcbe990508b140b68d691-MCH-MERGER-Decoding1l-0_t0@4ca2b184b590c6547212a91c5f30499310ba0cd3#2pxoSsbhBcp"

@aferrero2707
Copy link
Contributor Author

@knopers8 @Barthelemy we had again complaints from ROOT about different bin labels in the THxRatio plots, this PR should fix it.

The ROOT `Divide()` function requires that bin labels, if present, are the
same in the numerator and the denominator, otherwise it prints a warning
message.

The changes in this commit fix the copy of bin labels from numerator to
denominator in the THxRatio `update()` functions.
@aferrero2707 aferrero2707 force-pushed the common-fix-thratio-with-labels branch from d0a0256 to 050f576 Compare September 22, 2024 15:10
@knopers8
Copy link
Collaborator

Thank you @aferrero2707 ! Just to understand, do you know why these labels become missing or mismatching in the first place?

@aferrero2707
Copy link
Contributor Author

@knopers8 I think that my previous code was simply wrong. When labels were set on the THRatio object (like here), they were copied from the THRatio to the denominator (see here) but not to the numerator, and this was triggering the ROOT warning.

The new code in this PR propagates the labels to all the plots. In addition to avoiding the ROOT warning message, it also correctly handles the case were bin labels are set in the numerator plot instead of the THRatio itself.

@knopers8 knopers8 merged commit ea62b68 into AliceO2Group:master Sep 24, 2024
7 checks passed
@knopers8
Copy link
Collaborator

thanks for the explanation!

@aferrero2707 aferrero2707 deleted the common-fix-thratio-with-labels branch September 26, 2024 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants