Compton Scattering of Deexcitation-Line and Continuum Gamma Rays in Solar Flares

Measurements of solar-ﬂare electron-bremsstrahlung X-rays are affected by Compton scattering in the solar atmosphere of the downward-directed radiation. Here we study how Compton-scattered and energy-degraded radiation from nuclear-deexcitation gamma-ray lines and continua affect the measurements of the gamma-ray radiation. Deexcitation-line photons with trajectories directed away from the Sun escape without signiﬁcant interactions even for ﬂares at the limb. We calculate the Compton-scattered component spectrum from downward-directed deexcitation lines for typical solar-ﬂare accelerated-ion kinetic-energy spectra. The scattered component only a makes a signiﬁcant contribution to the emerging spectrum at energies below ≈ 600 keV and is most prominent for ﬂares occurring near the center of the solar disk. We study Reuven Ramaty High Energy Solar Spectroscopic Imager (RHESSI) spectra obtained from the 28 October 2003 disk-centered ﬂare when the electron-bremsstrahlung contribution was relatively weak. We ﬁnd that inclusion of the scattered component does not signiﬁcantly affect any of the derived ﬂare parameters. This is true, in part, because the scattered component is not detectable over the signiﬁcant RHESSI detector count continuum due to partial energy depositions of higher-energy solar photons. The scattered component may affect ﬂare spectral measurements obtained with gamma-ray detectors having a more “diagonal” response. 11:18:20 UT with calculated components representing all of the sources of gamma rays in ﬂares: bremsstrahlung of ﬂare-accelerated electrons, deexcitation lines, the 511 keV positron-annihilation line and its associated positronium continuum, the 2.223 MeV neutron-capture line (and its solar Compton-scattered con-tinuum), and pion-decay emission at higher energies. For the deexcitation lines, we ﬁt the observed spectrum using calculated spectra with and without the scattered component. The ﬂare occurred near disk-center at θ obs = 18 ◦ .


Introduction
In the standard model of solar flares (see, e.g., Shibata, 1996), electrons and ions are accelerated via magnetic-field reconnection near the tops of closed magnetic loops. These energetic B R. Murphy ronald.murphy@nrl.navy.mil G. Share share@astro.umd.edu particles travel down the loop legs and interact with material at the loop footpoints, typically at chromospheric and photospheric densities, to produce observable nonthermal radiation via several processes. The accelerated electrons produce X-and gamma-ray bremsstrahlung. Nuclear reactions of the accelerated ions produce excited and radioactive nuclei, neutrons, and pions, all of which produce secondary gamma rays. Positively charged pions and some radioactive nuclei decay by producing positrons that slow down and annihilate with ambient electrons to produce the 511 keV positron-annihilation line and the associated positronium continuum. Neutrons with trajectories oriented into the Sun slow down and can be captured on photospheric hydrogen, yielding deuterium, with the binding energy appearing as the 2.223 MeV neutron-capture line. The excited nuclei promptly ( one second) deexcite to produce gamma-ray deexcitation lines, mostly at energies from 0.5 to 10 MeV, which can make a significant contribution to flare radiation in this energy range. In this article we consider Compton scattering in the solar atmosphere of these nuclear deexcitation-line photons.
Solar-flare produced photons with trajectories directed toward the Sun may Compton scatter (perhaps several times) with free or atomic electrons in the solar atmosphere, reducing their energy. In addition, flare photons (and scattered photons) with energies above the pair-production threshold energy of 2m e c 2 = 1.022 MeV (where m e c 2 is the rest-mass energy of the electron) can produce positrons and electrons that then produce lower-energy bremsstrahlung. The positrons annihilate with ambient electrons to produce 511 keV photons and the positronium continuum. If the trajectory of any of these secondary photons is away from the Sun, it may escape, but with an energy significantly lower than that of the original photon. The radiation leaving the Sun from a flare will therefore be composed of photons both from the source and from scattering. Compton-scattered radiation has been referred to as "albedo", although, strictly speaking, albedo refers to reflected radiation, whereas Compton-scattered radiation is "reprocessed".
Compton scattering of X-ray bremsstrahlung from flare-accelerated electrons was considered previously (see, e.g., Tomblin, 1972;Santangelo, Horstman, and Horstman-Moretti, 1973;Bai and Ramaty, 1978;Kontar et al., 2006Kontar et al., , 2011. Unless the scattered source and the primary source can be spatially resolved, this additional lower-energy radiation can substantially affect the precise position, source size, and spectrum derived for the X-ray source (see, e.g., Bai and Ramaty, 1978;Kontar and Jeffrey, 2010). Because flare-accelerated electron kinetic-energy spectra are typically steep, below about 500 keV the electron bremsstrahlung itself dominates any scattered radiation from higher-energy photons. Studies of electronbremsstrahlung Compton scattering have therefore concentrated on photon energies below those of most deexcitation lines.
Using a magnetic-loop transport and interaction model (see Section 2.1 below), Hua, Ramaty, and Lingenfelter (1989) calculated the depths in the solar atmosphere where excited nuclei are produced. Because the lifetimes of the excited nuclei are so short, the emission of the deexcitation gamma ray occurs at essentially the same position as production of the excited nucleus. The authors showed that for flares located on the visible solar disk, deexcitation-line photons leaving the production site toward Earth are not significantly attenuated by Compton scattering. Attenuation is only significant when the flare is located beyond the solar limb. For flares occurring on the solar disk, the observed deexcitation-line spectrum will therefore be composed of two components: a component of photons nearly identical to the production spectrum originally emitted toward Earth, and a component of scattered photons of reduced energy.
Gamma-ray line spectra expected from ion interactions in solar flares calculated with a deexcitation-line production code (see Section 2.2 below) have been used to interpret data obtained with several gamma-ray instruments. However, those calculations did not include the scattered component. Here, we use the Monte Carlo N-Particle Transport Code (MCNP6) to calculate this component (see Section 4), extending our understanding of Compton scattering of flare electron bremsstrahlung to scattering of nuclear deexcitation lines. We show how this component depends on the location of the flare on the solar disk relative to the line of sight and on parameters associated with the accelerated ions and the magnetic loop. We determine if it is detectable with current instrumentation and how it may impact fits to observed solar-flare spectra.
In addition to changing the direction and energy of a photon, Compton scattering also changes its polarization, and the scattered component can be polarized even though the primary photons are not. Polarization measurements have the potential for providing information about the angular distribution of the radiation and hence the radiating particles. Because the detected radiation is a combination of the primary and scattered sources, however, interpretation is difficult unless the two sources can be spatially resolved. Electronbremsstrahlung polarization measurements have been reported, but their interpretation has been inconclusive. In nuclear reactions producing excited nuclei, the emitted gamma ray can be polarized, and Compton scattering will introduce additional polarization. To our knowledge, there have been no calculations of deexcitation-line polarization in solar flares nor any attempts to measure it, and we do not consider it in the calculations presented here.
In Section 2 we discuss the loop-transport model and the deexcitation-line production code, and in Section 3 we discuss Compton scattering. In Section 4 we describe our use of the MCNP6 code, and in Section 5 we present the results of the MCNP6 calculations of the scattered deexcitation-line component. In Section 6 we discuss the detectability of the scattered radiation and its impact on determination of the various parameters associated with solar flares. We find that the inclusion of the scattered component does not significantly affect any of the flare parameters derived from spectra obtained with an instrument such as the Reuven Ramaty High Energy Solar Spectroscopic Imager (RHESSI) having a strong off-diagonal detector response (see Section 6.1). In Section 7 we summarize and provide a discussion. Finally, we provide an Appendix validating our calculations by comparing with previous calculations of Compton scattering using other techniques.

Production and Characteristics of Nuclear Deexcitation-Line Gamma-Ray Emission
In the loop model, deexcitation-line gamma rays are produced by energetic ions accelerated at the top of a magnetic loop and transported down the loop legs to depths where they interact. We discuss the model and how it determines both the depth in the solar atmosphere where the excited nuclei are produced and the angular distribution of the accelerated ions when they interact (Section 2.1). We then discuss the nuclear deexcitation-line gamma-ray spectrum, focusing on aspects most relevant to transport of the gamma rays through the solar atmosphere (Section 2.2).

Ion Transport and Interaction in Magnetic Loops
Hua, Ramaty, and Lingenfelter (1989) developed a Monte Carlo loop-transport and nuclearinteraction model consisting of a semicircular coronal portion and two straight portions extending vertically from the ends of the coronal portion through the transition region, the chromosphere, and into the photosphere. Below the coronal portion, the number-density height profile of the atmosphere is the sunspot active-region model (Avrett, 1981) merged with a photospheric model (Allen, 1963) at depths > 120 km. Zero-depth is where the optical depth for 500 nm continuum radiation is unity. In this atmosphere, the bottom of the coronal portion (the transition region) occurs at −1800 km. This density profile is plotted in Figure 1, and we also use it for the MCNP6 scattering studies presented below. The magnetic field is assumed constant in the corona. Below the corona, the magnetic-field strength is assumed proportional to a power [δ] of the pressure (Zweibel and Haber, 1983). The model accounts for ion energy losses due to Coulomb collisions, ion removal by nuclear reactions, magnetic mirroring of the ions in the converging flux tube, and pitchangle scattering (PAS) of the ions due to magnetohydrodynamics (MHD) turbulence in the corona. PAS is characterized by : the mean free path required for an arbitrary initial angular distribution to relax to an isotropic distribution. The dependence of on particle energy is expected to be weak (see discussion by Hua, Ramaty, and Lingenfelter, 1989) and is assumed to be independent of energy.
In the simulation, accelerated ions having a given kinetic-energy distribution are released isotropically at the top of the loop into the left and right loop legs. An isotropic acceleratedion angular distribution would be expected from stochastic acceleration, for example. Each ion is followed until it either interacts or its energy falls below the threshold energy for deexcitation-line production. The ions typically interact near the loop footpoints in the chromosphere or upper photosphere where the density is sufficient for an efficient nuclear interaction rate. When an interaction occurs, the location along the loop and the direction of motion of the ion are recorded.
Although the ions are released isotropically at the top of the loop, their angular distribution when they interact near the footpoints is determined by the magnetic-field convergence [δ] and the level of PAS [ ]. With no magnetic-field convergence [δ = 0], the interactingion angular distribution will be downward isotropic and remains downward isotropic in the presence of PAS [ < ∞]. A converging magnetic field [δ = 0] results in mirroring of the accelerated particles and an interacting-ion angular distribution that is peaked parallel to the solar surface; i.e. a "pancake" distribution. Increasing PAS repopulates the loss cone and results in more downward-directed interacting ions. The interacting-ion angular distribution is not affected by the steepness of the accelerated-ion kinetic-energy spectrum.
We note that the downward-isotropic interacting-ion angular distribution resulting from δ = 0 is reasonable for consideration, because redshifts of the nuclear deexcitation-line centroid energies measured (Share et al., 2002) with the Gamma Ray Spectrometer (GRS) of the Solar Maximum Mission (SMM) for flares located at various heliocentric angles are consistent with such a distribution. Some other angular distributions can be ruled out by such measurements. For example, the pancake distribution resulting from strong magnetic convergence would produce no significant redshifts for a disk-centered flare, inconsistent with the measurements. (Similarly, an isotropic distribution can be ruled out; such a distribution for the interacting ions is not possible within the loop model.) For the calculations that follow, we assume δ = 0, resulting in a downward-isotropic distribution. Although actual interacting-ion angular distributions may not be truly downward-isotropic, they must at least be similar in order to produce the observed red shifts, and the general conclusions reached here would be unchanged.
The recoil velocities of the excited nuclei are sufficient to produce Doppler broadening of the lines and Doppler shifts of the line centroids from the assumed downward-isotropic distribution for flares located away from the solar limb. However, they are too low to produce significant anisotropic gamma-ray emission due to relativistic Doppler beaming for expected interacting-ion angular distributions. The emission intensity will be significantly anisotropic only if the ions are strongly beamed, which is unlikely for solar flares. For the downward-isotropic angular distribution, the difference in intensity in the downward and upward directions is about 4% for an ion power-law index s = 2 and less for steeper indexes.
The depth in the solar atmosphere where the accelerated ions interact to produce the excited nuclei depends not only on the magnetic convergence and level of PAS, but also on the steepness of the accelerated-ion kinetic-energy distribution. Stronger convergence produces production-depth distributions higher in the solar atmosphere, and increasing PAS moves the distribution deeper. A flatter ion spectrum results in more interactions involving higher-energy ions, which, due to their longer ranges, tend to occur deeper in the atmosphere than those for steeper ion spectra.
This can be seen in Figure 2. We assume that the accelerated-ion differential kineticenergy number spectrum is an unbroken power law in energy (per nucleon) with spectral index s [i.e. dN/dE ∝ E −s ion ]. Production-depth distributions (see also Murphy et al., 2007) for a typical deexcitation line (here, the 4.438 MeV 12 C line) are shown for no convergence [δ = 0; downward-isotropic interacting ions] and ion power-law spectral indexes s = 2, 3, 4, 5, and 6. Additional horizontal axes at the top of the figure show the atmosphere density and vertical overlying integrated density corresponding to the x-axis depths. The dashed-vertical line is the top of the photosphere at −320 km.
The calculation includes all proton and α-particle reactions leading to the 12 C excited state, both inelastic reactions with 12 C and spallation reactions with heavier nuclei. Spallation-reaction cross-sections tend to have higher threshold energies, peak at higher energies, and extend to higher energies. As a result, spallation reactions occur somewhat deeper in the solar atmosphere than inelastic reactions. Because of their similar production cross-sections, the production-depth distributions of most other deexcitation lines are similar.
We investigated the impact on the production-depth distribution due to angular distributions other than isotropic for the ions released at the loop top. We considered two extreme cases: i) ions that are strongly beamed along the loop axis, and ii) ions distributed uniformly perpendicular to the axis. We found that the peak of the depth distributions shifted by no more than 100 km deeper and shallower, respectively. Such a shift is not sufficient to significantly modify the photon spectra leaving the Sun calculated here for the isotropic assumption.
Although we here assume a power law, other energy distributions for the flare-accelerated ions have been considered. However, because the cross-sections for most deexcitation lines peak in a narrow energy band of a few tens of MeV, the small differences within this band Figure 2 Depth distribution for production of excited 12 C nuclei in the solar atmosphere (solid curves). The loop magnetic convergence δ = 0, and there is no PAS. Distributions are shown for accelerated-ion power-law spectral indexes s = 2, 3, 4, 5, and 6, normalized to unit yield. The additional horizontal axes at the top of the figure show the atmosphere density and vertical overlying integrated density corresponding to the x-axis depths. Also shown is the depth distribution for capture of neutrons on hydrogen (dotted curve; see Appendix A). of the energy dependences of other energy distributions will have little impact on the resulting production-depth distribution. All physically reasonable spectral shapes will produce depth distributions that fall within the range of depths resulting from the power-law indexes considered in Figure 2.

Deexcitation-Line Gamma-Ray Spectrum
The comprehensive treatment of nuclear deexcitation-line emission given by Ramaty, Kozlovsky, and Lingenfelter (1979) provides the means for understanding solar-flare deexcitation-line observations. They developed a Monte Carlo-based computer code to calculate the gamma-ray spectrum expected from thick-target interactions of flare-accelerated ions for assumed ambient and accelerated-particle compositions and accelerated-particle energy spectra and angular distributions. The required line-production cross-section data are obtained from laboratory measurements, nuclear reaction codes, and empirical rules. The code has been continuously updated with improved cross-section data and new reactions (e.g. Kozlovsky, Murphy, and Ramaty, 2002;Murphy et al., 2009;Murphy, Kozlovsky, and Share, 2016). It includes more than 190 lines from more than 300 proton, 3 He, and α-particle reactions with the most abundant elements in the solar atmosphere.
The reactions of the lightest projectiles (protons, 3 He, and α-particles) with heavier elements are referred to as "direct". Because the kinetic-energy spectra of flare-accelerated ions are steep and the production cross-sections for most deexcitation lines peak at ion energies of a few tens of MeV, the recoil velocities of the excited nuclei are relatively low. Direct reactions therefore produce relatively narrow Doppler-broadened lines, with a fractional FWHM of ≈ 2% for isotropic interacting ions. Flatter ion spectra result in more interactions involving higher-energy ions, and the higher recoil velocities produce somewhat broader lines.
The code also includes the "inverse" reactions of accelerated projectiles heavier than αparticles with ambient H and 4 He. (Inverse reactions on ambient 3 He are not included due to the low abundance of 3 He in the solar atmosphere.) Because the excited nuclei retain  much of the heavy projectile velocity, inverse reactions produce relatively broad lines with a fractional FWHM of ≈ 20%. The gamma-ray "nuclear continuum" is also included in the code. Nuclear reactions produce thousands of lines, most of which are weak and closely spaced and are too numerous to be explicitly included in the code; they are included as a smoothly varying continuum (see Murphy et al., 2009).
In Figure 3 we show a representative deexcitation-line spectrum calculated with this code for a flare at disk center [θ obs = 0 • ], an accelerated-ion power-law spectral index s = 4, and a downward-isotropic interacting-ion angular distribution. Both the ambient and acceleratedion compositions are assumed to be coronal (Reames, 1995) and both the ambient 4 He/H and accelerated α/proton ratios are 0.1. The spectrum is normalized to one accelerated proton with energy greater than 30 MeV [N p (> 30 MeV) = 1]. The spectrum has been binned in energy channels appropriate for a high-resolution spectrometer such as RHESSI. It falls off rapidly above ≈ 8 MeV. The total spectrum (the black curve) is dominated by narrow lines produced by direct reactions. The excited nuclei responsible for some of the strongest narrow lines are indicated. Shown separately are the total nuclear continuum (from both direct and inverse reactions) and the inverse-reaction broad-line component (only the lines that are explicitly included in the code).
The recoil velocities of the excited nuclei are sufficient to produce measurable Doppler shifting of the deexcitation lines when the interacting-ion angular distribution is not isotropic. For example, for a downward-isotropic ion distribution, the line centroid of the 4.438 MeV 12 C narrow line is shifted to lower energies ("redshifted") relative to that from an isotropic angular distribution by an amount that depends on the ion spectral steepness and the location of the flare on the solar surface. For a flare observed at disk center and an accelerated-ion spectral index s = 4, the redshift is about 30 keV (a fractional shift of about 0.7%). The redshift decreases as the flare location approaches the solar limb. Flatter ion spectra result in more interactions involving higher-energy ions and higher recoil velocities and therefore higher redshifts.

Single Compton Scattering of Gamma-Rays
Compton scattering of a photon by an electron results in the electron being given part of the initial photon energy (causing the electron to recoil) and a photon with the remaining energy where ε i is the initial photon energy and θ s is the scattering angle; i.e. the angle between the incident and scattered trajectories.
Using the Klein-Nishina formula for Compton scattering (see, e.g., Lingenfelter and Hua, 1991), Figure 4 shows the angle-integrated photon, energy distribution from single Compton scattering of 4.438 MeV gamma rays (e.g. from deexcitation of excited 12 C nuclei). The spectrum is normalized to one 4.438 MeV photon. The scattered-photon energy is directly related to the scattering angle [θ s ] by Equation 1, and the dotted-vertical lines identify scattered-photon energies corresponding to various scattering angles. The spectrum extends down from a maximum energy at the initial photon energy of 4.438 MeV for θ s = 0 • (forward scattering), rising to a peak at the minimum energy of 240 keV that corresponds to the maximum possible energy loss at θ s = 180 • (backscattering). Figure 5 shows the same information for 511 keV gamma rays. Although not a deexcitation line, the 511 keV positron-annihilation line is an important solar-flare line.
In Figure 6, the final photon energy [ε f ] from single scattering is shown as a function of the initial photon energy [ε i ] for three scattering angles [θ s ]: 0 • (forward), 90 • , and 180 • (back). For θ s = 0 • , ε f = ε i (see Equation 1). As the initial photon energy increases, the minimum final photon energy (i.e. for 180 • backscattering) approaches the limit m e c 2 /2 = 256 keV. For initial photon energies from 0.5 to 10 MeV, the minimum final photon energy from single scattering varies only from about 170 to 245 keV. Figures 4 through 6 are used to interpret the scattered spectra from mono-energetic photons calculated with the MCNP6 code in Section 5.1.

Monte Carlo Modeling of Compton Scattering
To follow the propagation, interactions, and escape of flare photons with trajectories directed downward into the Sun, we used the Monte Carlo code MCNP6 (Pelowitz, 2013). MCNP6 is a general-purpose code that can be used for neutron, photon, electron, or coupled neutron/photon/electron transport. For photons, the code accounts for incoherent and coherent scattering, the possibility of fluorescent emission after photoelectric absorption, and absorption in electron-positron pair production, including the subsequent production of 511 keV photons due to positron annihilation with ambient electrons.
We chose MCNP6 because it can use variance-reduction techniques to significantly reduce computer run times. To further reduce run times, we ran MCNP6 with MODE P so that secondary electrons were not explicitly followed, but only a thick-target bremsstrahlung spectrum was calculated for each. We ran MCNP6 with and without this approximation and found no noticeable difference in the calculated spectra leaving the Sun for the photon energies being considered.
We constructed a spherical, full-scale model solar atmosphere assuming the same Avrett-Allen density profile used for the loop-transport code (see Section 2.1 and Figure 1). (The solar radius corresponding to zero depth of Figure 1 is 6.967 × 10 5 km.) We assumed photospheric elemental abundances given by Anders and Grevesse (1989) except for 4 He/H = 0.1; other than 4 He/H, the precise ambient composition assumed does not significantly affect the results because of the low relative abundances of the heavier elements. Photons sampled from gamma-ray line spectra calculated with the deexcitation-line code (see Section 2.2 and Figure 3) were released isotropically from points distributed along a solar radius with rela-tive intensities given by production-depth distributions as calculated with the loop-transport code (see Section 2.1 and Figure 2). (As discussed in Section 2.2, deexcitation-line emission is essentially isotropic for any realistic interacting-ion angular distribution.) Gammaray spectra leaving the Sun were recorded at various angles relative to the normal to the solar surface at the flare site; these angles correspond to flare heliocentric angles [θ obs ] as observed from Earth.
We used production-depth distributions associated with anisotropic interacting-ion angular distributions. Such anisotropic distributions result in deexcitation-line Doppler broadening and centroid-energy redshifts that depend on the angle between the line of sight and the flare axis. We should therefore release photons sampled from deexcitation-line spectra calculated as a function of this angle. However, the scattered component, as we show below, is significant only below several hundred keV and results from scattering of higher-energy photons. It is not sensitive to the spectral details of these photons, but only to their intensity, which, as noted in Section 2.2, does not vary significantly with angle. Therefore, releasing the same deexcitation-line spectrum at all angles will produce no significant error in the scattered component.

Results
We describe the results of our Monte Carlo studies of Compton scattering of the nuclear deexcitation-line spectrum using MCNP6. To better understand the scattered spectrum resulting from release of the full spectrum of deexcitation-line gamma rays (Section 5.2), we first study in Section 5.1 the scattered spectrum resulting from release of mono-energetic photons. We describe how several features in the scattered spectrum arise and show how the scattered spectrum varies with flare observation angle and the production-depth distribution of the gamma-ray release. In the Appendix, we demonstrate the validity of our method by comparing our results with those obtained using other methods.

Compton Scattering of Mono-energetic Photons
In Section 5.1.1 we study in detail Compton scattering of 4.438 MeV photons, and in Section 5.1.2 we study photons of other energies.

4.438 MeV Photons
Using the MCNP6 code, we released 4.438 MeV photons using the production-depth distribution shown in Figure 2 for accelerated ions with a spectral index s = 4 and no magnetic convergence [δ = 0]. In Figure 7 we plot the calculated total photon spectra at Earth for flares occurring at several observation angles [θ obs ]. The calculation is normalized to one released 4.438 MeV photon. We discuss the unscattered (but possibly attenuated) line component at 4.438 MeV, the complex scattered component, and the impact of different production-depth distributions.   Figure 7 by the red arrow on the right.
The line can also be attenuated for disk flares if the accelerated-ion spectrum is sufficiently flat so that production occurs deep in the atmosphere (see Figure 2). This is shown in Figure 8, where we plot the ratio of the escaping line fluence to what the line fluence would be with no attenuation (i.e. the "escaping fraction") for a disk flare [θ obs = 0 • ] as a function of the accelerated-ion power-law spectral index [s]. For the production-depth distribution for s = 4, ≈ 99% of the released photons escape without interaction for the disk flare. For depth distributions associated with typical solar-flare spectral indexes [3 < s < 5], the escaping fraction is never lower than 97%. Even for the s = 2 depth distribution, the escaping fraction has fallen only to 85%. Therefore, for a disk flare, the column densities overlying the production depths for typical flare accelerated-ion spectral indexes are not sufficient to significantly attenuate deexcitation-line photons by Compton scattering.
Attenuation only becomes significant for flares near the solar limb. Figure 9 shows the escaping line fluence for flares occurring near the limb relative to the escaping line fluence for a disk flare [θ obs = 0 • ] as a function of flare observation angle [θ obs ] for production-depth distributions associated with ion spectral indexes s = 2, 3, 4, 5, and 6 (see Figure 2). For the s = 4 depth distribution, this additional attenuation of the line for a limb flare [θ obs = 90 • , indicated by the dashed vertical line] is less than 15%, and it is less than 40% for a flat spectrum of s = 3. Beyond the limb, the fluence decreases rapidly. From Figures 8 and 9, we conclude that for typical solar flares with 3 < s < 5, the overlying atmosphere is not sufficient to significantly attenuate deexcitation-line photons for flare locations up to about θ obs = 90.5 • . Deexcitation-line emission may be detectable even for flares near θ obs = 92 • .
For comparison with previous calculations, we calculated using MCNP6 the escaping fluence of the 4.438 MeV line using the production-depth distribution employed by Hua,  Ramaty, and Lingenfelter (1989) for δ = 0 and accelerated ions having a Bessel-function kinetic-energy spectrum with spectral parameter αT = 0.02 (see their Figure 11). We plot the resulting relative fluence also in Figure 9 (dotted curve) along with the relative fluence calculated by Hua, Ramaty, and Lingenfelter (1989) (dashed curve) taken from their Figure  16. The agreement is quite good. Figure 7, the Comptonscattered spectrum from 4.438 MeV photons is complex and shows an evolving pattern with heliocentric angle. At energies above ≈ 240 keV, the spectra can be explained primarily by single-scattering of 4.438 MeV photons and resemble the spectrum shown in Figure 4. They exhibit the 240 keV 180 • backscatter peak of 4.438 MeV photons but decrease rapidly above "cutoff energies" that increase as the flare location approaches the solar limb. These  Hua, Ramaty, and Lingenfelter (1989). The dotted curve shows the relative fluence calculated with MCNP6 using the production-depth distribution for δ = 0 and accelerated ions having a Bessel-function kinetic-energy spectrum with spectral parameter αT = 0.02 (see text). The red arrows represent photons emitted from each flare site having trajectories toward the Earth. As discussed above, only few of these photons will Compton scatter, and so they cannot contribute significantly to the scattered spectrum (see below for some exceptions).

The 4.438 MeV Photon-Scattered Component As shown in
Most of the photons below 4.438 MeV must therefore have original trajectories directed into the Sun, represented in Figure 10 by the blue arrow originating from the intermediate flare location with an original trajectory angle [θ 0 ] relative to the solar radius through the flare as shown. The probability for Compton scattering is significant only when θ 0 is less than π /2. Such a scattering event is shown at point "a". Here, the photon scatters with a scattering angle θ s so that its new direction, represented by the green arrow, is toward Earth. From the figure, θ obs + θ 0 + θ s = π , or θ 0 = π − θ obs − θ s . Because significant scattering only occurs when θ 0 < π/2, for a given θ obs , the possible scattering angles for photons scattering toward Earth on their first scatter are constrained: θ 0 = π − θ obs − θ s < π/2 or θ s > π/2 − θ obs . For the flare-observation angles of the spectra shown in Figure 7 [θ obs = 0 • , 30 • , 60 • , 75 • , 85 • , and 90 • ], the minimum scattering angles are therefore θ s > 90 • , 60 • , 30 • , 15 • , 5 • , and 0 • , respectively. The single-scattered photon energies associated with these angles are indicated in Figure 4 with dotted vertical lines.
We should therefore expect the single-scatter emission spectrum for a given θ obs to look similar to the spectrum of Figure 4 (reproduced as the dot-dashed curve with arbitrary normalization in Figure 7 for comparison) above the 240 keV 180 • backscatter energy, but end at the energy associated with the minimum scattering angle for that θ obs . The colored dotted vertical lines in Figure 7 identify this maximum energy for each θ obs plotted, and they agree well with the Monte Carlo calculated cutoff energies. The emission seen above each cutoff energy is due to those few photons with original trajectories directed away from the Sun [θ 0 > π/2] that do, in fact, scatter and have a final trajectory toward Earth. Photons with initial trajectory angles [θ 0 ] just slightly greater than π/2 (see Figure 10) are most likely to scatter since they will encounter the greatest optical depth for scattering. Their scattering angles [θ s ] toward Earth are therefore just slightly smaller than the minimum scattering angle [π/2 − θ obs ], and so their final scattered energies are clustered just above the cutoff energy.
As the flare location approaches the limb, the increasing optical depth in the direction of the Earth (see Figure 10) increases the probability for Compton scattering. A few photons originally moving away from the Sun but in directions nearly toward the Earth may be smallangle scattered into the direction toward the Earth with little loss of energy. This enhances the region just below 4.438 MeV over what would be produced by only single-scattering of photons originally directed into the Sun, as seen in the θ obs = 85 • and 90 • curves in Figure 7 (compare with the single-scatter spectrum shown in Figure 7 as the dot-dashed curve).
A 511 keV positron-annihilation line is seen in all spectra. This is due to pair production by both original 4.438 MeV photons and by photons scattered to lower energies (but still above the 1.022 MeV pair-production threshold energy). Below ≈ 500 keV, the scattered photon spectrum for θ obs = 30 • in Figure 7 exhibits some additional structure due to single-scattering of these 511 keV positron-annihilation photons. From Figure 6, the 180 • backscatter energy for 511 keV photons is 170 keV, and weak evidence for this peak can be seen in the spectrum at this energy. The cutoff energy for 511 keV photons at this observation angle (for θ obs = 30 • , θ s = 60 • ) is 340 keV (see Figure 5) and the falloff can be seen in the spectrum at this energy, just above the 240 keV 180 • backscatter peak for 4.438 MeV photons. The 170 keV 180 • backscatter peak for 511 keV photons can be seen more distinctly in the spectrum for θ obs = 0 • , but the cutoff energy for this observation angle is 252 keV (for θ obs = 0 • , θ s = 90 • ; see Figure 5), and so single-scattering of 511 keV photons contributes little to this spectrum above ≈ 250 keV. We note that this backscatter feature appears to extend to energies lower than the backscatter energy of 170 keV for 511 keV photons. This is due to backscatter peaks from the photons just below the cutoff energy of 458 keV (θ obs = 0 • , θ s = 90 • ) for 4.438 MeV photon single-scattering also contributing to the feature.
The 180 • backscatter peak at 240 keV from 4.438 MeV photons is such a strong "feature", especially for flares located near the solar limb, that evidence for single-scattering of these photons is also visible in the spectra from such flare locations. From Figure 6, the minimum 180 • backscatter energy of 240 keV photons is 124 keV, and this backscatter feature can be seen at this energy in the spectra for θ obs > 30 • .
At energies below 240 keV, the photons must be the result of multiple photon scattering because these energies are below the minimum 180 • -backscatter energy of single-scattered 4.438 MeV photons. The spectra for the various observation angles are similarly shaped with a peak at ≈ 25 keV. The intensity of this multiple-scatter component falls rapidly above ≈ 0.3 MeV. It decreases as the flare location nears the solar limb because of attenuation due to the increased optical path toward Earth.
In summary, for disk flares, the scattered emission is confined to below ≈ 600 keV, is strong relative to the line, and is dominated by photons from multiple scatters. As the flare location moves toward the limb, the intensity of the scattered component falls, but now single-scattering becomes relatively important, and the spectrum extends to higher energies. The energy of the upper edge of this single-scattered component (the cutoff energy) increases as the flare location approaches the limb, reaching the original 4.438 MeV photon energy for a flare at the limb.

Figure 11
Calculated photon spectra at Earth from 4.438 MeV gamma rays for a disk flare [θ obs = 0 • ] and a limb flare [θ obs = 85 • ] assuming production-depth distributions for no magnetic convergence [δ = 0] and accelerated-ion spectral indexes s = 2, 4, and 6 (see Figure 2). The arrows indicate the reduced fluences in the line for the s = 2 depth distribution at the two flare locations. The calculations are normalized to one released 4.438 MeV photon.

The Effect of Different Production-Depth Distributions on the Scattered Component
We wish to see the effect on the Compton-scattered component due to different productiondepth distributions for the source of the gamma rays. As discussed in Section 2.1, the depth distribution varies depending on the accelerated-ion spectral index and on the amount of magnetic convergence [δ] and PAS [ ] in the loop. We first discuss the effect of varying the spectral index. Figure 11 shows calculated total photon spectra at Earth from 4.438 MeV photons for a disk flare [θ obs = 0 • ] and a limb flare [θ obs = 85 • ] having no magnetic convergence [δ = 0] for three production-depth distributions of ions having spectral indexes s = 2, 4, and 6 (see Figure 2). For all limb flares and for disk flares with accelerated-ion spectral indexes [s] steeper than ≈ 3, there is no significant effect on the scattered spectrum caused by the different depth distributions. We find that when the peak of the production-depth distribution is above about −400 km (≈ 0.1 g cm −2 ; see Figure 2), the geometry is essentially equivalent to release of photons above an atmosphere, and so the scattered spectra are independent of the production depth for any flare location.
For disk flares with ion spectral indexes flatter than about s = 3, the region between the 4.438 MeV line energy and the cutoff energy (0.46 MeV for θ s = 90 • and θ obs = 0 • ; see Figure 4) becomes filled in with scattered photons. From Figure 2, the peak of the productiondepth distribution for s = 2 is below −400 km. At such depths, even photons with original trajectories away from the Sun undergo significant Compton scattering. (From Figure 9 we see that such deep depth distributions do result in attenuation of the line, and the red arrows in Figure 11 indicate the attenuated fluences of the line for the s = 2 distribution at the two flare locations.) Single Compton scattering toward the Earth of outward-directed 4.438 MeV photons reduces their energies and populates this energy region. As noted above, however, solar-flare accelerated ions typically do not have such flat kinetic-energy spectra.
Varying δ and PAS will change both the production-depth and the interacting-ion angular distribution. However, because the angular distribution of the deexcitation-line emission remains essentially isotropic regardless of the angular distribution of the interacting ions and the subsequent excited recoil nuclei (see Section 2.2), only the change in the productiondepth distribution will significantly affect the scattered spectrum. Magnetic-convergence mirroring [δ = 0] moves the depth distribution higher in the atmosphere, even higher than that for the s = 6 with δ = 0 distribution (see Figure 2). However, as discussed above, regardless of the details of the distribution, once its peak is above a depth of ≈ −400 km The calculations assumed the production-depth distribution for no magnetic convergence [δ = 0] and accelerated ions with spectral index s = 4 (see Figure 2). They are normalized to one released photon of each energy.
(≈ 0.1 g cm −2 ), the geometry is equivalent to release of photons above an atmosphere, producing essentially identical scattered spectra. Introducing PAS with δ = 0 does move the depth distribution deeper than without PAS, but the distributions become remarkably similar to those with δ = 0 for the same accelerated-ion index [s]. We therefore conclude that other assumptions for the loop magnetic convergence and the level of PAS will not change our results for typical solar flares.

Deexcitation Lines at Other Energies
To see how the scattered spectrum from photons of other energies behave, we show in Figure  12  no 511 keV positron-annihilation line, the spectra exhibit features similar to those of the higher-energy lines of Figure 12: a multiple-scattered component at lower energies and a single-scatter spectrum at higher energies extending up to the cutoff energy for the disk flare or the line energy for the limb flare.

Compton Scattering of the Deexcitation-Line Spectrum
From the above discussion of Compton scattering of mono-energetic photon release, we see that deexcitation-line photons observed at Earth from flares occurring anywhere on the solar disk [θ obs ≤ 90 • ] will be composed of two components: one with photons originally directed toward Earth that suffer little or no attenuation due to Compton scattering for typical solarflare ion kinetic-energy spectra, and one mostly with photons originally directed into the Sun that Compton scatter one or more times and then escape toward Earth with reduced energy. For photons having an original energy greater than ≈ 600 keV, the scattered component is significant only below about 600 keV for disk flares. For limb flares, the < 600 keV scattered emission is weaker, but the scattered emission continues in energy up to the energy of the original photon (see Figure 7). Photons (both original and scattered) having energies greater than ≈ 2 MeV will produce a significant 511 keV positron-annihilation line due to pair production (see below for comparison with the flare-produced 511 keV line).
Using MCNP6, we release photons sampled from the total deexcitation-line spectrum calculated for accelerated ions with a spectral index s = 4 and a downward-isotropic angular The spectra are normalized to one photon in the released spectrum and are binned into logarithmically constant bins larger than those of Figure 3. The black histogram is the spectrum released at the production site toward Earth. The red histogram is the total spectrum at Earth; i.e. it includes both the deexcitation-line spectrum released toward Earth (less any photons Compton-scattered to lower energy) and the scattered-component spectrum. The scatteredcomponent spectrum (defined here as the total spectrum less the released spectrum) is shown by the green curve.
For the disk flare, as expected from Panel a of Figures 12 and 13, the total photon spectrum is essentially identical to the released spectrum for photon energies greater than ≈ 600 keV. This is confirmed by the scattered component (the difference spectrum shown by the green curve), which falls sharply above ≈ 500 keV. Analyses of solar-flare deexcitationline spectral data above 600 keV should be unaffected by the presence of Compton scattering for disk flares. Below 600 keV, the scattered component becomes significant and dominates below ≈ 400 keV. Studies of lines in this energy range, such as the α-α complex and the 511 keV positron-annihilation line with its positronium continuum, might be affected by the presence of the scattered component. Moreover, bremsstrahlung emission from flareaccelerated electrons is significant in this energy range, and the presence of scattered emis-sion from deexcitation lines might affect the derived amplitude and/or spectral shape of the model used to fit the bremsstrahlung. These issues are discussed in Section 6.
The 511 keV positron-annihilation line from pair production (see Figure 14) might affect the fitted fluence of this line that is to be attributed to the flare. However, comparing with the calculated solar-flare 511 keV line fluence from decay of charged pion and radioactive positron emitters (e.g. Murphy, Kozlovsky, and Share, 2014), we find that for typical flare ion spectra, the fluence of the line from scattering is lower that 3% of that from the flare, even for a flare at disk center where the line from pair production is strongest. We therefore do not expect any impact of the pair-produced line on the derived fluence of the line from the flare itself.
For the limb flare (Panel b of Figure 14), as expected from Panel b of Figures 12 and 13, there is less scattered component below 600 keV. The lines in this energy range are more visible above the scattered continuum, in particular, the α-α complex. Above 600 keV, the extensions of the scattered spectra up to the line energies seen in Figure 12 cause some noticeable filling of the valleys between the narrow lines. The difference spectrum (green curve) reflects this. Because there is some attenuation of the lines for the limb flare (see Figure 9), the difference spectrum shows depressions at the energies of strong lines (e.g. at the 847 keV 56 Fe line) and can also be negative. Any impact of Compton scattering on the derivation of flare fitting parameters should be less for limb flares than for disk flares.
The discussion of Section 5.1 concerning different production-depth distributions for mono-energetic photons showed that there is little impact on the total spectrum leaving the Sun unless the accelerated-ion spectrum is flatter than a power-law index s = 3, which is unlikely for solar flares. This is also true for the total deexcitation-line spectrum.

Impact of Compton Scattering of Deexcitation Lines on Fits to Solar Flare Spectra
We wish to see if the Compton-scattered deexcitation-line component, which has not previously been included in fits to solar-flare gamma-ray spectral data, is detectable and if its inclusion changes results previously obtained from such fits. As we have seen, the spectrum of Compton-scattered deexcitation-line photons is most significant below about 600 keV and includes a 511 keV positron-annihilation line. Solar-flare emission in this energy range is dominated by flare-accelerated electron bremsstrahlung, the flare-produced positronannihilation line and its positronium continuum, and the ≈ 450 keV α-α deexcitationline complex. The derived fluxes of these emissions might be affected when the Comptonscattered deexcitation-line component is included in the fit. However, because gamma-ray spectrometers generally do not absorb all of the energy of every photon, most produce an intrinsic low-energy continuum and a 511 keV positron-annihilation line in their energyloss spectrum. This continuum is similar to the solar scattered spectrum and could mask the presence of the solar Compton-scattered deexcitation-line component. Because of this, we first discuss gamma-ray detector-response functions in Section 6.1 before discussing the results of fits to flare spectral data with and without the Compton-scattered component in Section 6.2.

Gamma-Ray Detector Response Function
In an ideal detector, each solar photon deposits all of its energy, and the resulting energyloss count spectrum would be identical to the solar-photon spectrum. The detector response Figure 15 RHESSI and SMM/GRS detector responses to 6.129 MeV photons, normalized so that the number of counts in the photopeak is unity. The dips near 1.6 and 3.2 MeV and the discontinuity at ≈ 3.9 MeV in the RHESSI response function are properly-accounted-for instrumental artifacts. function would then be described as "diagonal", containing only counts corresponding to the original photon energy; i.e. at the "photopeak". Only a fraction of the original photon energy is often deposited, however. For example, a solar photon may deposit some of its original energy in the detector material but then escape. Or a solar photon may Compton scatter in material surrounding the detector and then enter the detector with an energy lower than its original energy and be counted. Or a solar photon with energy greater than 1.022 MeV may produce a positron-electron pair in surrounding material. The positron then undergoes annihilation with an electron, producing two 511 keV photons, one of which may enter the detector, depositing all or some of its energy, and be counted. Such events produce an "offdiagonal" detector response, contributing counts at energies lower than the original photon energy. It can be reduced by surrounding the detector(s) with active shielding that rejects detector events when there is a coincident event in the shield, whether due to a photon escaping the detector or an incoming photon not from the direction of the Sun. In a multidetector instrument, it can also be reduced by close-packing individual detectors to enhance capture of photons escaping from one detector in an adjacent detector. The SMM/GRS included seven moderate spectral-resolution NaI(Tl) detectors covering 0.3 -0.9 MeV and a rear thick CsI(Na) crystal covering 10 -140 MeV. It had an active shield and the detectors were close-packed, both contributing to its almost-diagonal response. RHESSI is an imager that consists of nine bi-grid rotating modulation collimators in front of nine cryogenically cooled high spectral-resolution germanium detectors. Because of weight and cost considerations, RHESSI has no active shield, and due to the collimators, the nine detectors could not be close-packed. Its response function has a strong off-diagonal component. The response functions of these two instruments for 6.129 MeV photons are shown in Figure 15, normalized so that the numbers of counts in the respective photopeaks are unity. At the photopeak (indicated by the dashed vertical line), the high-resolution RHESSI detector produces a narrower line than does SMM/GRS, but the SMM/GRS off-diagonal response is an order of magnitude lower than that of RHESSI over most of the energy range.

Spectral Fits
Solar-flare gamma-ray spectra observed with instruments such as SMM/GRS and RHESSI are typically fit with calculated photon components representing the various sources of gamma rays in flares: bremsstrahlung of flare-accelerated electrons, nuclear deexcitation lines, the 511 keV positron-annihilation line and its associated positronium continuum, the 2.223 MeV neutron-capture line (and its solar Compton-scattered continuum), and pion-decay emission at higher energies. The electron bremsstrahlung is typically modeled as the sum of two components: a relatively steep power law (i.e. dN/d ∝ −s L ), which dominates at low energy, and a relatively-flat power law times an exponential (i.e. dN/d ∝ −s H exp( / 0 )), which dominates at high energies.
The sum of these components was convolved with the detector-response function and the resulting calculated energy-loss count spectrum was compared with the observed count spectrum. The parameters describing the components were systematically varied until the total calculated spectrum provided the best fit to the data as measured by a statistical test such as χ 2 . The final parameter values and their calculated uncertainties were taken to be the best estimates for these parameters. Here, we fit flare data using OSPEX. OSPEX, written in IDL, is part of SolarSoftWare (Freeland and Handy, 1998), a set of integrated software libraries, data bases, and system utilities providing a common programming and data analysis environment for solar physics.
We show the energy-loss count spectrum of the 28 October 2003 flare observed with RHESSI during the interval from 11:12:20 to 11:18:20 UT in Panel a of Figure 16. We used this interval because the low-energy electron-bremsstrahlung contribution during this time was relatively weak, offering a better possibility that the scattered deexcitation-line component will affect the fit. The flare occurred at θ obs = 18 • . We fit the spectrum only above 200 keV (indicated by the dotted vertical line in the figure) with the sum of the components noted above. For the deexcitation-line component, we assumed an ion spectral index s = 4 and a downward-isotropic interacting-ion angular distribution [δ = 0] for a flare with θ obs = 20 • . We separated the deexcitation-line spectrum into three distinct components: narrow lines, broad lines, and the α-α complex. The narrow-and broadline components include their associated nuclear continua.
We first fit the RHESSI spectral data using narrow and broad deexcitation-line components without the Compton-scattered radiation. The red curve of Panel a of Figure 16 shows the best-fitting total model count spectrum (i.e. after convolving the total photon model with the RHESSI detector response). We also show the best-fitting narrow-and broadline component count spectra (the dark-green and dark-blue curves) and the low-and high-energy bremsstrahlung components (the dark-purple and dark-brown curves). The high-energy electron bremsstrahlung dominates the spectrum above ≈ 200 keV. For clarity, we do not show the other components included in the fit. The RHESSI detector measurement artifacts near 1.6, 3.2, and 3.9 MeV in the data are well reproduced by the detector response in the fitted models.
The effect of the off-diagonal nature of the RHESSI detector-response function is clearly seen by comparing the narrowline photon spectrum (the dark-green curve in Panel b) with its corresponding count spectrum (the dark-green curve in Panel a). Below about 1 MeV, counts due to interactions of higher-energy solar photons (the off-diagonal response) dominate the spectrum, overwhelming the counts due to solar photons at these energies.
We then fit the RHESSI spectral data using narrow and broad deexcitation-line components that include their respective Compton-scattered radiation. For the high-energy bremsstrahlung, we calculated its Compton-scattered component using MCNP6 assuming that it has the same production-depth distribution as that of the deexcitation lines. The resulting best-fitting total model count spectrum is also shown in Panel a of Figure 16. It is visually indistinguishable from that obtained using the components without scattering. The light-green and light-blue curves are the best-fitting count spectra of the narrow and The calculated narrow deexcitation-line photon spectrum for θ obs = 20 • without Compton scattering (dark green) and with scattering (light green). Also shown is the high-energy electron bremsstrahlung ("exp-power") with relative normalization determined by the fit. broad deexcitation-line components with scattering, respectively. The light-brown curve is the best-fitting high-energy electron-bremsstrahlung count spectrum with scattering, and the light-purple curve is the best-fitting low-energy bremsstrahlung count spectrum. While the quality of fit as measured by χ 2 improved, the improvement was not significant. In addition, although the values of the fitted line and continuum parameters changed in response to the presence of the scattered components, none of the changes were significant, remaining well within their uncertainties. This includes the positronium continuum associated with the 511 keV positron-annihilation line.
This insensitivity to the additional scattered-component photons can be understood by comparing the photon spectra with their corresponding count spectra. For example, in the calculated narrowline photon spectrum with scattered radiation (shown as the light-green curve in Panel b), the additional Compton-scattered photons are seen to be significant below ≈ 700 keV (compare with the dark-green curve of Panel b). At 200 keV, the intensity of the spectrum with scattering is more than an order of magnitude greater than that without scattering. However, this enhancement is reduced to less than a factor of two in the corresponding count spectrum (light-green curve of Panel a) because at these energies the count spectrum is already dominated by counts from higher-energy photons resulting from the strong off-diagonal nature of the RHESSI detector-response function.
We find that the Compton-scattered deexcitation-line component is not detected and that its inclusion has no significant impact on fits to solar-flare spectra, at least for a gamma-ray instrument such as RHESSI having significant off-diagonal detector response.

Summary and Discussion
Gamma-ray deexcitation lines in typical solar flares are produced at atmospheric depths such that photons with trajectories originally directed away from the Sun escape without significant Compton scattering. This means that for flares occurring on the visible solar disk, there is no significant attenuation of gamma rays with initial trajectories toward Earth. However, deexcitation-line photons with trajectories directed into the Sun can Compton scatter once or several times before escaping with reduced energy. Therefore, for flares located anywhere on the visible solar disk, the total deexcitation-line spectrum leaving the Sun will be composed of two components: a component of photons nearly identical to the production spectrum along the direction of the line of sight, and a component of scattered photons of reduced energy. Calculated solar deexcitation-line spectra (see Section 2.2) used in the past to interpret data obtained with several gamma-ray instruments did not include the scattered component. This scattered component might affect the information derived from fits to observed solar-flare spectra.
We used the Monte Carlo N-Particle Transport Code (MCNP6) to calculate this component. We showed how it depends on the location of the flare relative to the line of sight and on parameters associated with the accelerated ions and the magnetic loop. We found that for typical solar-flare accelerated-ion kinetic-energy spectra, it is significant only below ≈ 600 keV and is most important for flares occurring near disk center.
We investigated the impact of inclusion of the scattered deexcitation-line component on the derived values of the various parameters associated with solar flares determined from fits to flare spectral observations. We fit the energy-loss count spectrum of the 28 October 2003 flare observed with RHESSI from 11:12:20 to 11:18:20 UT with calculated components representing all of the sources of gamma rays in flares: bremsstrahlung of flare-accelerated electrons, deexcitation lines, the 511 keV positron-annihilation line and its associated positronium continuum, the 2.223 MeV neutron-capture line (and its solar Compton-scattered continuum), and pion-decay emission at higher energies. For the deexcitation lines, we fit the observed spectrum using calculated spectra with and without the scattered component. The flare occurred near disk-center at θ obs = 18 • .
We found that inclusion of the scattered deexcitation-line component did not improve the quality of the fit to the 28 October RHESSI flare data and had no significant impact on any of the fitted parameters. The additional counts from the solar-scattered component were overwhelmed by counts arising from the off-diagonal response of RHESSI. Moreover, at energies < 1 MeV where the Compton-scattered deexcitation-line component is significant, deexcitation-line emission (either with or without scattering) is typically at least an order of magnitude lower than either the high-energy or low-energy bremsstrahlung (see Figure 16). Unless the event being studied exhibits very weak electron acceleration relative to ion acceleration, inclusion of the deexcitation-line scattered component is unlikely to affect the fitted bremsstrahlung parameters, even for a detector with improved off-diagonal response.
We note that the 28 October flare fits were performed only above 200 keV. Below that energy, the Compton-scattered deexcitation-line component continues to rise, peaking at 20 -40 keV (see Figure 14) and perhaps could have an effect on values of the fitted bremsstrahlung spectral parameters when fits are performed down to such low energies, especially for disk-centered flares. However, typical flare low-energy scatteredbremsstrahlung spectra are steep and will dominate deexcitation-line spectra with or without the scattered component at these lower energies as well, and so their associated parameters would again not be affected.
The capability for calculating the Compton-scattered spectrum associated specifically with flare-accelerated electron bremsstrahlung at low energies was implemented in OSPEX (see Section A.1). We compared this calculated scattered component with the scattered component of the deexcitation lines calculated with MCNP6 for the 28 October flare and found that the bremsstrahlung-scattered component was more than four orders of magnitude larger than that of the lines.
As noted in Section 1, gamma-ray deexcitation lines can be polarized and the Comptonscattered component will introduce additional polarization. If measurements of deexcitationline polarization were to be made and used to derive information about, for example, the angular distribution of the interacting ions, consideration of the scattered component will be important. Otherwise, we know of no diagnostic value for the scattered component; its importance lies only in its potential for affecting the values of fitted flare parameters. For the 28 October RHESSI flare, we found that it had no effect.
However, the intensity of the positron-annihilation positronium continuum could be one fitted parameter that is sensitive to the presence of the deexcitation-line scattered component. Because it is a continuum rather than a line feature, having the correct underlying continuum is important for accurately determining its strength. Although its fitted intensity also did not change significantly with or without deexcitation-line scattering for the 28 October RHESSI flare, it might with an instrument having a more diagonal response, such SMM/GRS, which would reduce the detector-generated continuum. We plan to study flares observed with SMM/GRS. it is not useable for most of the deexcitation-line gamma-ray spectrum. Using MCNP6, we released isotropically 500 keV photons at a depth of −700 km (≈ 2 × 10 −3 g cm −2 ; see Figure 2). Figure 17 compares the resulting scattered component with that calculated with OSPEX for two flare locations: θ obs = 20 • and 60 • . The agreement between the two techniques is quite good.

A.2 Compton Scattering of the Neutron-Capture Line
While not a nuclear deexcitation line, the 2.223 MeV neutron-capture line is another important line produced in solar flares. Solar-flare neutrons result from nuclear interactions of flare-accelerated ions similar to those producing the excited nuclei. Neutrons originally directed into the Sun slow down, and some are captured on ambient hydrogen to produce deuterium with the binding energy appearing as a 2.223 MeV photon. Hua and Lingenfelter (1987) and Hua et al. (2002) developed a Monte Carlo-based computer code to calculate the depth, energy, and angular distributions for the production of neutrons and their subsequent gamma-ray line emission due to capture. In the code, each capture photon is followed until it either escapes from the solar atmosphere or is multiply Compton scattered to low energy. The code is based on the same loop model used by Hua, Ramaty, and Lingenfelter (1989) for deexcitation lines. Murphy et al. (2007) used this neutron-production code in their detailed study of gamma-ray and neutron production in solar flares. Because neutrons free of the nucleus decay with a mean lifetime of ≈ 880 seconds, capture before decay can only occur where the hydrogen density is high, deep in the photosphere and significantly deeper than deexcitation-line production in typical flares. The neutrons thermalize before capture, and the gamma-ray emission is therefore isotropic. We used the neutron-production code to calculate the depth distribution for capture of neutrons. We assumed no loop magnetic convergence [δ = 0] and an accelerated-ion spectral index s = 4. The depth distribution (the dotted curve shown in Figure 2) is relatively narrow with a peak at approximately −100 km (≈ 2 g cm −2 ), fairly independent of the neutron-production depth distribution and the accelerated-ion spectral index.
Using MCNP6, we released isotropically 2.223 MeV photons using this depth distribution. Resulting calculated total photon spectra at Earth are shown in Figure 18 for flares occurring at several heliocentric angles [θ obs ], normalized to one released 2.223 MeV photon. The spectra are similar to the scattered spectra from 4.438 MeV photons shown in Figure 11 for the deeper depth distribution arising from flatter ion spectra where the region below the line is filled in with scattered photons. However, the 511 keV positron-annihilation line from pair production is considerably weaker because the initial photon energy of 2.223 MeV is much closer to the 1.022 MeV pair-production threshold energy, reducing the yield.
Compton-scattered spectra calculated with MCNP6 and with the neutron-production code are compared in Panel a of Figure 19 for a disk and a limb flare [θ obs = 0 • and 85 • ]. The agreement between the two techniques is quite good. Including this scattered component and knowing well its energy dependence is important when fitting observed solar-flare gammaray spectral data. The neutron-production code does not include pair production, only Compton scattering, so there is no 511 keV positron-annihilation line in its scattered spectrum as there is in the MCNP6 spectrum.
Even though the capture line is intrinsically one of the strongest lines produced in solar flares, it is significantly attenuated by Compton scattering because of its deep production, especially for limb flares. The filled square in Figure 18 is what the line fluence would be if there were no attenuation, and the colored arrows on the right show the actual fluences at Figure 19 Panel a: Comparison of the Compton-scattered spectrum from 2.223 MeV neutron-capture photons for a disk and a limb flare [θ obs = 0 • and 85 • ] calculated with MCNP6 (black histogram) and the Hua et al. (2002) neutron-production code (red histogram). The 180 • backscatter peak energy is shown by the dashed vertical line. The calculations are normalized to one released 2.223 MeV photon. Panel b: Comparison of the 2.223 MeV neutron-capture line fluence at Earth as a function of flare location [θ obs ] relative to that at θ obs = 0 • calculated with MCNP6 (black curve) and with the neutron-production code (red curve). For both panels, the accelerated ions had a spectral index s = 4.

Figure 20
Neutron-capture line Compton-scattered spectra leaving the Sun calculated by Vestrand, 1990 (their Figure 4; ©AAS. Reproduced with permission) using a slab production model for θ obs = 70 • [μ ≡ cos(θ obs ) = 0.35] (black curves). The number on each spectrum refers to the column density [g cm −2 ] overlying each production slab. All spectra are normalized to the same strength in the narrow line. Neutron-capture line Compton-scattered spectra leaving the Sun calculated with MCNP6 are shown as red histograms for those same overlying column densities (see text for details). each θ obs . The fluence is reduced by almost two orders of magnitude at θ obs = 90 • . In Panel b of Figure 19 we plot this fluence as a function of flare observation angle [θ obs ] relative to the fluence from a flare at disk center [θ obs = 0 • , indicated by the black arrow on the right in Figure 18]. We also plot this ratio calculated with the neutron-production code (red curve). The agreement between the two techniques is quite good.
Using a Monte Carlo technique and a semi-infinite plane-parallel constant-density hydrogen model for the solar atmosphere, Vestrand (1990) also calculated Compton-scattered spectra for 2.223 MeV photons released at various depths in the model atmosphere. Figure 20 (based on Figure 4 of Vestrand, 1990) shows their calculated spectra for θ obs = 70 • , normalized to unit flux in the line. The number on each spectrum refers to the column density [g cm −2 ] overlying the production slab associated with each release depth. To compare with MCNP6 calculations, we released 2.223 MeV photons at depths having overlying column densities of approximately these values (see Figure 2). The resulting calculated scattered spectra are shown as red histograms in Figure 20. The agreement is quite good. We note that Vestrand (1990) did not include pair production in his calculations, so there is no 511 keV line as there is in the MCNP6 spectrum.