This MR implements the reading of augmented (DAOD) files with
TEvent as discussed during the following meeting (link 1 and link 2).
It supersedes the following (now closed) MR !63693 (closed)
Citing also the corresponding JIRA ticket: https://its.cern.ch/jira/browse/ATLASG-2539
During the meeting it was discussed that the alternative solution proposed by the ROOT team was a better solution so only the slides 11, 12, 15, 16 and 28 are relevant for the current MR.
To read the events that are common to two collection tree the user has to provide himself/herself the list of entries to be processed.
e.g. has done (here)
TEvent class is NOT taking care of finding/looping over those common events, it is up to the user to loop only over them.
The way the entries to be read in each tree are found is done through the call of the
TTree::LoadTree(entry) function in the
And then are retrieved thanks to the
(as proposed by the ROOT team here)
TTree::LoadTree(entry) is NOT reading anything it just sets the entry to be read.
So e.g. if
m_inTree->LoadTree(5) is called in the
- For all branches belonging to the main tree
- For all branches belonging to a friend tree, the entry to be read will be found and set by the call of
m_inTreebeing the main tree). The
TTree::LoadTreeis using the major and minor values of the event in the main tree and finds the corresponding entry in the friend tree with the same values.
In augmented DAOD files, the trees have an index that is built in order to be able to match common events accross trees i.e. with same major and minor values.
And so in that case
m_branch->GetTree()->GetReadEntry()will most likely be different from
5for those branches (see slide 28 of the presentation linked above)
So the entries to be read for each branch are retrieved in the branch manager classes with lines similar to:
::Long64_t entry = m_branch->GetTree()->GetReadEntry(); m_entry = entry ; m_branch->GetEntry( m_entry, getall );
In case a user request reading an event for which there is no corresponding entry in a friend tree then the entry returned by
::Long64_t entry = m_branch->GetTree()->GetReadEntry();
for branches of that friend tree
would be negative (equal to
-1) hence the protection against such cases in the code with an error raised if
entry < 0