Hello,
Sorry if this is a repeated question, but I have been unable to find an answer in the forums. I am attempting to write a 3D vector or array into a TTree using c++, then read it back using python. A vector would be preferable, but I can also live with arrays if it is necessary.
I’ve tried several things so far. Writing a 3D vector using c++ seems to be supported for int/doubles after adding the appropriate dictionaries, though not for unsigned integers. But for each TTree->Fill() called, the new 3D vector entry does not have the updated values, but only repeats the initial values from the very first call. I find that this is not the case with 2D or 1D vectors, but only with 3D vectors. If I can properly write a 3D vector to a TTree, I will be able to succesfully read it in python by looping over events in Tree (vectors don’t appear to suffer from the recent “TypeError: attempt to bind ROOT object w/o class”)
If I need to use 3D arrays, I am having trouble reading them in pyroot. When doing a for loop over events in the tree,the object suffer from the recent TypeError problem. Can I set up a three dimensional array.array or numpy.array which will allow me to read in 3D arrays from a ttree?
Thanks for your help,
Jeff