Hello Rooters,
I am trying to read a bunch of TGraphs into an array of TGraphs. It works and I can work with individual graphs, but when I try to do this in a loop, I get and error. See below for the code snippet and comments. Any ideas?
Cheers,
{
TGraph *g[5];
TFile *f6=new TFile("input_file.root", "READ");
for(int a=0; a<5;a++){
g[a]=(TGraph*)f6->Get(Form("Graph;%d",a));
}
cout<<g[2]->GetN()<<endl;//<- this works
for(int a=0; a<5;a++){
cout<<g[a]->GetN()<<endl; ///<- this gives error
}
}