IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 2cca0697 authored by Ralf Ulrich's avatar Ralf Ulrich
Browse files

Merge branch '368-small-error-in-energy-loss-profile-recorder-of-bethe-bloch-process' into 'master'

Resolve "small error in energy loss profile recorder of Bethe Bloch process"

Closes #368

See merge request AirShowerPhysics/corsika!310
parents 0b65e10b ea615e57
No related branches found
No related tags found
No related merge requests found
...@@ -201,9 +201,9 @@ namespace corsika { ...@@ -201,9 +201,9 @@ namespace corsika {
GrammageType const grammageEnd = shower_axis_.getProjectedX(vTrack.getPosition(1)); GrammageType const grammageEnd = shower_axis_.getProjectedX(vTrack.getPosition(1));
const auto deltaX = grammageEnd - grammageStart; const auto deltaX = grammageEnd - grammageStart;
int binStart = grammageStart / dX_; int const binStart = grammageStart / dX_;
if (binStart < 0) return; if (binStart < 0) return;
int binEnd = grammageEnd / dX_; int const binEnd = grammageEnd / dX_;
if (binEnd > int(profile_.size() - 1)) return; if (binEnd > int(profile_.size() - 1)) return;
if (deltaX < dX_threshold_) return; if (deltaX < dX_threshold_) return;
...@@ -226,7 +226,7 @@ namespace corsika { ...@@ -226,7 +226,7 @@ namespace corsika {
} else { } else {
fill(binStart, ((1 + binStart) * dX_ - grammageStart) / deltaX); fill(binStart, ((1 + binStart) * dX_ - grammageStart) / deltaX);
fill(binEnd, (grammageEnd - binEnd * dX_) / deltaX); fill(binEnd, (grammageEnd - binEnd * dX_) / deltaX);
for (int bin = binStart + 1; bin < binEnd; ++bin) { fill(bin, 1); } for (int bin = binStart + 1; bin < binEnd; ++bin) { fill(bin, dX_ / deltaX); }
} }
CORSIKA_LOG_DEBUG("total energy added to histogram: {} ", energyCount); CORSIKA_LOG_DEBUG("total energy added to histogram: {} ", energyCount);
......
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