Hi,
I am maintaining an application which is selecting entries (via a tcut) from multiple root files (from a given ttree in all of them), and writing the selected entries in an output root file. I have not seen this exact use case in tutorials/examples, did I miss it ? Whatsoever, it is probably a very common task and I should have expert help here
The way we implement now is basically :
- we load the shared libraries which defines the classes
of the objects stored in the input trees. - we build a TChain with all input data files
- we use chain->Draw(ā¦, cut) so to generate a TEventList
- we ask an empty TTree clone from the chain
- we get from the TChain and fill the TTree with the
element of the TEventList
A key step is 1), which turns to be complicated since we now have multiple root files, generated with multiple code releases. It becomes more and more difficult to trace back which root file requires which shared library.
Could we avoid loading the objects definition shared libraries ? All
the necessary information is not somewhere in the files streaminfos ?
A tool such as hadd apparently does not need to be said which kind
of objects is stored in the trees. The main difference in our use case
is that we want to tcut the events at the same time we merge
the file/trees. Does it make the step 1) absolutely necessary ?