I want to do following:
- select from a single Tree,which has various branches, several events (e.g.: eventnr 1 and 23 and 51).
Then I would like to merge those e.g. 3 events into a single one and store it in a new tree (which I have already created with auto newtree = oldtree->Clone(0)).
- repeat step 1) multiple times (with of course different events)
Old Tree: New Tree:
Selected Eventnumbers: Created Eventnumbers:
Is there a method in ROOT how I could do this?
Thanks in advance!
welcome back on the forum.
You can select certain events from the TTree and copy them into a new TTree object, but if you copy N events you will receive N events in the new tree. For very easy filtering and saving new objects with only selected events you could try using RDataFrame, see: ROOT: ROOT::RDataFrame Class Reference
I’m a bit confused why would you like to merge a few events into a single event? Usually the events represent collisions, so each event is an individual instance.
thanks a lot for the clear answer!
I am aware that my problem of merging events is exotic. Maybe I have to think about other ways to tackle it.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.