Hi,
I observed strange behavior in the TTree:Draw() function today. I could reproduce it in ROOT 5.34/14, 5.34/18, as well as 6.02/05.
The problem is shown easily with the attached file. It contains 1 event with several branches of type std::vector, among others. I am trying to plot two of these branches, ValRecTausPhi and ValMCtausPhi, against each other, but I find that the result depends on which branch goes first:
[code]$ root -l DrawProblem.root
root [0]
Attaching file DrawProblem.root as _file0…
root [1] treeR->Scan(“ValRecTausPhi:ValMCtausPhi”)
- Row * Instance * ValRecTau * ValMCtaus *
-
0 * 0 * -0.334601 * -0.370766 *
-
0 * 1 * * 0.8069651 *
(Long64_t)2
root [2] treeR->Draw(“ValRecTausPhi:ValMCtausPhi”, “”)
Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1
(Long64_t)2
// NOTE that we got 2 entries
root [3] treeR->Scan(“ValMCtausPhi:ValRecTausPhi”)
- Row * Instance * ValMCtaus * ValRecTau *
-
0 * 0 * -0.370766 * -0.334601 *
-
0 * 1 * 0.8069651 * *
(Long64_t)2
root [4] treeR->Draw(“ValMCtausPhi:ValRecTausPhi”, “”)
(Long64_t)1
// NOTE that we got 1 entry only
[/code]
If I understand the ROOT documentation correctly, the second Draw result (1 entry) is right, and the first result (2 entries) is wrong, because the Draw loop should only iterate over pairs that are in both lists, and stop looping after “min(length1, length2)” iterations. (Search “So the loop equivalent” in root.cern.ch/root/html/TTree.html#TTree:Draw@2)
Furthermore, it would be really counterintuitive if a scatter plot depended on the order of the axes.
Still, it’s possible that I simply don’t understand things right. What do you think?
Thanks,
Peter
DrawProblem.root (49 KB)