Skip to content

[hist] Ndim: correctly set axes title from histo title#21493

Merged
dpiparo merged 1 commit intoroot-project:masterfrom
dpiparo:fix_21484
Mar 5, 2026
Merged

[hist] Ndim: correctly set axes title from histo title#21493
dpiparo merged 1 commit intoroot-project:masterfrom
dpiparo:fix_21484

Conversation

@dpiparo
Copy link
Member

@dpiparo dpiparo commented Mar 4, 2026

and preserve axis titles if any if the c'tor is invoked passing a vector of axes.

Fixes #21484

and preserve axis titles if any if the c'tor is invoked passing
a vector of axes.

Fixes root-project#21484

TString axisTitle;
Int_t dim = 0;
while(titleStr.Tokenize(axisTitle, from, ";")) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Non-important: a more modern alternative to Tokenize could be:
ROOT::Split (https://root.cern.ch/doc/master/StringUtils_8hxx_source.html)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. Since we were dealing with TStrings, I thought I would stick to the way the code was written at the time.
Ideally, what could be also useful, is a tokenizer that produces a collection of string_view pointing to the string being tokenized, to avoid all copies. In this and many other cases, there would be no measurable impact on the performance, but in principle that is the "right" thing to do maybe....

@github-actions
Copy link

github-actions bot commented Mar 4, 2026

Test Results

    22 files      22 suites   3d 7h 40m 2s ⏱️
 3 805 tests  3 804 ✅ 1 💤 0 ❌
75 684 runs  75 675 ✅ 9 💤 0 ❌

Results for commit e19141b.

@dpiparo dpiparo merged commit 1fab448 into root-project:master Mar 5, 2026
29 of 30 checks passed
@dpiparo dpiparo deleted the fix_21484 branch March 5, 2026 05:46
@dpiparo
Copy link
Member Author

dpiparo commented Mar 5, 2026

/backport to 6.36, 6.38

@root-project-bot
Copy link

Something went wrong with the backport to 6.36: @dpiparo please see the logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Last axis title is not set for THn and THnSparseD histograms, affects also HistoND and HistoNSparseD

3 participants