IAP GITLAB

Skip to content
Snippets Groups Projects
Commit fec782a4 authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan: Committed by Maximilian Reininghaus
Browse files

update weight correctly

parent 9725167f
No related branches found
No related tags found
1 merge request!491Fix thinning
Pipeline #10185 passed
...@@ -57,10 +57,10 @@ namespace corsika { ...@@ -57,10 +57,10 @@ namespace corsika {
if (w1 <= maxWeightFactor && w2 <= maxWeightFactor) { // apply Hillas thinning if (w1 <= maxWeightFactor && w2 <= maxWeightFactor) { // apply Hillas thinning
if (uniform_(rng_) <= p1) { // keep 1st with probability p1 if (uniform_(rng_) <= p1) { // keep 1st with probability p1
particle2.setWeight(0); particle2.setWeight(0);
particle1.setWeight(w1 * parentWeight); particle1.setWeight(w1);
} else { // keep 2nd } else { // keep 2nd
particle1.setWeight(0); particle1.setWeight(0);
particle2.setWeight(w2 * parentWeight); particle2.setWeight(w2);
} }
} else { // weight limitation kicks in, do statistical thinning } else { // weight limitation kicks in, do statistical thinning
double const w1prime = std::min(w1, maxWeightFactor); double const w1prime = std::min(w1, maxWeightFactor);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment