forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 3
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
TChain tests successful #5
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
eaa7198
Working reading of collectionless STL branches from TChains
strykejern aaf547f
Tweaking tests for leaves
strykejern 85ad7a1
Changing how leaves are read in both Array and Value reader.
strykejern 5740f33
Refactoring in tests
strykejern 3d102b7
All tests now successful most of the time
strykejern 087fd2a
Code cleanup of unused variables
strykejern 582d1a8
Possibly fixes the undeterministic behaviour
strykejern 8a51f08
Change member to non-pointer for automatic garbage collection
strykejern fdce3df
Change member to non-pointer to avoid memory leak
strykejern cebf3b2
Removed unnecessary initializer for TString
strykejern 0b6c167
Added comment lines for the documentation generation
strykejern File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,8 +52,8 @@ ROOT::TTreeReaderValueBase::TTreeReaderValueBase(TTreeReader* reader /*= 0*/, | |
fProxy(0), | ||
fSetupStatus(kSetupNotSetup), | ||
fReadStatus(kReadNothingYet), | ||
fLeafOffset(-1), | ||
fLeaf(NULL) | ||
fLeaf(NULL), | ||
fTreeLastOffset(-1) | ||
{ | ||
// Construct a tree value reader and register it with the reader object. | ||
if (fTreeReader) fTreeReader->RegisterValueReader(this); | ||
|
@@ -78,6 +78,40 @@ ROOT::TTreeReaderValueBase::ProxyRead() { | |
return fReadStatus; | ||
} | ||
|
||
//______________________________________________________________________________ | ||
TLeaf* ROOT::TTreeReaderValueBase::GetLeaf() { | ||
if (fLeafName.Length() > 0){ | ||
|
||
Long64_t newChainOffset = fTreeReader->GetTree()->GetChainOffset(); | ||
|
||
if (newChainOffset != fTreeLastOffset){ | ||
fTreeLastOffset = newChainOffset; | ||
fLeaf = fTreeReader->GetTree()->GetBranch(fBranchName)->GetLeaf(fLeafName); | ||
} | ||
return fLeaf; | ||
} | ||
else { | ||
Error("GetLeaf()", "We are not reading a leaf"); | ||
return 0; | ||
} | ||
} | ||
|
||
//______________________________________________________________________________ | ||
void* ROOT::TTreeReaderValueBase::GetAddress() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you add //______________________________________________________________________________ in front? |
||
if (ProxyRead() != kReadSuccess) return 0; | ||
|
||
if (fLeafName.Length() > 0){ | ||
Long64_t newChainOffset = fTreeReader->GetTree()->GetChainOffset(); | ||
|
||
if (newChainOffset != fTreeLastOffset){ | ||
fTreeLastOffset = newChainOffset; | ||
fLeaf = fTreeReader->GetTree()->GetBranch(fBranchName)->GetLeaf(fLeafName); | ||
} | ||
return fLeaf->GetValuePointer(); | ||
} | ||
return fProxy ? (Byte_t*)fProxy->GetWhere() : 0; | ||
} | ||
|
||
//______________________________________________________________________________ | ||
void ROOT::TTreeReaderValueBase::CreateProxy() { | ||
// Create the proxy object for our branch. | ||
|
@@ -137,6 +171,8 @@ void ROOT::TTreeReaderValueBase::CreateProxy() { | |
//fLeafOffset = myLeaf->GetOffset() / 4; | ||
branchActualType = fDict; | ||
fLeaf = myLeaf; | ||
fBranchName = branchName; | ||
fLeafName = leafName(1, leafName.Length()); | ||
} | ||
else { | ||
Error("CreateProxy()", "Leaf of type %s cannot be read by TTreeReaderValue<%s>.", myLeaf->GetTypeName(), fDict->GetName()); | ||
|
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add //______________________________________________________________________________ in front?