TAxis bug

William J Deninger (deninger@uiuc.edu)
Sat, 4 Apr 1998 17:52:38 -0600


This is a multi-part message in MIME format.

------=_NextPart_000_000F_01BD5FF2.74DE4510
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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 =3D new TH1F("h","test",300,0,300);
Int_t i;
TAxis *a =3D h->GetXaxis();
Float_t x =3D 55.0;
Float_t fXmin =3D a->GetXmin();
Float_t fXmax =3D a->GetXmax();
Int_t fNbins =3D a->GetNbins();

Int_t bin =3D a->FindBin(x); // result is incorrect
Int_t bin1 =3D 1 + (Int_t) fNbins*(x - fXmin)/(fXmax-fXmin); // result =
is correct

for (i=3D0; i<600; i++) h->Fill( i/2.0 );
h->Draw();

Has this been corrected on version 2.0?

William J Deninger

------=_NextPart_000_000F_01BD5FF2.74DE4510
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">

Hello,
 
There is a strange bug in 1.03/09 = TAxis on my=20 WinNT w/sp3 which can be illustrated in the following.
 
TH1F *h =3D new=20 TH1F("h","test",300,0,300);
Int_t i;
TAxis *a = =3D=20 h->GetXaxis();
Float_t x =3D 55.0;
Float_t fXmin =3D=20 a->GetXmin();
Float_t fXmax =3D a->GetXmax();
Int_t fNbins = =3D=20 a->GetNbins();
 
Int_t bin =3D a->FindBin(x); // = result is=20 incorrect
Int_t bin1 =3D 1 + (Int_t) fNbins*(x = -=20 fXmin)/(fXmax-fXmin); // result is correct
 
for (i=3D0; i<600; i++) = h->Fill( i/2.0=20 );
h->Draw();
 
Has this been corrected on version=20 2.0?
 
William J=20 Deninger
------=_NextPart_000_000F_01BD5FF2.74DE4510--