Hi Marc-Andre, I have fixed this problem appearing when subtracting identical histograms in the CVS source. I have also modified the computaion of the number of entries in this case. Rene Brun Marc-Andre Pleier wrote: > > Dear Rooters, > > is there anybody who can comment on the following effect? > > Just copy the following example into your ROOT-session: > > form1 = new TFormula("form1","abs(sin(x)/x)"); > sqroot = new TF1("sqroot","x*gaus(0) + [3]*form1",0,10); > sqroot->SetParameters(10,4,1,20); > h1f = new TH1F("h1f","Test random numbers",200,0,10); > h1f->SetFillColor(45); > h1f->FillRandom("sqroot",10000); > h1f->Draw(); > h1f->Add(h1f, -1.); > h1f->Draw(); > > So, what's happening is that you subtract two identical histograms from > each other and get - as expected - an empty histogram as result BUT > the mean and rms are still the same of the original histogram being > subtracted from itself... > > I think, what happens is the following: > If you subtract two histograms, their values for sumw (stats[0]) and sumwx > (stats[2]) are added for the resulting histogram instead of being > subtracted. > This will thus result in a wrong mean value. > > The way ROOT behaves right now, you can get two identical > (non-empty!) histograms having different MEAN and RMS. > > I tried the same in PAW - there everything looks fine, and the > above example would result in an empty histogram with mean = rms = 0. > > I tried this for ROOT-versions > 3.01/06 29 August 2001 and > 2.24/05 25 May 2000. > > If there's a good reason for this, I'd really like to know. > > Cheers, > Marc-Andre > > P.S.: I've posted this already some time ago, but got no answer. > I still think this is a severe problem... > > ----------------------------------------------------------------------------- > Marc-Andre Pleier Tel. : +0049 6221 516506 > MPI Kernphysik Fax : +0049 6221 516603 > Postfach 103980 Email: Marc-Andre.Pleier > D-69029 Heidelberg @mpi-hd.mpg.de > -----------------------------------------------------------------------------
This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:00 MET