Bad values from GetV1()

Dear ROOTers,

I wonder why GetV1() stored vector stores different values depending on the number of entries read:

root [1] tevent->Draw("photon_count_data", "Entry$<=2000", "goff")
(long long) 4610304
root [2] auto v = tevent->GetV1()
(double *) @0x7fff15fd1068
root [3] v[0]
(double) 5.0000000
root [4] tevent->Draw("photon_count_data", "Entry$<=10", "goff")
(long long) 25344
root [5] v[0]
(double) 1.0000000


photon_count_data : photon_count_data[1][1][48][48]/F 

In general when I draw the array, I can see that the data is not rubbish, but it is somehow shifted. I’ve tried SetEstimate(-1), but it caused even more problems…

ROOT Version: 6.20.06
Platform: Fedora 31
Compiler: Not Provided

Maybe @pcanal has an explanation

OK, I’ve solved the problem. TTree::SetEstimate(-1) does not work for arrays. For srrays it should be SetEstimate(GetEntries()*size_of_array), kind of logical. It would be nice if you could update SetEstimate(-1), although I am not sure how (-1 meaning the nuber of cells in the biggest array in the tree times the number of entries?), but if it is impossible, perhaps just the docs?

Problem description (more than 5 years old):

Possible solutions:

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