I wish to set up a Geant4 simulation that does the following. I want to have gamma rays, the number and energy of which I can specify and vary, strike a very thin layer of a high-Z material, such as a lead or a gold foil. For my output, I am interested in the following. First, I would like to have a visual display of the events. I want this visual display to feature a tracker-like detector that shows the tracks of the secondary particles produced by the gamma ray interactions with the thin layer of high-Z material. Second, I would like to have the energy and momentum (magnitude and azimuthal direction) of the secondary particles outputted into histograms that I can see in a .root file.
I am fairly new to Geant4. For the past several weeks I have been working with Geant4 examples. I have been making various edits to them, and asking for help on this forum when I need it. I think Basic Example B2a has the general setup that I need. However, B2a does not generate output on secondary particles produced from the initial interactions of the gamma rays from the lead layer, and display that output on Root histograms. I know that some other examples like Basic Example B4 have .root output files that include histograms. However, after studying the coding in the “src” and “include” files/macros, it is not evident to me how to make Basic Example B2a do this. Does anybody on this forum have any guidance on how to go about this, or if there is a better approach to what I discussed in the previous paragraph?