I have created a root tree. There are 5 members in the tree and the filled are data of information of particles like mass(A),charge number(z),neutron number(n) and the production cross section(sigma) of them.

The names of branches are na,nz,nn and sigma and error.

Now i’d like to add all the cross sections of particles with the same neutron number. I plot the 2D histogram of “sigma vs nn” with the cut “nn=40”(just as example). How can i get the cross section values of each particle with different charge number and add them up?

I’ve been puzzled for a few days and hope to be helped.