Hi Davide, TH1::FillRandom and TH1::GetRandom were not operational for variable bin width histograms. Now implemented in the development version. Rene Brun On Thu, 27 Jul 2000, Davide Cremonesi wrote: > Hello everybody, > I wrote a small script which shows an incoherent behaviour with > histograms when the binning is not equally spaced. Maybe this is > not the intended usage, but I fear that something bad happens in > void TH1::FillRandom(const char *fname, Int_t ntimes). > > Float_t x[5]={0,1,2,9,10}; > TH1D wrong("wrong","wrong", 4, x); > TH1D correct("correct","correct", 4, x); > TF1 c("const","10",0,10); > wrong.FillRandom("const",100000); > wrong->Draw(); > for (int i=0; i<100000; i++) { > correct.Fill(c.GetRandom()); > } > correct->Draw(); > } > > Thanks for your attention, > Davide > > -- > Davide I. Cremonesi > IFC "G.Occhialini" - CNR > via Bassini 15, I-20133 Milano > Tel: +39 02 23699341 > Fax: +39 02 2666017 > > >
This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:30 MET