>William J Deninger wrote:
>>
>> Hello,
>>
>> There is a strange bug in 1.03/09 TAxis on my WinNT w/sp3 which can be
>> illustrated in the following.
>>
>> TH1F *h = new TH1F("h","test",300,0,300);
>> Int_t i;
>> TAxis *a = h->GetXaxis();
>> Float_t x = 55.0;
>> Float_t fXmin = a->GetXmin();
>> Float_t fXmax = a->GetXmax();
>> Int_t fNbins = a->GetNbins();
>>
>> Int_t bin = a->FindBin(x); // result is incorrect
>> Int_t bin1 = 1 + (Int_t) fNbins*(x - fXmin)/(fXmax-fXmin); // result
>> is correct
>>
>> for (i=0; i<600; i++) h->Fill( i/2.0 );
>> h->Draw();
>>
>> Has this been corrected on version 2.0?
>>
>
>I am sorry. I cannot reproduce what you call "a bug".
>I am getting the expected value bin=bin1=56
>
>When you want to see the list of changes in a new version,
>read the version release notes available from the
>Root "Availability and Status" page. For example
> http://root.cern.ch/root/html/examples/V2.00.txt.html
>
>Rene Brun
>
Rene,
Perhaps this is a problem with the WinNT port of ROOT. In the above example
I find bin = 55,
bin1 = 56, for v2.00/03 and v.1.03/08. In fact, the incorrect TAxis bin
calculation occurs several times over the interval [0,300) consistently.
www.npl.uiuc.edu/incoming/snap1.gif // console snap of above on WinNT w/sp3
root v2.00/03
www.npl.uiuc.edu/incoming/snap2.gif // histogram canvas on WinNT w/sp3 root
2.00/03
I use histograms commonly for data storage of straw tube drift time spectrum
which are intern used to reconstruct particle trajectories...so it's
important that binning is done in a consistent manner. Certainly I'm able
to use (and do) SetBinContent and override the bug, but it seems VERY
peculiar that the code as published should result in this incorrect floating
point result. I cant reproduce it by recompiling that particular section of
TAxis::FindBin code which worries me. If the floating point error is do to
a flaw in the version 4 Microsoft Compiler or because of a mistake in
compiler settings while building the root NT port libraries, it may impact
my analysis results..e.g, I rely heavily on TShape objects to return their
global coordinates after a series of translations and orientation
adjustments.
Does anyone else out in root land using NT get the same result?
William J Deninger