Re: [ROOT] Problem using new Branch() with TString?

From: cstrato@EUnet.at
Date: Sun Jun 24 2001 - 20:40:55 MEST


Dear Rene

Thank you for your suggestion.
As you suggested, I placed gDebug at this position in my second library:
   Int_t  vNEntries = (Int_t)(vTree->GetEntries());
   gDebug = 2;
   for (Int_t i=0;i<vNEntries;i++) {
      vTree->GetEntry(i);
      some code;
   }

What I get is:
ReadBuffer, class:XClassB, name=XClassA, fType[0]=0, TStreamerBase, bufpos=73,
pointer=1096a618, offset=0
ReadBuffer, class:XClassA, name=TNamed, fType[0]=67, TStreamerBase, bufpos=79,
pointer=1096a618, offset=0
ReadBuffer, class:TNamed, name=TObject, fType[0]=66, TStreamerBase, bufpos=85,
pointer=1096a618, offset=0
ReadBuffer, class:TNamed, name=fName, fType[1]=65, TStreamerString, bufpos=95,
pointer=1096a618, offset=12
ReadBuffer, class:TNamed, name=fTitle, fType[2]=65, TStreamerString, bufpos=108,
pointer=1096a618, offset=20
ReadBuffer, class:XClassA, name=fTreeName1, fType[1]=65, TStreamerString,
bufpos=117,
pointer=1096a618, offset=99999
 *** Break *** segmentation violation

However, when I set "fTree->SetBranchStyle(0)" in my first library, I get:
ReadBuffer, class:XClassB, name=XClassA, fType[0]=0, TStreamerBase, bufpos=229,
pointer=10961f68, offset=0
ReadBuffer, class:XClassA, name=TNamed, fType[0]=67, TStreamerBase, bufpos=235,
pointer=10961f68, offset=0
ReadBuffer, class:TNamed, name=TObject, fType[0]=66, TStreamerBase, bufpos=241,
pointer=10961f68, offset=0
ReadBuffer, class:TNamed, name=fName, fType[1]=65, TStreamerString, bufpos=251,
pointer=10961f68, offset=12
ReadBuffer, class:TNamed, name=fTitle, fType[2]=65, TStreamerString, bufpos=258,
pointer=10961f68, offset=20
ReadBuffer, class:XClassA, name=fTreeName1, fType[1]=65, TStreamerString,
bufpos=267,
pointer=10961f68, offset=28
ReadBuffer, class:XClassA, name=fTreeName2, fType[2]=65, TStreamerString,
bufpos=280, pointer=10961f68, offset=36

It seems that in the first case fName and fTitle are read correctly,
but no longer fTreeName1 which is defined in class XClassA.

Interestingly, I have the same loop in my first library, where this
loop works correctly in both cases.

Could you give me a hint how I could proceed further?

Best regards
Christian
----------------------------------
C.h.r.i.s.t.i.a.n  S.t.r.a.t.o.w.a
V.i.e.n.n.a,  A.u.s.t.r.i.a


Rene Brun wrote:

> Hi Christian,
>
> You can have your libraries where you want. They don't need to be
> in $ROOTSYS/lib !
> Concerning your problem, you do not provide enough information.
> Did you set the branch address ?
> You can get an idea of what happens (with version 3.01/05) by activating
> the debug flag. Just before the loop on entries, add the statement
>   gDebug = 2;  (in TSystem.h)
>
> Rene Brun



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:50 MET