Reading end-branches into ints

Hi,

I’m pretty new to C++ and ROOT.

In the program VMM2.C I open the root file Run2.root. Run2.root has a tree, VMM_data with several end-branches (these show up as leaves on the TBrowser, screenshot attached as Run2.root is too big to upload). My goal is, for every entry in the tree, to read each branch into an int (i.e. the branch MMFE8 reads into Int_t mmfe8). In the header file beam2.h I set the branch addresses, and in the VMM2.C function Loop I load the tree and get its entries using the GetEntry function, but these entries do not read into the variables I have specified for them in beam2.h.

Anyone have a clue as to why?
beam2.h (5.07 KB)



VMM2.C (4.06 KB)

may be this can help:
root.cern.ch/doc/master/treegetval_8C.html

Thank you so much!