Hello, is there any reason that I get a different plot when I do
and
?
A and B are attached to the TTree like that
t->Branch("B",&B,"B/I");
t->Branch("A",A,"A[B]/I");
Previously A is declared as “int A[24] = { 0 };” where 24 is the maximum value of B.
Currently, I have much less events when I draw my data with the “first” Draw method (t->Draw(“Y:X”,“A[1]==2”,“col”)) compared to the second one (t->Draw(“Y:X”,“A[B]==2 && B==1”,“col”)) (a bit less than 100 times less).
Sorry if it is a stupid question but I do not understand what happen.
To illustrate my purpose, you can get the run that I attached in [url=https://root-forum.cern.ch/t/different-plot-with-exactly-the-same-command/16557/1 post[/url].
If I type
t->Draw("DE1>>h1","iRing_DE1[ringtouche_DE1]==4 && ringtouche_DE1==1","")
t->Draw("DE1>>h2","iRing_DE1[1]==4","")
I get two different plots
When you use iRing_DE1[1], you get entries whenever ringtouche_DE1>1, while the first command should have returned no values (i.e. it is a bug it returns anything).
I think what you meant may have been:t->Draw("DE1>>h1","iRing_DE1[ringtouche_DE1-1]==4 && ringtouche_DE1==1","")ort->Draw("DE1>>h1","iRing_DE1[ringtouche_DE1-1]==4 && ringtouche_DE1==2","")
So it turned out to be the same problem you encountered in [url=https://root-forum.cern.ch/t/different-plot-with-exactly-the-same-command/16557/1 post[/url]. i.e. some more bound checks in TTree::Draw were missing making it draw random data if the value of the index was exactly the size of the array. This has been fixed in the trunk.