[treereader] Try harder when looking for a leaf#7889
Merged
eguiraud merged 4 commits intoroot-project:masterfrom Apr 17, 2021
Merged
[treereader] Try harder when looking for a leaf#7889eguiraud merged 4 commits intoroot-project:masterfrom
eguiraud merged 4 commits intoroot-project:masterfrom
Conversation
|
Starting build on |
Closed
1 task
Before this patch, given a TTree with a branch with name different from its leaf, e.g. like this: ``` *Br 0 :NUD_total_ADC : nud_total_adc/D ``` TTreeReaderValue failed to retrieve the leaf when the named passed to the constructor was just "NUD_total_ADC" (while it worked fine with "NUD_total_ADC.nud_total_adc"). In comparison, in a similar situation `TTree::Draw` "tries harder" and it assumes that the desired leaf is the first sub-leaf of the specified branch. With this patch, TTreeReaderValue tries `FindLeaf` after `GetLeaf` and as a last resort it picks the branch sub-leaf if it exists and it is unique. This fixes root-project#6881.
26b6324 to
45c27e1
Compare
|
Starting build on |
Contributor
Author
|
Now with a test 😄 |
pcanal
reviewed
Apr 15, 2021
pcanal
approved these changes
Apr 15, 2021
|
Starting build on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this patch, given a TTree with a branch with name different
from its leaf, e.g. like this:
TTreeReaderValue failed to retrieve the leaf when the named passed
to the constructor was just "NUD_total_ADC" (while it worked fine
with "NUD_total_ADC.nud_total_adc"). In comparison, in a similar
situation
TTree::Draw"tries harder" and it assumes that thedesired leaf is the first sub-leaf of the specified branch.
With this patch, TTreeReaderValue tries
FindLeafafterGetLeafand as a last resort it picks the branch sub-leaf if it exists and
it is unique.
This fixes #6881.