TTree::Draw() selection doesn't work correctly on vector of vector

Dear experts,

I’m looking into a tree with a branch v of type std::vector<std::vector<float>>. And I tried something trivial like this:

  t->Draw("v >> h(100, 0, 1)", "v < 0");

Naively I was expecting an empty histogram. However there turns out to be some fills above 0. May I ask if I’m misusing Draw() or this is a bug?

A small root file for reproducing the problem is attached test.root (5.9 KB)
. Thank you!


ROOT Version: 6.16/00
Platform: CentOS Linux 7 (lxplus)
Compiler: gcc 4.8.5

@couet This seems to be a bug in ROOT 6.10 and newer.

Yes that’s weird . We should get over/underflows not filled bins above 0.
I will look. Maybe be @pcanal also have some ideas.

Note that the following is also wrong:

 t->Draw("v ", "v < 0");

Indeed, this is a significant deficiency :(.
When the selection is sparse, some caching mechanism inside TTreeFormula gets the ‘instance’ number to use incorrectly. A fix is coming shortly.


The fix has been merged.

Thank you all!

@pcanal I read the jira and the commit on github. This explanation with ‘instance’ makes a lot of sense. Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.