Skip to content

Commit

Permalink
Update update_packets.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Sep 16, 2024
1 parent 39367d3 commit 38b1f88
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions update_packets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -109,20 +109,24 @@ void do_nonthermal_predeposit(Packet &pkt, const int nts, const double t2) {
pkt.prop_time = t_new;
}

if (priortype == TYPE_NONTHERMAL_PREDEPOSIT_BETAMINUS) {
atomicadd(globals::dep_estimator_electron[nonemptymgi], en_deposited);
if (pkt.type == TYPE_NTLEPTON_DEPOSITED) {
atomicadd(globals::timesteps[nts].electron_dep_discrete, pkt.e_cmf);
}
} else if (priortype == TYPE_NONTHERMAL_PREDEPOSIT_BETAPLUS) {
atomicadd(globals::dep_estimator_positron[nonemptymgi], en_deposited);
if (pkt.type == TYPE_NTLEPTON_DEPOSITED) {
atomicadd(globals::timesteps[nts].positron_dep_discrete, pkt.e_cmf);
}
} else if (priortype == TYPE_NONTHERMAL_PREDEPOSIT_ALPHA) {
atomicadd(globals::dep_estimator_alpha[nonemptymgi], en_deposited);
if (pkt.type == TYPE_NTLEPTON_DEPOSITED) {
atomicadd(globals::timesteps[nts].alpha_dep_discrete, pkt.e_cmf);
// gamma-ray deposition (which then gave energy to a beta particle) was already counted so only count the beta decay
// products
if (pkt.originated_from_particlenotgamma) {
if (priortype == TYPE_NONTHERMAL_PREDEPOSIT_BETAMINUS) {
atomicadd(globals::dep_estimator_electron[nonemptymgi], en_deposited);
if (pkt.type == TYPE_NTLEPTON_DEPOSITED) {
atomicadd(globals::timesteps[nts].electron_dep_discrete, pkt.e_cmf);
}
} else if (priortype == TYPE_NONTHERMAL_PREDEPOSIT_BETAPLUS) {
atomicadd(globals::dep_estimator_positron[nonemptymgi], en_deposited);
if (pkt.type == TYPE_NTLEPTON_DEPOSITED) {
atomicadd(globals::timesteps[nts].positron_dep_discrete, pkt.e_cmf);
}
} else if (priortype == TYPE_NONTHERMAL_PREDEPOSIT_ALPHA) {
atomicadd(globals::dep_estimator_alpha[nonemptymgi], en_deposited);
if (pkt.type == TYPE_NTLEPTON_DEPOSITED) {
atomicadd(globals::timesteps[nts].alpha_dep_discrete, pkt.e_cmf);
}
}
}
}
Expand Down

0 comments on commit 38b1f88

Please sign in to comment.