Error in <TChain::SetBranchAddress>

Hi,
We have upgraded to 5.15/07 from 5.13/04.
A cint code have generated the next error (that wasn’t in the past):
“Error in TChain::SetBranchAddress: The class requested (vector<vector<double,allocator > >) for the branch “blabla” refer to an stl collection and do not have a compiled CollectionProxy. Please generate the dictionary for this class (vector<vector<double,allocator > >)”

note: blabla is just a name/label.

Do i need somehow to generate a dictionary for vector<vector >?
or is it a tiny bug in 5.15 version?
About “generate dictionary for this class”- i try reading stuff on the root talk, but till now with no great success.

Thank you in advance,
(sorry for the double submits)
Erez

Hi,

This is a valid Error message! If you do not generate the dictionary for vector<vector > your result are likely to be incorrect.

To generate the dictionary you simply have to write the following simple file

// File loader.C #include <vector> #ifdef __MAKECINT__ #pragma link C++ class vector<vector<double> >+; #endif
and build it via ACLiC:root [] .L loader.C+

Cheers,
Philippe

Hi Philippe,

Thanks a lot for your response it helped to solve the vector<vector > problem, ‘though it caused a different problem that I somehow solved.
But my question is where can I find/understand/read more material about the solution, “generate a dictionary” and why should I do so (generate dictionary etc’).

Thank you anyway in advance,
Erez

Hi,

Please re-read the User’s Guide chapter “Adding a Class”.

Cheers,
Philippe

I have that same problem at can’t make the .L loader.C+ solution work…

"Processing loader.C+…
Info in TUnixSystem::ACLiC: creating shared library /home/simonfj/test1200/alpha3/./loader_C.so
/tmp/Af0KWM_cint.cxx:1:13: c: No such file or directory
Error: external preprocessing failed. :0:
Error: rootcint: failed to open /home/simonfj/test1200/alpha3/./filejUVJDL.h in ReplaceBundleInDict()
/home/simonfj/test1200/alpha3/filejUVJDL.cxx:16:24: filejUVJDL.h: No such file or directory
In file included from /home/simonfj/test1200/alpha3/filejUVJDL.cxx:28:
/net/lscf/soft/public/software/atlas/AppsArea/NBI/RELEASE/atlas-13.0.30/sw/lcg/external/root/5.14.00h/slc3_ia32_gcc323/root/include/RtypesImp.h:16:2: #error RtypesImp.h should only be included by ROOT dictionaries.
g++32: /home/simonfj/test1200/alpha3/./filejUVJDL.o: No such file or directory
Error in : Compilation failed!
Error: Function loader() is not defined in current scope :0:
*** Interpreter error recovered *** "
To me most of that is just unreadable i’m affraid.

Though after i get that initial error with “Please generate the dictionary for this class (vector<vector<double,allocator > >)” I can then see the different floatpoint variables using TBrowser… Until i ran my program TBroser just gave me this… “Warning in TSelectorDraw::ProcessFillObject: Not implemented for vector”.

Can anyone help me? Please.

Hi,

[quote]Though after i get that initial error with “Please generate the dictionary for this class (vector<vector<double,allocator > >)” I can then see the different floatpoint variables using TBrowser… Until i ran my program TBroser just gave me this… “Warning in TSelectorDraw::ProcessFillObject: Not implemented for vector”.[/quote]TTree::Draw (called by TBrowser) can not handle 3 level of nesting of collection (I assume that ou vector<vector> is actually held in a collection (vector/TClonesArray).

Info in <TUnixSystem::ACLiC>: creating shared library /home/simonfj/test1200/alpha3/./loader_C.so /tmp/Af0KWM_cint.cxx:1:13: c: No such file or directory Humm … could /tmp be full?

Error: rootcint: failed to open /home/simonfj/test1200/alpha3/./filejUVJDL.h in ReplaceBundleInDict() or could /home/simonfj/test1200/alpha3 be full or not writeable?

Cheers,
Philippe

All I needed to do was to write:

Cintex::Enable()

before doing anything else…
Then one can do

TFile *F = TFile::open(“FILENAME.root”)
CollectionTree-> WHATEVER… (Draw, MakeClass…)

or

TBrowser, .L program.C,…

Cheers

Hi,

I am not sure exactly how the Cintex::Enable (which allows the loading of Reflex dictionary in ROOT) solved your problem. However this post is just to note that this solution can only apply to the case where Reflex dictionary are used …

Cheers,
Philippe.

Hello,

I tried what you said above to add a dictionary for vector, but it did not work for me. I am not even sure if I need to fix my error. I receive the error:

This error occurs for each of my vector. My code looks like:

#include <vector> ... #ifdef __MAKECINT__ #pragma link C++ class vector<float>+; #endif ... vector<float> *el_L2_eta=new vector<float>(); vector<float> *el_L2_Et=new vector<float>(); vector<float> *el_L2_phi=new vector<float>(); vector<float> *el_L2_pt=new vector<float>(); ...

I have tried to add #pragma to a to a separate loader.C file and and have my makefile grab it, but that doesn’t work either. The strange part to all this is that I still get numbers for “el_L2_eta” even though it gives me this error. Any suggestions?

Oh, it might help to know I am making this macro into an executable to later put onto Grid.

Thanks,
Michael

Hi,

The dictionary for vector is already pre-built and in most case you can not generate a dictionary for it yourself. Instead you need to trigger the loading of the pre-built dictionary by doing:gROOT->ProcessLine("#include <vector>");

Cheers,
Philippe

Hello.

I’m getting these error messages:

Error in TTree::SetBranchAddress: The class requested (vector<pair<string,float> >) for the branch “Trigger” refer to an stl collection and do not have a compiled CollectionProxy. Please generate the dictionary for this class (vector<pair<string,float> >)
Error in TTree::SetBranchAddress: The class requested (vector<pair<float,float> >) for the branch “jet_AntiKt4LCTopoJets_pt_phi” refer to an stl collection and do not have a compiled CollectionProxy. Please generate the dictionary for this class (vector<pair<float,float> >)

even though I did this:

root [16] .! cat loader.C #include <vector> #include <string> #include <utility> // pair #ifdef __MAKECINT__ #pragma link C++ class vector<pair<float,float> >; #pragma link C++ class vector<pair<string,float> >; #endif root [17] .L loader.C+ root [18] t->Process("METtree.C+") // error messages

Could you please tell me what is wrong?

BTW, it seems that my analysis is able to read the vectors of pairs, given that I get meaningful output. But I cannot be certain that it’s 100% correct, hence would like to get rid of the error messages.

Thanks a lot,
Diego

Well, sorry for my previous message. Now the error messages are gone but don’t know why ^_^'
Thanks anyway,
Diego

Hi there I’m also trying to use a makefile for this:

    gROOT->ProcessLine("#include <vector>");
    vector<float>   *jets =0;
    TBranch        *b_m_jet_pt;   
    Ztree->SetBranchAddress("m_jet_pt",&m_jet_pt, &b_m_jet_pt);[/code]

however now there are no compilation errors but the vectors are assigned to some single crazy high value (some random pointer.)

I am not sure what this means but most likely the end result is that no dictionary for the vector has been loaded at run-time.

Cheers,
Philippe.