SPENVIS Integral vs Differential Data for User-Defined Histograms/Arbitrary Point-Wise Spectrum?

Hello,

I’m using the /gps/hist/point (E_hi) (Weight) command to generate an energy distribution from SPENVIS for a space-radiation application. Since my text files from SPENVIS provide several data point pairs of incident radiation energy and particle flux (see example below), then I believe that I should use /gps/ene/type Arb (arbitrary point-wise energy spectrum) instead of /gps/ene/type User (User-defined energy histogram). However, I’m not sure what type of particle flux I should use for the “Weight” in /gps/hist/point (E_hi) (Weight).

  1. If I’m irradiating a material using /gps/ene/type Arb, does Geant4 randomly select an energy within the energy bounds that I provide in /gps/hist/point according to the weights that I assign to it? If I use /gps/hist/inter Lin, does Geant4 linearly interpolate the energy and weight of the data points in between the ones that I specify using /gps/hist/point?
  2. Should the “Weight” in /gps/hist/point (E_hi) (Weight) be differential particle flux (cm^-2 s^-1 MeV^-1) or integral particle flux (cm^-2 s^-1)? I think the Geant4 GPS documentation says that both the /gps/ene/type User and /gps/ene/type Arb commands require the user to list the differential energy data points via /gps/hist/point (E_hi) (Weight).

Electron Energy Spectrum from SPENVIS
/gps/ang/type planar
/gps/pos/type Plane
/gps/pos/shape Circle
/gps/pos/centre 0 0 20 cm
/gps/pos/radius 1 cm
/gps/particle e-
/gps/ene/type Arb
/gps/ene/diffspec 1
/gps/hist/type arb

/gps/hist/point 0 0
/gps/hist/point 0.04 302130
/gps/hist/point 0.1 185300
/gps/hist/point 0.2 80335
/gps/hist/point 0.3 39246

/gps/hist/point 6 0.03089
/gps/hist/point 6.5 0
/gps/hist/point 7 0
/gps/hist/inter Lin

1 Like
  1. Yes, and yes. If your physics behind the spectrum is some power-law-generating one, I recommend using Log interpolation to avoid funny bumps in the approximated spectrum.
  2. You have /gps/ene/diffspec 1, and it tells Geant4 that the spectrum is differential. Points must be in differential units.
1 Like

Differential spectrum is also the default option (i.e., if you do not specify /gps/ene/diffspec, it assumes to be True).

1 Like

Thank you, this helps a lot! The integral and differential energy spectra that I got from SPENVIS for electrons is shown below. I think I’ll start with a linear interpolation first and I’ll see if that yields satisfactory results before moving on to one of the other interpolation options if needed.

Try plotting a linear interpolation, e.g., in Python, and see what you get in a log-log plot. I do not recommend the linear one unless for a first try.

Thank you for the suggestion! I used MatLab to plot a linear interpolation for an example of an electron and proton energy spectrum that I get from SPENVIS. In the plot below, I arbitrarily chose a 0.5 MeV step size for the interpolation of each spectrum. Of course, if I lower the step size then I get better agreement between the interpolation curves and the data points marked using asterisks (*), and worse agreement when I increase the step size.

By chance, is there some document that discusses the step size/resolution/number of points that Geant4 uses to perform its linear interpolations?

Geant4 goes from point to point. The plots you show are not linear interpolation but rather some running averaging and intelligent smoothing. Interpolation must go through all points of data.