Skip to content

Commit

Permalink
small optimization for case of haveSecondaries=False, as pointed out …
Browse files Browse the repository at this point in the history
…by Julien
  • Loading branch information
LeanderSchlegel committed May 21, 2024
1 parent 4b27792 commit 14c7835
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/module/EMInverseComptonScattering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ void EMInverseComptonScattering::performInteraction(Candidate *candidate) const
double Enew = distribution.sample(E, s);

// add up-scattered photon
double Esecondary = E - Enew;
double f = Enew / E;
if (havePhotons) {
double Esecondary = E - Enew;
double f = Enew / E;
if (random.rand() < pow(1 - f, thinning)) {
double w = 1. / pow(1 - f, thinning);
Vector3d pos = random.randomInterpolatedPosition(candidate->previous.getPosition(), candidate->current.getPosition());
Expand Down

0 comments on commit 14c7835

Please sign in to comment.