I have a set of TGraphs which I draw on the same canvas with "same"
and which I want to write to a .root file. I’m currently calling Write()
on the canvas which works, but when I open the canvas from the TBrowser it opens a new window, which I would prefer it didn’t.
How can I save the superposition of all the "same"
s of the TGraphs as a graph itself instead of saving the canvas?
TGraph* MyGraphs[nGraphs];
for (int i=0; i<nGraphs; i++){
MyGraphs[i] = new TGraph(4);
for (int j=0; j<4; j++) {
MyGraphs[i]->SetPoint(j,pzx[j][i].X(),pzx[j][i].Y());
}
}
TCanvas* cfingerGraph = new TCanvas("fingerGraph");
cfingerGraph->SetWindowSize(600,600);
cfingerGraph->DrawFrame(
PVetoCenter.Z()-0.5*PVetoSize.Z(),
PVetoCenter.X()-0.5*PVetoSize.X(),
PVetoCenter.Z()+0.5*PVetoSize.Z(),
PVetoCenter.X()+0.5*PVetoSize.X());
cfingerGraph->Write();
_ROOT Version: 5
_Platform: centos7