I have maybe a problem with TTree::GetEntries() method.
If I plot a branch (“branch1”, for example) with StartViewer and then I get the Entries of this histo, I’ll find a different value from that coming out from t1->GetEntries(“branch1”) method.
Where is the problem??
I hope I’ve explained my trouble in the right way.
This might be the excepted behavior if the branch is actually holding a container that hold more than one value per TTree entry. To assert if there is a problem please provide the 2 numbers you are getting, the name of the branch you are looking at and the result of t1->Print();
So indeed this is the expected behavior . enfus6 is a variable size array:
t1->GetEntries(“enfus6”) counts the number of entries in the TTree where the array has one of more element that is non zero. Drawing enfus6 will plot an histogram which all the elements including the one that are zero. (I.e. the number of value in the histogram is Sum(mulfu6+1) over the entries which the result of GetEntries).
Maybe I’ve understood the difference between the two entries.
But now I’m not so sure about the truth … i.e., if I should use a value, which of the them is the right?
Maybe my question is not comprehensible and/or correct.
[quote]But now I’m not so sure about the truth … i.e., if I should use a value, which of the them is the right?[/quote]It depends of course of what you are trying to get at. Both function work correctly but have different semantic and intent.
So the question, what number are you interested in (semantically) …