[Root_list] problem compiling
Carlos Ayerbe
gayoso at jlab.org
Tue May 3 22:16:39 EDT 2016
Dear JLab-rooters
I need some help to understand what is the problem reading the variables from a root file through compiled code.
In the folder below is the code with the rootfile I'm using. In principle it compiles well, it runs without any apparent issue, but the values are incorrect.
https://drive.google.com/open?id=0BzMLOCd9ntumQWtha25aVHlicUk
The content of the rootfile is only space variables, the event number and the number of hits in such event.
You can see with a simple scan or show the content of the rootfile, and the code skips the X value and writes to the Y value, and Y to Z. I started setting the definition of the branch variables in the header, but I found that makes the event values behave weird, so I set it as global variable. With the space variables (X, Y, Z), there is no easy solution and they are the ones making problems. They doesn't work properly in the header neither as global, but if I set them inside the function the code behaves even more weird. There is a loop where I get the entries, with the variables defined in the function (e.g. after the TTree declaration), the index enters the GetEntry method as normal, but after it the index goes crazy.
I compared this case with other examples I have and I don't see why this happen. Is because the use of the header?
Thank you for your time
Carlos Ayerbe
More information about the Root_list
mailing list