2 tree classes in one job


I have my analysis code that inherits from the event tree class generated with MakeSelector. Now I have a second tree in the same file with different number of entries but with some configuration info that I need to read (i.e. fill a std::map in the SlaveBegin) before executing the event loop on the event tree. Since the number of entries between both trees is different AddFriend did not work. Ideally, I would like to use the methods generated by MakeSelector, e.g. Process(Long64_t entry). Is there an example somewhere for this use case? I wasn’t able to find anything.



You need to read and process the second tree when a new file is open.
ROOT/PROOF call the Init method of the steering selector (in this case the one corresponding to the first TTree) when a new file is open, passing as argument a pointer to the TTree object (tree). The TFile object of the open file is available via


With this you can read any other object in the file and do what you need to do.

Gerri Ganis