Draw of TNtuple

Markus Weiss (weiss@bessy.de)
Thu, 18 Mar 1999 10:00:28 +0100


Hi,

I wrote a little routine to display data which is organized
as approx. 50000 lines of "x y z". When I try to draw these
with e.g. option "surf3" only a subrange of y is shown.

Thanks for any help.

Markus.

The code follows:

gROOT->Reset();

void show() {
c1 = new TCanvas("c1","The Ntuple canvas",200,10,700,780);

Double_t xin, yin, zin;
int ncols, nlines;

FILE *fp = fopen("s160399.mit","r");

if (fp <= 0) printf("Sorry, cannot open file test.dat\n");

data = new TNtuple("data","data","px:py:pz");

while (1) {
ncols = fscanf(fp, "%lf %lf %lf", &xin, &yin, &zin);
if (ncols<0) break;
data->Fill(xin,yin,zin);
nlines++;
}
fclose(fp);

printf(" found %d points\n",nlines);

data->Draw("px:py","pz","surf3");

c1->Update();
}

--
---------------------------------------------------------------------
Markus Weiss                                  "Ah elbereth glithoniel
BESSY-2 Projektteam                            silvren penna miriel"
e-mail: weiss@abbe.exp.bessy.de               phone: +49-30-6392-2941
---------------------------------------------------------------------