Hi rooters,
I am trying to update a TMultiGraph from a root file and I am getting bus errors and I suspect this is an issue regarding ownership. The source of the error is similar to the following snippet:
TFile file("graphs.root","UPDATE");
TMultiGraph *multi_gr[n];
for(int i =0; i<n;i++){
char *graph_names; // note the graph names are i dependent
...
multi_gr[i] = (TMultiGraph*)(file.Get(graph_names)));
multi_gr[i]->Add((TGraph*)(model_gr->Clone()));
multi_gr[i]->Write("graph_names", TObject::kOverwrite);
}
From what I can tell there is no problem with “model_gr” which I add to “multi_gr” however when I “Get” graphs from “graphs.root” and over write them I am getting bus errors. I thought the issue was that Get has not create a copy of the original TMultiGraph stored in the root file, but even trying to clone the multigraph and writing after filling “multi_gr[i]” I still get the same errors.
any help would be much appreciated
cheers
Mark