I have a simple question. I have root files containing histograms. I want to get the pointer to the objects (histograms) in root files. For one root file I can do
Thanks Rene. Simply, I want to add root files in chain and plot the histograms. There is no loop over the number of entries. There is no tree.
With chain->GetEntries(), I got following error:
Error in TChain::LoadTree: Cannot find tree with name in file test1.root
Error in TChain::LoadTree: Cannot find tree with name in file test2.root
With TH2 h2 = (TH2)chain.GetCurrentFile()->Get(“h2”), I got following error:
Error: illegal pointer to class object GetCurrentFile() 0x0 77 plot.C:16:
please help me
I have three files (1.root, 2.root ,3.root ) and I want to draw them in one drawing I followed the method
But did not good work
TChain *chain = new TChain();
chain->AddFile(“test1.root”);
chain->AddFile(“test2.root”);
How to use this method --> hadd -f result.root file1.root file2.root … fileN.root