Problems with ntuples

From: Glen R. Salo (gsalo@mrcday.com)
Date: Sat Mar 27 1999 - 01:27:08 MET


The macro below demonstrates the problem that I have been having with ntuples. 
When I run the macro on my machine (Linux 2.0.36, 2.21.08) I get a histogram
displayed with the ranges going from -21 to -15.  However, according to
GetMaximum and GetMinimum, the X range should really be from -20.5 to 20.5.  Why
is the X axis set up incorrectly?

Interestingly, if I change nsamples to a smaller number, say 21, everything
works as expected.

Thanks for your help.

Glen

{

gROOT->Reset();

TNtuple *n = new TNtuple("ntuple","RSphere attachment data",
                         "xs:ys:zs:xe:ye:ze");

Float_t xs, ys, zs;
Float_t start, delt=1.;

Int_t nsamples = 41;

start = -nsamples*delt/2.;

for (Int_t i=0; i<nsamples+1; i++) {
  for (Int_t j=0; j<nsamples+1; j++) {
    for (Int_t k=0; k<nsamples+1; k++) {

      xs = start + i*delt;
      ys = start + j*delt;
      zs = start + k*delt;

      n->Fill(xs,ys,zs,i,j,k);

    }
  }
}

printf("min = %f\n",n->GetMinimum("xs"));
printf("max = %f\n",n->GetMaximum("xs"));
n->Draw("xs");

}



*********************************************************************

Glen R. Salo                                   g.r.salo@ieee.org
Mission Research Corporation                   (937)429-9261 Ext. 119
3975 Research Boulevard                        (937)429-2625 Fax
Dayton, Ohio 45430-2108

*********************************************************************



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:30 MET