I am a TCanvas saved to a root file (see attachment). On the canvas, there are couples of TGraphErrors objects. I want to get those graphs using:
It returns a null pointer. I try to dump the graph info (see below). It looks a normal graph. I am curious why I cannot get the graph?
sum_spec.root (28.6 KB)
TFile *f = TFile::Open("sum_spec.root");
TCanvas *c; f->GetObject("sum_spec", c);
TMultiGraph *mg = ((TMultiGraph *)(c->FindObject("mg")));
TGraphErrors *g =
TCanvas *c_gTally14 = new TCanvas("c_gTally14", "c_gTally14");
I realized that the graphs are put together to a TMultiGraph and the MG is plotted on the canvas.