I have two different root files - each of which contains a tree that has multiple branches. I want to compare the same branches from different root files by drawing them on the same canvas.
Any help with writing a macros to do the same would be much appreciated!
you don’t draw branches but rather some entity which “reduces” the data it carries, e.g. an histogram.
I think the best way is to draw the two histograms and draw them on the same canvas via the “SAME” draw option.
How are you drawing the content of your trees?
Hi Danilo,
Thanks for the reply!
I managed to make the superimposed histograms. In order to compare I normalized each of the distribution to the number of events.
for eg:
h1->GetEntries()
h1->Scale(1/1.56168e+06)
h1->Draw()
But this gives a histograms that has broken lines.
“HIST”: https://root.cern/doc/master/classTHistPainter.html
’’‘
When an histogram has errors it is visualized by default with error bars. To visualize it without errors use the option “HIST” together with the required option (eg “hist same c”). The “HIST” option can also be used to plot only the histogram and not the associated function(s).
’’'
I hope that helps!