Hi everybody,
I have a problem with saving my data to a root file. I am creating a several canvas in a loop all consisting of three Histogramms, which I all save to a .root file. When I am naming the canvas all the same (e.g. “TCanvas *c = new TCanvas(“Canvas”,“Canvas”,800,1400);”), everything works fine, and the Canvas get labelled as Canvas;1 Canvas ;2 etc. No I tried to change the name doing the following:
const char* Canvasname = std::to_string(Energy).c_str();
TCanvas *c = new TCanvas(Canvasname,“Canvas”,800,1400);
where Energy is an integer. This leads to the following problem: When opening the root file, I do get the Canvas named as wished but when I try to open them in the TBrowser they appear for a second and then vanish. Also there seems to be only one Histogram in each canvas suddenly. I do not understand, why changing the name should lead to this problem. Maybe somebody knows an answer to this.
Thank you!
ROOT Version: 7
Platform: MacOs
Compiler: Not Provided