IAP GITLAB

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

fixed energy deposit profile

parent 0b65e10b
No related branches found
No related tags found
1 merge request!310Resolve "small error in energy loss profile recorder of Bethe Bloch process"
Pipeline #3321 failed
...@@ -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