Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
6.14/00, 6.14/04
-
None
-
Arch Linux x86_64
GCC 8.1.1
Description
When reading two TF1s with the same formula, say '[0]*x + [1]' from a ROOT file the following error message is printed:
input_line_68:2:10: error: redefinition of 'TFormula____id76870135910997656'
|
Double_t TFormula____id76870135910997656(Double_t *x,Double_t *p){ return p[0]+p[1]*x[0] ; }
|
^
|
input_line_62:2:10: note: previous definition is here
|
Double_t TFormula____id76870135910997656(Double_t *x,Double_t *p){ return p[0]+p[1]*x[0] ; }
|
This bug can be reproduced with the two ROOT scripts attached (first run write.C, then read.C).
int write() {
|
|
TF1* f1 = new TF1("f1", "[0] + [1]*x", 0, 1);
|
TF1* f2 = new TF1("f2", "[0] + [1]*x", 0, 1);
|
TFile* f = TFile::Open("test.root", "RECREATE");
|
f1->Write();
|
f2->Write();
|
f->Close();
|
|
return 0;
|
}
|
int read() {
|
|
TFile* f = TFile::Open("test.root", "READ");
|
TF1* f1 = dynamic_cast<TF1*>(f->Get("f1"));
|
TF1* f2 = dynamic_cast<TF1*>(f->Get("f2"));
|
|
new TCanvas;
|
f1->Draw();
|
new TCanvas;
|
f2->Draw();
|
|
return 0;
|
}
|