Home | News | Documentation | Download

Method to plot many TGraphs from different .root files

Hello rooters,

I have many .root files with TGraph objects saved in them. What I need is a method to get some of those TGraph into a unique TCanvas. In other words, I need to compare different TGraphs stored in different .root files.

When I do “root [1] f.ls()” (in an interactive session) i get:
TFile** signal_proc_cosThetaStar_TF1.root
TFile* signal_proc_cosThetaStar_TF1.root
KEY: TGraph bin_content_par1_1;2
KEY: TGraph bin_content_par1_1;1
KEY: TGraph bin_content_par1_2;2
KEY: TGraph bin_content_par1_2;1
KEY: TGraph bin_content_par1_3;2
KEY: TGraph bin_content_par1_3;1
KEY: TGraph bin_content_par1_4;2
KEY: TGraph bin_content_par1_4;1
KEY: TGraph bin_content_par1_5;2
KEY: TGraph bin_content_par1_5;1

with bin_content_par1_X the TGraph object that i need. I am very new at this.
Thank you very much and happy rooting.

1 Like

Thank you !