Implementation of the ELECTR module in NJOY

. The electr module of NJOY is designed to produce complete and accurate multigroup electroatomic cross sections from ENDF / B-VII data[1, 2]. electr produces restricted cross sections consistent with a solution of the multigroup Boltzmann-Fokker-Planck (BFP) equation. Total, elastic, inelastic (collision and bremss-trahlung) cross sections can be averaged using a variety of group structures and weighting functions. The Legendre components of the within-group elastic and group-to-group inelastic collision cross sections are calculated using tabulated data in energy and analytic expressions of the angular deviation recovered from the CEPXS code[3]. Here, we propose an Open-Source implementation of this module, named electr in NJOY-2012 and NJOY-2016.[4] electr also computes partial energy deposition and charge deposition cross sections for each reaction and sum these partial contributions. The resulting multigroup constants are written on an intermediate gendf ﬁle for later conversion to any desired format.


Introduction
The electr module was developed and integrated in the NJOY processing tool, as depicted in Figs. 1 and 2. [4] • We wrote a new processing module named electr for producing multigroup electroatomic cross sections, including gamma production sets. Two operating modes are currently implemented, but only the ENDF mode is Open Source: CEPXS: Use feed functions from CEPXS [3] ENDF: Use feed functions adapted to the EPICS evaluation. Both Evaluated Electron Data Library (EEDL) and Evaluated Atomic Data Library (EADL) are required. [1,2] • We update the existing gaminr module for including electron and positron production sets • We update the existing matxsr module for processing the new MT reactions.
An updated version of module matxsr in NJOY will be used to hold microscopic electroatomic and photoatomic cross sections. The DRAGON5 code was also modified for accepting the photoatomic and electroatomic coupled matxs files generated with NJOY. [  Electroatomic reactions are depicted in Fig. 3 and related cross section data is generated using the new electr module. A large fraction of electrons are losing small amount of their energy with each collision and these collisions are highly forward peaked and anisotropic. To slow down from 500 to 250 keV, an electron will undergo 4000 elastic scatterings in an aluminum foil (Z = 13), against 7000 in a gold foil (Z = 79). These forward peaked collisions occur in the soft energy domain and are represented with stopping power data. We use the continuous slowing down model (CSDA) to describe a slowing down of all socalled soft interactions involving secondary electrons with energy below a threshold E s . Remaining cross sections are describing catastrophic interactions with larger steps in energy. Corresponding MT numbers are presented in Table 1.   Total 525 Large angle elastic collision (μ < 0.999999) 527 Bremsstrahlung 534−572 Impact electroionization and relaxation production 530 Energy deposition by electrons 531 Charge deposition by electrons The electroatomic reactions are represented in ENDF-102 format with the MT numbers of Table 1. All reactions except MT525 are written in restricted multigroup form on the gendf tape. Reaction MT525 is written in transport-corrected multigroup form. Restricted stopping powers are used to represent soft collisions in the Fokker-Planck operator. The excitation cross section representing a slowing down process through the electronic field of an atom (MT528) is assumed to be soft. Other catastrophic reactions are used in the usual way. The soft component of the collisional and radiative stopping powers at group boundaries are written on the gendf tape as MT507 and MT508.
Scattering laws of type LAW = 1 for collision/ionization inelastic and bremsstrahlung reactions are stored in TAB2 records similar to those used for neutron-induced reactions in groupr where tab1io data structures are replaced by listio data structures. The subroutine eetsed returns the secondary-energy distribution for electrons for all groups simultaneously, using an implementation similar to subroutines getsed of module groupr.
Photoatomic reactions are depicted in Fig. 4 and related cross section data is generated using the legacy electr module. Corresponding MT numbers are presented in Table 2.
The module electr processes a list of electroatomic reactions and collision laws from ENDF-102 evaluations.  Rayleigh scattering 504 Compton scattering 516 Pair production 522 Photoelectric effect The energy and charge deposition cross sections are generated. A multigroup energy mesh is first imposed, as depicted in Fig. 5. A discretization of the group G is defined in energy, as illustrated in the figure. Each group g is defined with limits between E g and E g+1 . The energies E < E 1 correspond to the absorption domain and the energy E g−1 corresponds to the boundary between the soft and catastrophic domains. • The impact electroionization is a correlated process including the (e,2e) inelastic collision differential cross section and relaxation production. Electrons scatter inelastically from the atomic electrons ejecting them from the i−th atomic shell with considerable kinetic energy. If i ≤ 5 (K, L or M shells), and if the atom is heavy, there is a production of additional relaxation radiation consisting of Auger electrons and fluorescence photons. These are produced in a cascade of shell transitions induced by the initial electron vacancy. The Moller law of Fig. 6 can be used to represent (e,2e) inelastic collisions without relaxation in cases where the target electron is not bounded. [3] The Moller law is used with the CEPXS mode of electr. The forward peaked scattering is represented as soft interaction.
• The bremsstrahlung process takes place when initial electron pass near atomic nuclei and inelastic radiative interaction occurs.
• The elastic collision differential cross section represents a collision where the energy of the incident electron is conserved by the interaction. We consider the large angle elastic cross section (MT525) corresponding to a deviation cosine with −1 ≤ μ ≤ 0.999999. Forward peaked elastic scattering is further removed from the multigroup BFP equation using a transport correction.
• The microscopic stopping power s(E) is the average rate at which the electrons lose energy at any point along their tracks, according to where N is the number of atoms per unit volume.
The stopping power represents components of atomic excitation, inelastic collision and bremsstrahlung processes. The stopping power is evaluated data, in units of Mev-barn, formally defined by the relation keeping in mind that σ(E → 0) or σ(E → E) may diverge. According to Ref [3], the lower energy limit must be set to E/2 for the collisional stopping power: A BFP solution of the electroatomic transport equation consists to use:

Solution of the BFP equation
The BFP equation represents the transport of electrons and positrons. In this case, the term of charged particle scattering has a strong forward anisotropic component.
• We obtain a coupled system of three Boltzmann integrodifferential equations describing the fluxes of photons (ψ 1 ), electrons (ψ 2 ) and positrons (ψ 3 ) of the form with the notation ψ ≡ (ψ 1 , ψ 2 , ψ 3 ), where K j {ψ(r, E, Ω)} is the scattering source and Q j is the external source of particle j.
• The coupled set of Boltzmann and BFP equations is depicted in Fig. 7 This system is solved with code DRAGON5 and is based on matxs cross-section data.
• The BFP equation has an integral backward scattering operator similar to that used for photons and a forward scattering operator of the type L FP .
• The scattering source for a charged particle is written where Σ r, j is the restricted (or catastrophic) total macroscopic cross section of charged particles.
• The diffusion operator Kψ for soft interactions is approximated by a linear differential operator L FP based on a Taylor expansion, called the Fokker-Planck operator defined as where S (r, E) is the macroscopic stopping power (MeV/cm).
• The Sternheimer density correction for charged particles is implemented in the LIB: module of DRAGON5. [3,5] • Equations (4) solution is currently based on the discrete ordinates method (S n ) in DRAGON5 using high order diamond differencing (HODD) or discontinuous Galarkin (DG) discretization in space.
• Calculation of the energy deposition and dose made by each particle population is required to build the global computational scheme.
• Additional modules will be implemented in DRAGON5 to produce the required information: PSOUR: Set the right-hand-side source term in the BTE or BFP equation originating from companion particles. This module is called three times in the DRAGON5 computational scheme.
HEAT: Add components of energy deposition from photoatomic and electroatomic and compute the dose.

Coding Details
The main entry point is subroutine electr exported by module electm. The code begins by reading the user's input. It then locates the position for the new material on the old gendf tape (if any) and copies the earlier results to the new output tape. The desired material is also located on the input pendf tape prepared previously using module reconr. A new material header is then written onto the For each of the preset reaction types, electr uses the panel logic of groupr to average the cross sections. The resulting cross sections and group-to-group matrix elements are then printed out and written to the output tape. The restricted total cross section and the energy and charge deposition contributions from each reaction are summed into a storage area. After all reactions have been processed for this material, a special pass through the output logic is used to create the restricted total cross section in MT501 and the energy and charge deposition cross section in MT530 and MT531. Finally, the rest of the old output tape is copied to the new output tape. A description of the format of the multigroup output tape will be found in the groupr chapter of Ref. [4].
As with panel in groupr, epanel integrates the triple product F * σ * φ. The feed into secondary group g for Legendre order from initial energy E is computed in etff. Cross sections are read from the pendf tape (see gtsig). Flux can be read in, constant, or 1/E with high and low energy roll-offs (see enwtf and etflx).
Scattering laws of type LAW = 1 for collision/ionization inelastic and bremsstrahlung reactions are stored in TAB2 records similar to those used for neutron-induced reactions in groupr where tab1io data structures are replaced by listio data structures. The subroutine eetsed returns the secondary-energy distribution for electrons for all groups simultaneously, using an implementation similar to subroutines getsed of groupr.
The subroutine eetsed is initialized for a particular reaction by calling it with ed = 0. First, scratch storage is allocated, and all the subsections are read in. Tabulated subsections are averaged over outgoing energy groups for each of the given incident energies. The array loc contains pointers for each subsection. On subsequent entries (ed>0), eetsed loops over the subsections for this reaction. It first retrieves the fractional probability for the subsection using terpa. The routine interpolates between values of the tabulated data using the unit base inter-polation technique, multiply by the fractional probability for the law and accumulates the contributions into sed. ENDF TAB2 information available in MF=26 is only related to recoil electrons or emitted photon probability law P(E → E r ). Additional subsections are generated by eetsed with ed = 0 to enable the processing of probability law for the principal scattered electron and for the first moments P(E → E r )E r of these probability laws.

Conclusion
The electr module is dedicated to the production of multigroup electroatomic cross-sections for use in deterministic solutions of the BFP equation. Availability of module electr is a long-standing request from NJOY community. electr with ENDF mode is an Open-Source contribution distributed under the BSD license. The actual implementation is a beta version requiring further validation. At the time of writing, a programming issue remains to be corrected with the ENDF mode.