AnaAlgorithm Metadata Access, 21.2 branch (2019.04.01.)
After last week's feedback from @oabouzei, and the subsequent discussion in Friday's ASG meeting with @krumnack, I tried to make metadata access in EL::AnaAlgorithm
code a bit more convenient.
As a first thing, I added an interface very much like the one that we have in asg::AsgMetadataTool for accessing the "metadata stores". While doing this, I also replaces a bunch of ROOTCORE
macro checks with XAOD_STANDALONE
ones...
In the next step I added a new test in EventLoopTest
, to check whether the metadata access works.
The reason that I made this MR a WIP is that at this point metadata is still not available during the initialisation of the algorithm(s). Only in the beginInputFile()
function of the algorithm. I looked at the EventLoop code a bit to see how to change this exactly, but decided that it would be easier to get Nils's help with that.
Nils, I think what EventLoop should be doing is:
- Open the first input file (
TFile::Open
) before callinginitialize()
on any of the algorithms; - Let
TEventModule
callxAOD::TEvent::readFrom(...)
on this first input file, but not callxAOD::TEvent::getEntry(...)
yet; - Initialise all the algorithms;
- Call
xAOD::TEvent::getEntry(...)
just before starting the processing of the first event.
Of course this assumes that xAOD::TEvent
would allow access to the file's metadata after calling readFrom(...)
, but disallow access to the event data before also calling getEntry(...)
. Now... I think this is already the case. Though I may add a new unit test to xAODRootAccess
as part of this MR just to make sure.
But I'd need advice on how to best update the EventLoop code to achieve this behaviour. Some calls would need to be moved into EL::Worker::initialize()
as far as I can tell, but I didn't want to start with any bigger changes before discussing a bit first.