Re: Writing array in tree again

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Mar 26 1998 - 09:21:18 MET


Tadeusz Pytlos wrote:
> 
> 
> Hello Pasha,
> Thank you for your reply. I placed wrong also the initialisation
> of indexes. It should be
> On Sun, 22 Mar 1998, Pasha Murat wrote
> >
> > I modified your macro so it works properly now :
> > ----------------------------------------------
> > {
> >   gROOT->Reset();
> >   Float_t  adc[16];
>     Int_t i,j;
> >   TFile *file=new TFile("adc.root","RECREATE");
> >   TTree *tree=new TTree("tree","Testing still");
> >   tree->Branch("adc",&adc,"adc[16]/F");
> >   for(j=0;j<100;j++) {
> >     for(i=0;i<16;i++) adc[i]=i;
> >     tree->Fill();
> >   }
> >   tree->Write();
> >   tree->Print();
> >   file->Close();
> > }
> > ---------------------------------------------
> > Note that tree->Draw("adc") is equivalent to tree->Draw("adc[0]")
> Now filling of array is OK, but it's still something what I don't
> understand. I this case tree->Draw("adc") is the same as
> tree->Draw("adc[0]), but in the case of the array converted from hbooks
> (I meam row wise ntuples) when I type tree-Draw("adc") I see whole
> array, not only adc[0]. What is a reason of this descrepancy?
> Best wishes,
>          Tadeusz
> 

This descrepancy is only temporary. It is my intention to implement
this facility also for data members that are arrays.
For the time being, the implementation is only for the simple case
of arrays coming from Hbook column-wise ntuples.

Rene Brun



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