Activity log for bug #1398818

Date Who What changed Old value New value Message
2014-12-03 13:09:00 John Frankland bug added bug
2014-12-03 13:09:10 John Frankland nominated for series formationroot/4jours
2014-12-03 13:09:10 John Frankland bug task added formationroot/4jours
2014-12-03 13:09:58 John Frankland description La version compilable de myfunc.C (p.27) devrait être: #include "TF1.h" #include "TH1.h" #include "TROOT.h" // <============= missing! Double_t myfunction(Double_t *x, Double_t *par) { Float_t xx = x[0]; Double_t f = TMath::Abs(par[0]*sin(par[1]*xx)/xx); return f; } void makefunc() { TF1* f1 = new TF1("func",myfunction,0,10,2); f1->SetParameters(2,1); f1->SetParNames("constant", "coefficient"); f1->Draw(); } void myfit() { TH1F* h1 = new TH1F("h1","test",100,0,10); h1->FillRandom("func",20000); TF1* f1 = (TF1*)gROOT->GetFunction("func"); // <======== gROOT->GetFunction renvoie TObject*, not TF1* ! f1->SetParameters(800,1); h1->Fit("func"); } La version compilable de myfunc.C (p.27) devrait être: #include "TF1.h" #include "TH1.h" #include "TROOT.h" // <============= missing! Double_t myfunction(Double_t *x, Double_t *par) {  Float_t xx = x[0];  Double_t f = TMath::Abs(par[0]*sin(par[1]*xx)/xx);  return f; } void makefunc() {    TF1* f1 = new TF1("func",myfunction,0,10,2);    f1->SetParameters(2,1);    f1->SetParNames("constant", "coefficient");    f1->Draw(); } void myfit() {    TH1F* h1 = new TH1F("h1","test",100,0,10);    h1->FillRandom("func",20000);    TF1* f1 = (TF1*)gROOT->GetFunction("func"); //<=====renvoie TObject* !!    f1->SetParameters(800,1);    h1->Fit("func"); }
2015-11-13 10:22:33 Daniel Cussol formationroot/4jours: status Confirmed Fix Committed
2015-11-13 11:42:40 Daniel Cussol formationroot/4jours: status Fix Committed Fix Released
2015-11-13 11:42:46 Daniel Cussol formationroot/4jours: assignee Daniel Cussol (cussol)