What is the most efficient way to compare the content of two entries in a TTree?

just for fun (and because it’s Friday and we are allowed to procrastinate!), I threw together this little tool:

$> root-dump -h
Usage: root-dump [options] f0.root [f1.root [...]]

ex:
 $> root-dump ./testdata/small-flat-tree.root
 $> root-dump -deep=0 ./testdata/small-flat-tree.root

options:
  -deep
    	enable deep dumping of values (including Trees' entries) (default true)

i.e.:

$> root-dump ../testdata/simple.root ../testdata/small-flat-tree.root
>>> file[../testdata/simple.root]
key[000]: tree;1 "fake data" (TTree)
[000][one]: 1
[000][two]: 1.1
[000][three]: uno
[001][one]: 2
[001][two]: 2.2
[001][three]: dos
[002][one]: 3
[002][two]: 3.3
[002][three]: tres
[003][one]: 4
[003][two]: 4.4
[003][three]: quatro
>>> file[../testdata/small-flat-tree.root]
key[000]: tree;1 "my tree title" (TTree)
[000][Int32]: 0
[000][Int64]: 0
[000][UInt32]: 0
[000][UInt64]: 0
[000][Float32]: 0
[000][Float64]: 0
[000][Str]: evt-000
[000][ArrayInt32]: [0 0 0 0 0 0 0 0 0 0]
[000][ArrayInt64]: [0 0 0 0 0 0 0 0 0 0]
[000][ArrayInt32]: [0 0 0 0 0 0 0 0 0 0]
[000][ArrayInt64]: [0 0 0 0 0 0 0 0 0 0]
[000][ArrayFloat32]: [0 0 0 0 0 0 0 0 0 0]
[000][ArrayFloat64]: [0 0 0 0 0 0 0 0 0 0]
[000][N]: 0
[000][SliceInt32]: []
[000][SliceInt64]: []
[000][SliceInt32]: []
[000][SliceInt64]: []
[000][SliceFloat32]: []
[000][SliceFloat64]: []
[001][Int32]: 1
[001][Int64]: 1
[001][UInt32]: 1
[001][UInt64]: 1
[001][Float32]: 1
[001][Float64]: 1
[001][Str]: evt-001
[001][ArrayInt32]: [1 1 1 1 1 1 1 1 1 1]
[001][ArrayInt64]: [1 1 1 1 1 1 1 1 1 1]
[001][ArrayInt32]: [1 1 1 1 1 1 1 1 1 1]
[001][ArrayInt64]: [1 1 1 1 1 1 1 1 1 1]
[001][ArrayFloat32]: [1 1 1 1 1 1 1 1 1 1]
[001][ArrayFloat64]: [1 1 1 1 1 1 1 1 1 1]
[001][N]: 1
[001][SliceInt32]: [1]
[001][SliceInt64]: [1]
[...]

it’s (of course!) based on my Go-based ROOT reader: rootio.
you can install it like so:

$> go get go-hep.org/x/hep/rootio/cmd/root-dump

it doesn’t dump (yet) Trees with user-defined classes.
but it’s just a matter of coding and wiring the tools from go-hep.org/x/hep/rootio:slight_smile: (famous last words)

hth,
-s