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

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Jun 18 2001 - 02:23:46 MEST


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

On Sat, 16 Jun 2001 cstrato@EUnet.at wrote:

> Dear Rene
> 
> Thank you for your suggestion. Sorrowly, the problem persists
> with version 3.01/05.
> 
> Regarding your second suggestion, until now I have not been
> able to extract a subset where the problem can be reproduced.
> I have tried to create test classes, but the problem never
> appeared.
> 
> However, I know exactly where the program crashes:
> // The following command is still ok:
>    Int_t  vNEntries = (Int_t)(vTree->GetEntries());
> cout << "vNEntries <" << vNEntries << ">" << endl;
>    for (Int_t i=0;i<vNEntries;i++) {
> // The following line crashes!!
>       vTree->GetEntry(i);
>       some code;
>    }//for_i
> 
> Although there are entries in the tree, it cannot get the
> entries.
> Maybe, you can give me some hints where to look further?
> 
> I have seen that the option Bronch() requires access to the
> library where the corresponding class is defined.
> Since my libs are stored in /opt/rootcode maybe Bronch()
> cannot access the corresponding library, although it is
> loaded first with gSystem->Load(lib).
> Could it be that I need to store my own libraries also
> in /opt/root/lib in order for Bronch() to find the
> corresponding class?
> 
> Thank you for your help.
> Best regards
> Christian
> 
> Rene Brun wrote:
> 
> > Hi Christian,
> >
> > Let me suggest two things:
> >  1- could you try with the version 3.01/5 now released including the
> >    version for PPPLinux, thanks to Damir).
> >  2- if the problem persists, prepare a tar file with a very small subset
> >   of your classes such that I can reproduce the problem.
> >
> > Note that, as I explained in a previous mail, we will not have frequent
> > access to the Internet in the coming 10 days.
> >
> > Rene Brun
> >
> > On Fri, 8 Jun 2001 cstrato@EUnet.at wrote:
> >
> > >
> > > Dear Rene, dear Rooters
> > >
> > > In my first root file I store a tree with one branch that addresses a
> > > class,
> > > which is derived from TNamed, but contains as member variables two
> > > TStrings
> > > and a couple of integer variables. Thus I had to set the splitlevel to
> > > zero
> > > in my first library in earlier versions of root.
> > >
> > > My second library creates a new root file and stores a couple of trees
> > > with
> > > branches containing only integers and doubles. However, it accesses the
> > > tree
> > > from the first root file to get some data.
> > >
> > > This second library works fine as long as it accessed the first root
> > > file
> > > created with the old Tree::Branch() function. However, now I have
> > > recreated
> > > the first root file, which uses now the new Tree::Branch function (since
> > >
> > > I am using now 3.01/02). Now the second library crashes with a
> > > "segmentation
> > > violation".
> > >
> > > After setting "Tree->SetBranchStyle(0)" in my first library for the
> > > branch
> > > containing TStrings and integers, everything works fine again. It seems
> > > that
> > > simply setting split=0 in the new Branch() is not enough.
> > >
> > > My question now is:
> > > Why do I have to use BranchOld() when my class contains TStrings?
> > >
> > > My system: PowerBook running LinuxPPC 2000, root 3.01/02.
> > >
> > > Thank you in advance for your help.
> > >
> > > 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
> > >
> > >
> 



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