Since we now have TTree friends, we could abuse of this technology and make TTree friends in getters without any new branch. This would still give access to the original trees interactively when opening the file and allow to use the exact same tools...
Interesting idea, this also means we could run getDimuonSpectrum on the unfolded output with guaranteed consistency. The "empty" trees would still need to be Fill()ed once for every event.
There is one potential drawback, which is running on a folder that has both the actual trees and the output of some get command. We'd then get duplicated events without warning, while I think it simply crashes currently.
Interesting idea, this also means we could run getDimuonSpectrum on the unfolded output with guaranteed consistency. The "empty" trees would still need to be Fill()ed once for every event.
Right. To avoid confusion, can we rather put the tOut->Fill() statement in the Looper, so that we would rather "remove" it (visually speaking) from the other commands? Fill()ing the tree in an apply* command is obvious. I'm not sure that continue statements would prevent from filling the tree, though, thus skimmers will keep the total number of events (proposed solution: just empty all collections).
Ok, this possibly solves the cases of "primary" getters (the ones that run on a n-tuple), but there are also "secondary" or "indirect" getters (the ones that run on the output of a primary getter), where there is no event loop. There are two cases to consider:
A sequence such as getJetResponse, fitJetResponse, fitJetResolution. In this case, it would be good to clone the tree, but I'm not sure to see how to proceed. Perhaps it is as simple as calling TTree::CloneTree() with the total number of entries after deactivating all branches, but this is so far pure speculation.
Two sequences joining, such as getUnfHist (for both real and simulated samples), followed by unfold and getUnfPhysDist. I think that the solution from the first case should work too, but certain print* commands will only see the first of the trees.
There is one potential drawback, which is running on a folder that has both the actual trees and the output of some get command. We'd then get duplicated events without warning, while I think it simply crashes currently.
Flow looks for a TTree named events. I would simply propose to rename the tree.