Re: Re: Re: About the STL Container and TTree

From: Sebastien Binet <binet_at_cern.ch>
Date: Thu, 14 Jan 2010 09:26:32 +0100


On Thursday 14 January 2010 06:08:41 yczhang_at_ihep.ac.cn wrote:
> Hi Brett
> I have fixed the changes from roottalk.
> But when I execute the generated TTreeVec.exe. It still breaks.
> When compiling, the information is:
> #CMT---> (TTreeVecGen.make) Rebuilding
> ../i686-slc4-gcc34-dbg/TTreeVecGen_dependencies.make
> ../i686-slc4-gcc34-dbg/dict/TTreeVec/headers_dict.cpp headers.h --->>
> genreflex: INFO: Parsing file
> /afs/ihep.ac.cn/users/y/yczhang/concreteproj/TTreeVec/dict/headers.h with
> GCC_XML OK --->> genreflex: INFO: Generating Reflex Dictionary
> class std::deque<double>
> class std::vector<std::deque<double> >
>
> But when executing ,the information is:
> Error in <TTree::Branch>: The class requested (vector<deque<double> >)
> for the branch "DequeVecBranch" refer to an stl collection and do not
> have a compiled CollectionProxy. Please generate the dictionary for this
> class (vector<deque<double> >) .....
> Error in <TTree::SetBranchAddress>: unknown branch -> DequeVecBranch
>
> In the prcocess, the load.C in share/ has not been used. So I guess that
> I should load the libTTreeVecDict.so before executing the TTreeVec.exe? I
> will follow your recommendation "Level I", hoping that I can have a better
> understanding of the Reflex.

sounds like you forgot to load Cintex and enable its autoloading-of-reflex- dicts feature:
https://twiki.cern.ch/twiki/bin/viewauth/Atlas/ReflexMiniTutorial#How_to_use_the_dictionary """
How to use the dictionary
Here is how one can use the dictionary from the CINT prompt:

// load the library which makes CINT understand Reflex structures [0] gSystem->Load("libCintex");
// enable the callback which will automatically create the // CINT structures from Reflex ones
[1] ROOT::Cintex::Cintex::Enable();
[2] MyNS::Foo f;

Alternatively, from PyROOT:

00001	import PyCintex
00002	PyCintex.Cintex.Enable()
00003	import ROOT
00004	f = ROOT.MyNS.Foo()

"""

hth,
sebastien.

>
> Cheers
> YiChun.Zhang
>
> > -----原始邮件-----
> > 发件人: "Brett Viren" <bv_at_bnl.gov>
> > 发送时间: 2010年1月14日 星期四
> > 收件人: yczhang_at_ihep.ac.cn
> > 抄送:
> > 主题: Re: About the STL Container and TTree
> >
> > Hi again,
> >
> > yczhang_at_ihep.ac.cn writes:
> > > I've committed it to $DYBSVN/people/yczhang//concreteproj/.
> >
> > Okay, with the help from roottalk I have your package built and your
> > test app working. Please understand these changes:
> >
> > 1) Needed the fix given to us on the roottalk mailing list.
> >
> > 2) Needed to uncomment the code in deqvectree to turn on Cintex and load
> > the Dict library.
> >
> > I have attached a patch file that you can apply to your package and will
> > give you these two fixes. You can apply it by:
> >
> > cd people/yczhang
> > patch -p2 < yichun.path
> >
> > I recommend that you totally remove the old TTreeVec/$CMTCONFIG/
> > directory before trying to rebuild.
> >
> >
> > I also have some general suggestions for improving the design of this
> > code. They come in two "levels". The first may be simpler but is not
> > as powerful as the second.
> >
> > Level I:
> >
> > a) do not write your own main() function.
> >
> > b) build most of deqvectree.cc into a library (but do not include the
> > Cintex and Load() lines).
> >
> > c) use plain "root" command, load your library and Dict library via a
> > load.C holding the Cintex and gSystem->Load() commands and write a very
> > short .C macro to "drive" execution.
> >
> >
> > Level II:
> >
> > a) write a GaudiAlgorithm to hold most of deqvectree.
> >
> > b) use the StatisticsSvc to manage the TTree
> >
> > c) write Python configuration and use nuwa.py to "drive" execution.
> >
> >
> > As always, feel free to ask questions on any of this.
> >
> > -Brett.
>

-- 
#########################################
# Dr. Sebastien Binet
# Laboratoire de l'Accelerateur Lineaire
# Universite Paris-Sud XI
# Batiment 200
# 91898 Orsay
#########################################
Received on Thu Jan 14 2010 - 09:32:24 CET

This archive was generated by hypermail 2.2.0 : Thu Jan 14 2010 - 11:50:01 CET