IAP GITLAB

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

constexpr constant for grammage conversion

parent ac5a7044
No related branches found
No related tags found
1 merge request!37Cleanup process interface
Pipeline #83 passed
......@@ -66,8 +66,9 @@ namespace corsika::cascade {
fProcessSequence.GetTotalInverseInteractionLength(particle, step);
// sample random exponential step length in grammage
std::exponential_distribution expDist((1_m * 1_m / 1_g) / total_inv_lambda);
GrammageType const next_interact = (1_g / (1_m * 1_m)) * expDist(fRNG);
auto constexpr grammageConversion = 1_g / (1_m * 1_m);
std::exponential_distribution expDist(1 / (grammageConversion * total_inv_lambda));
GrammageType const next_interact = grammageConversion * expDist(fRNG);
std::cout << "total_inv_lambda=" << total_inv_lambda
<< ", next_interact=" << next_interact << std::endl;
......
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