If I std::cout these values, they look fine. However, when I write them to a branch and try to draw, the histogram shows only values of 0. The same information written to a 1D array works fine. Does anyone know why 2D array branches won’t fill properly?
The leaflist branch creation technique (the one you used) only support one variable array dimension. Instead you will either need to store a 1D array (and address it as a 2D array) or use a std:vector<std::vector > (for which you will need to provide a dictionary).
Thanks for your reply. This seems to work. But now I am trying to read this information into a small tree. After setting the branch address, I assume I can read the information with the syntax
I seem to be having trouble properly accessing the 2D vector elements I previously wrote to a tree. I tried using the method
,where my event loop is over the exact same variables as I did to fill the original vector,
but if I cout << myMuon_eta << endl;, the output is garbage and doesn’t agree with the original eta distribution that I am trying to read in.