Superimposing multiple histograms on one canvas


I am a beginner, I am trying to make a macro that can read .root file and plot multiple histograms on one canvas. So far it only plots the first two histograms and crashes or goes blank when I add in another line of code to plot the third histogram.
Any help will be appreciated. :cry:

Check attachments for my macro.

Thank you,
firstHisto.C (587 Bytes)

Looking at your macro I do not see why it crashes.
Can you provide also the root file so I can try ?

I see only one weird thing: your .root file has a white space in its name … try to rename it.

Try to use “FindObjectAny” instead of “Get”.

Thanks for replying.

Wile E.Coyote I have switched it to" Get" to " FindObjectAny" and it now works. \:D/