Splitting one root file in two

Hello,

I would like to split one root file into two others files of the same size using the command line rooteventselector. Could someone give me an example of how to do it?

Many thanks,
Lais

rooteventselector -h

Gives many examples.

Thank you very much. Sorry for my ignorance, but I could not find an example for splitting one root file into two or n files of the same size. So I guessed it would be something simple like rooteventselector source.root:tree dest1.root dest2.root … but I am missing something. Is it possible to give me an example of how it should be?

Thank you!

One of the suggested examples are:

 rooteventselector -f 101 source.root:tree dest.root

Copy a subset of the tree ‘tree’ from ‘source.root’ to ‘dest.root’. The new tree contains events from the old tree except the first hundred.

rooteventselector -l 100 source.root:tree dest.root

Copy a subset of the tree ‘tree’ from ‘source.root’ to ‘dest.root’. The new tree contains the first hundred events from the old tree.

So if you know the number of events n in your tree, and if n2=n/2, you can do:

 rooteventselector -l n2 source.root:tree dest.root1
 rooteventselector -f n2+1 source.root:tree dest.root2

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.