Hi Olivier
I run your script by three root file and it work.
But when I run it for three other .root file It doesn’t work and the output error attached.
I attached three new file too.
All of files generate by same methods.
I get confused.
can you help me?
error.txt (6.8 KB)
cT90.root (19.4 KB)
cT93.root (21.8 KB)
cT97.root (19.7 KB)
couet
August 30, 2023, 9:06am
22
void MergePlot() {
TFile* fr1 = TFile::Open("cT90.root");
TCanvas* c1;
fr1->GetObject("cT90;1", c1);
TGraph *g1 = (TGraph*)c1->GetListOfPrimitives()->FindObject("Graph");
g1->SetLineColor(kGreen);
TFile* fr2 = TFile::Open("cT93.root");
TCanvas* c2;
fr2->GetObject("cT93;1", c2);
TGraph *g2 = (TGraph*)c2->GetListOfPrimitives()->FindObject("Graph");
g2->SetLineColor(kBlue);
TFile* fr3 = TFile::Open("cT97.root");
TCanvas* c3;
fr3->GetObject("cT97;1", c3);
TGraph *g3 = (TGraph*)c3->GetListOfPrimitives()->FindObject("Graph");
auto C = new TCanvas();
C->SetLogx();
C->SetLogy();
auto m = new TMultiGraph();
m->Add(g1);
m->Add(g2);
m->Add(g3);
m->Draw("AL");
C->RedrawAxis();
}
system
Closed
September 13, 2023, 10:00am
24
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.