passing arguments by reference

Stas Tereshenko (sutasu@oea.ihep.su)
Thu, 18 Jun 1998 13:48:28 +0400 (MSK DST)


Hello Rooters.
I'd like to draw 12 histograms from Ntuple on 12 different pads. Ntuple
was created by: TNtuple *ntuple = new TNtuple("ntuple","ADC data",
"data[0]:data[1]:data[2]:data[3]:data[4]:data[5]:data[6]:data[7]:data[8]:data[9]:data[10]:data[11]");

That's I do:

{
gROOT->Reset();
int i;
TCanvas *c = new TCanvas("c","canvas");
c->Divide(3,4);

TFile *f = new TFile("q.root");
f->Print();
ntuple->Print();

char dtstr[100];
for(i=0;i<12;i++) {
c->cd(i);
sprintf(dtstr,"data[%d]",i);
ntuple->Draw(dtstr);
}
c->Update();
}

All 12 histograms are drawn "on the same place" i.e. on main 'c'
canvas.
What do I wrong?
Thakns.
Stas.

------------------------------------------------------------------------------
Stanislav Tereshenko
Institute for High Energy Physics Protvino, Russia
Multi-Muon Spectrometer Department
e-mail: tereshenko@mx.ihep.su
sutasu@oea.ihep.su
sutasu@afsmail.cern.ch
------------------------------------------------------------------------------