Hello,
I am a sophomore student who just starts learning root. My question is: if I have two TTree objects, which are in two different files, how can I draw these two histograms based on the structure of the TTree objects and put them on the same canvass?
(I know I can use TFIle:: Open to open each one of the root files and then use T->Draw() method to plot two histograms on two separated canvass)
It would be best if you can explain this question in detail/or tell me any instruction I should read on User’s Manual(I am currently learning root through the User’s Guide.)
Thanks a lot!
Hi,
Thanks for all previous support. I know how to superimpose two histograms of two TTree objects on the same canvas now. Followed by that, I still have some questions in order to improve the appearance of the two histograms.
First, how can I set different colors to different histograms and add legends for both of them as a short description?
Second, if the peak, the highest frequency, of one histogram goes beyond the current scope of the Y-axis (for a 1D histogram the y-axis stands for the frequency of the x-axis variable) whereas the peak of the other one stays within, how can i adjust the range of the Y-axis so that I can view the actual peaks for both histograms on the canvas? (Or alternatively, is there a way that I can set a limit for the highest frequency for both?)
Finally, is there a way that I can apply some function to the x-axis variable and plot a corresponding histogram? For instance, can I plot the frequency distribution of the log(original x-axis variable)?
Also, it would be best if you guys can point out a link/reference for me to read. As the User’s Manual has a lot of ‘redundant’ information related to my current questions.