TTreeFormula support only 2 level of variables size collecti

Hi,

I have a hierarchy of data classes I would like to represent in a ROOT tree. One class has an STL vector in it that holds objects of another class which contains an STL vector of a 3rd class. The 3rd class has an STL vector of integers.

The problem is that it seems ROOT is limited to at most 2 levels of nested containers. The code compiles and runs OK, but when I try accessing this 3rd level container in the ROOT file, it gives the message below. I also noticed that it comments out lines related to these 3rd level containers in code generated by TTree::MakeSelector().

I’m wondering if there is a way to get around this limitation so I could have more levels of containers? Is the issue tied to using STL vectors as opposed to TClonesArray? Any advice would be appreciated.

I’ve attached a tarball with minimal example code that illustrates the problem.

[quote]>root -l test.root
Executing ~/.rootlogon.C
root [0]
Attaching file test.root as _file0…
Warning in TClass::TClass: no dictionary for class Event is available
Warning in TClass::TClass: no dictionary for class Vertex is available
Warning in TClass::TClass: no dictionary for class Particle is available
root [1] tr->Draw(“verticies.particles.daughters”)
Warning in TTreeFormula::DefinedVariable: TTreeFormula support only 2 level of variables size collections. Assuming ‘@’ notation for the collection daughters.
Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1
Warning in TSelectorDraw::ProcessFillObject: Not implemented for vector
root [2] [/quote]
ROOT_Tree_nested_containers.tgz (1.24 KB)

[quote]The problem is that it seems ROOT is limited to at most 2 levels of nested containers. [/quote]Yes, this is a hard limit in TTreeFormula. To work around it you will need to use the TTree::Draw that takes a script as input, or TTree::MakeProxy or TTree::MakeSelector.

Cheers,
Philippe.