Printing Excitation functions from libraries

Hi All,
I’m new to Geant4, and I would think this should be simple, but I have not been able to figure out how to complete it.

I am using the QGSP_BIC_HP library, and want to be able to pull out and print the excitation functions of certain isotopes for protons and alphas on various target types. In other words, I would like to start by reproducing this plot of protons on Thorium:

I have been able to print out the inelastic, elastic, and total cross sections by opening the .z files in TENDL, but have not figured out how to print the fraction of the cross section which produces specific isotopes.

Thanks for your help!