Hi Gerco,
Your macro runs correctly with the production version 2.25/03
I recommend you upgrade to this version.
Rene Brun
Gerco Onderwater wrote:
>
> Hi All,
>
> I found an annoying problem with TH1. The macro below leads to a
> segmentation violation when executed as is, or when typed line by line
> in CINT. When the two indicated lines are deleted, everything works
> just fine.
>
> That's it,
>
> Gerco
>
> (using version 2.23/12 on a linux pc).
>
> ---- demo ----
>
> doit()
> {
> TCanvas* c1 = new TCanvas("c1","c1");
> TH1D* h = new TH1D("h","h",100,0,1);
> h->Sumw2();
> TF1* f = new TF1("f","pol0",0,1);
> f->SetParameter(0,100);
> h->FillRandom("f",10000);
>
> TList* lof = h->GetListOfFunctions();
> lof->Add(f);
> h->Draw();
> c1->Modified(); // when commenting out this and the next line,
> c1->Update(); // things are fine.
>
> TF1* ffit = new TF1("ffit","pol0",0,1);
> ffit->SetParameter(0,100);
> h->Fit("ffit");
> }
>
> -- Gerco
>
> Dr. C.J.G. Onderwater
> Nuclear Physics Laboratory
> 312 Loomis Laboratory of Physics
> University of Illinois at Urbana-Champaign
> 1110 West Green Street
> Urbana, IL 61801-3080
> Phone : (217) 244-7363
> Fax : (217) 333-1215
> E-mail: onderwat@uiuc.edu
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:36 MET