@@ -325,6 +325,20 @@ double score_neutron_heating(const Particle& p, const Tally& tally, double flux,
325325 return score;
326326}
327327
328+ // ! Helper function to obtain reaction Q value for photons and charged particles
329+ double get_reaction_q_value (const Particle& p)
330+ {
331+ if (p.type () == ParticleType::photon && p.event_mt () == PAIR_PROD) {
332+ // pair production
333+ return -2 * MASS_ELECTRON_EV;
334+ } else if (p.type () == ParticleType::positron) {
335+ // positron annihilation
336+ return 2 * MASS_ELECTRON_EV;
337+ } else {
338+ return 0.0 ;
339+ }
340+ }
341+
328342// ! Helper function to obtain particle heating [eV]
329343
330344double score_particle_heating (const Particle& p, const Tally& tally,
@@ -335,14 +349,17 @@ double score_particle_heating(const Particle& p, const Tally& tally,
335349 p, tally, flux, rxn_bin, i_nuclide, atom_density);
336350 if (i_nuclide == -1 || i_nuclide == p.event_nuclide () ||
337351 p.event_nuclide () == -1 ) {
352+ // For pair production and positron annihilation, we need to account for the
353+ // reaction Q value
354+ double Q = get_reaction_q_value (p);
355+
338356 // Get the pre-collision energy of the particle.
339357 auto E = p.E_last ();
340- // The energy deposited is the difference between the pre-collision
341- // and post-collision energy...
342- double score = E - p.E ();
343- // ...less the energy of any secondary particles since they will be
344- // transported individually later
345- score -= p.bank_second_E ();
358+
359+ // The energy deposited is the sum of the incident energy and the reaction
360+ // Q-value less the energy of any outgoing particles
361+ double score = E + Q - p.E () - p.bank_second_E ();
362+
346363 score *= p.wgt_last ();
347364
348365 // if no event_nuclide (charged particle) scale energy deposition by
0 commit comments