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 update of histograms with bin labels #2449

Conversation

aferrero2707
Copy link
Contributor

@aferrero2707 aferrero2707 commented Oct 4, 2024

A direct copy of the axis objects from the numerator to the ratio histograms, that was introduced in a recent commit, breaks the preservation of the bin labels that are eventually set in the ratio histogram.

The code in this commit replaces the copy with an explicit update of the number and limits of the bins, such that it works also if the numerator is filled with TH1::kCanRebin or TH1::SetCanExtend() set, and therefore the axis range can change after the histogram creation.

A direct copy of the axis objects from the numerator to the ratio histograms,
that was introduced in a recent commit, breaks the preservation of the
bin labels that are eventually set in the ratio histogram.

The code in this commit replaces the copy with an explicit update of the
number and limits of the bins, such that it works also if the numerator
is filled with `TH1::kCanRebin` set, and therefore the axis range can
change after the histogram creation.
@aferrero2707
Copy link
Contributor Author

@Barthelemy @knopers8 @justonedev1 this PR will be followed by another one with additional unit tests that will catch this kind of regressions, and hopefully much more.

@Barthelemy Barthelemy merged commit c495d62 into AliceO2Group:master Oct 7, 2024
7 checks passed
@aferrero2707 aferrero2707 deleted the common-fix-again-thratio-with-labels branch October 11, 2024 14:20
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