TTree::MakeProxy fails for non-split objects

This is ROOT “v5-34-00-patches” and “6.08.04” here.

I have a simple tree with two branches saved in “non-spit” mode: one “TParticle” branch and another “TClonesArray of TParticle” branch (the tree was generated by ROOT “v5-34-00-patches”, if that matters).

I am trying to use TTree::Draw with a formula which contains a file name. This does automatically generate a TTree::MakeProxy “generatedSel.h”, but unfortunately, the generated file does not contain anything related to these two branches, so I cannot access them at all.

In general, it seems to me that TTree::MakeProxy cannot deal with any non-split objects at all (i.e. also for user’s classes with dictionaries not).

Any ideas?

Hi Pepe,

The depth of unrolling non-split object in MakeProxy is controlled by the parameter ‘maxUnrolling’ the default is 3 level (and this is the value currently hard-coded in TTree::Draw’s usage).

Can you try your example when updating this number higher?

Cheers,
Philippe.

Try: { TFile *f = TFile::Open("MyTree.root", "recreate"); TTree *t = new TTree("t", "t"); TParticle p; TClonesArray a("TParticle", 2); new(a[0]) TParticle(); new(a[1]) TParticle(); t->Branch("p", &p, 32000, 0); // NO splitting t->Branch("a", &a, 32000, 0); // NO splitting t->Fill(); t->Write(); t->Print(); gSystem->Exec("touch MyTree_script.cxx"); // create a dummy script file t->MakeProxy("MyTree", "MyTree_script.cxx", 0, 0, 99); // delete f; }
Notes:

  1. the dummy “MyTree_script.cxx” is always required even though it is explicitly defined as “optional” in TTree::MakeProxy(const char * proxyClassname, const char * macrofilename = 0, …),
  2. the generated “MyTree.h” file contains nothing related to the non-split TParticle “p” branch,
  3. the generated “MyTree.h” file contains nothing related to the non-split TClonesArray “a” branch.

For the record, the conversation continued at https://sft.its.cern.ch/jira/browse/ROOT-8585 and the problem has been resolved.