Re: [ROOT] Bug in THbook* interface classes

From: Stanislav NESTEROV (Stanislav.Nesterov@cern.ch)
Date: Fri Jul 26 2002 - 23:31:30 MEST


On Fri, 26 Jul 2002, Rene Brun wrote:

	Hi Rene,
	You are not completely right. This is the part of my N-tuple
root [5] tt2->Print()
******************************************************************************
*Tree    :h94       : /l3/l3data/99/ggntp/cc01jurg.ntp
*Entries :    78412 : Total =         1613614 bytes  File  Size =          0 *
*        :          : Tree compression factor =   1.00
******************************************************************************
*Br   32 :Itrg2     : Itrg2/I
*Entries :    78412 : Total  Size=      12394 bytes  File Size  =          0 *
*Baskets :        0 : Basket Size=       8000 bytes  Compression=   1.00
*............................................................................*
*Br   33 :Itrg3     : Itrg3/I
*Entries :    78412 : Total  Size=      12394 bytes  File Size  =          0 *
*Baskets :        0 : Basket Size=       8000 bytes  Compression=   1.00
*............................................................................*
*Br   34 :Ntrk      : Ntrk/I
*Entries :    78412 : Total  Size=      12388 bytes  File Size  =          0 *
*Baskets :        0 : Basket Size=       8000 bytes  Compression=   1.00
*............................................................................*

      As you can see "Ntrk" variable is integer. And it is one.
      I wrote to you that if I issue somthing like
	tree->Draw("Ntrk","","goff")
      then every branch reading is Ok.

			Best regards,
				Stanislav.
>
> Hi Stanislas,
>
> It is likely that your branch "Ntrk" contains more variables than just
> an integer. In your case, you overwrite your program by reading
> the branch variables behind the variable "Int_t nt".
> If you have more variables, you should define a C struct or a class
> or use MakeClass such that all variables in the branch are read
> correctly into the struct.
>
> Rene Brun
>
>
> On Fri, 26 Jul 2002, Stanislav NESTEROV wrote:
>
> >
> >     Hello Fons,
> >
> >    Recently I've tried to read some N-tuples via
> > THbookFile+THbookTree+THbookBranch classes but it was not so easy.
> >
> >    While I was using only "Draw" functionality all seem to be OK, but when
> > I've tried to do some readings of certain branches of N-tuple I've
> > got into a big trouble: I can not do this at ALL:
> >
> >    So from the beginning:
> >
> >
> > __________________________________________________________________
> > Content of my N-tuple:
> >
> >  ===> Directory : //lun10
> >          94 (N)   Gamma Gamma Ntuple
> >        9001 (1)   NTRK
> >        9002 (1)   E?BGO!
> >        9003 (1)   E?HCAL!
> >        9004 (1)   E?BGO+HCAL!
> >        9011 (1)   NTRK
> >        9012 (1)   E?BGO!
> >        9013 (1)   E?HCAL!
> >        9014 (1)   E?BGO+HCAL!
> >        9015 (1)   InTEC and OuterTEC TRG
> >        9099 (1)   number of events.
> >
> > root [0] gSystem->Load("libHbook.so");
> > root [1] THbookFile f("/l3/l3data/99/ggntp/cc01jurg.ntp");
> > root [2] tt2=(THbookTree*)f.Get(94)
> > (class THbookTree*)0x86fca48
> > root [3] Int_t nt
> > root [4] tt2->SetBranchAddress("Ntrk",&nt)
> > root [5] bran = (THbookBranch*)tt2->GetBranch("Ntrk")
> > (class THbookBranch*)0x87b4468
> > root [6] bran->GetEntry(30) //!!!!!!!!!!!!!!!!
> >  ***** ERROR in HNBUFF : Buffer structure not initialized. : ID=      94
> >  ***** ERROR in HGNTF : Cannot find Ntuple buffer structure : ID=      94
> > (Int_t)0
> > ________________________________________________________________________
> >
> >
> >     BUT if I Drawing exatly the same variable ( here "Ntrk") via
> >
> >     tt2->Draw("Ntrk")
> >
> > before getting any entry from this branch then everything is allright.
> >
> >    So I found in procedure THBookFile::InitLeaves(...) that in case
> > of empty `TreeFormula* ' argument this procedure just quits. Very strange
> > solution I think.
> >
> >   In any case N-tuple initialization (for branches) is failed and one can
> > only obtain some result if call procedures that using
> >  TTreePlayer::InitLoop with some related formula.
> >
> >   May be the best solution is slightly change the
> > THbookTree::InitLeaves()? I really don't know. Or just throw out from
> > THbookFile::GetEntryBranch  call of HGNTF subrouting (in such specific
> > cases)?
> >
> > 	Best regards
> > 				Stanislav.
> >
>
>



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:01 MET