IAP GITLAB

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

Merge branch '89-consistent-units-in-cascade-step' of...

Merge branch '89-consistent-units-in-cascade-step' of gitlab.ikp.kit.edu:AirShowerPhysics/corsika into 89-consistent-units-in-cascade-step
parents c6fe0173 e9023467
No related branches found
No related tags found
1 merge request!29Resolve "Consistent units in cascade step"
......@@ -18,6 +18,7 @@
#include <corsika/random/UniformRealDistribution.h>
#include <corsika/setup/SetupTrajectory.h>
#include <corsika/units/PhysicalUnits.h>
#include <corsika/environment/Environment.h>
#include <type_traits>
......@@ -57,6 +58,7 @@ namespace corsika::cascade {
void Step(Particle& particle) {
using namespace corsika::units::si;
// determine geometric tracking
corsika::setup::Trajectory step = fTracking.GetTrack(particle);
......@@ -67,6 +69,7 @@ namespace corsika::cascade {
// 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);
std::cout << "total_inv_lambda=" << total_inv_lambda
<< ", next_interact=" << next_interact << std::endl;
......@@ -155,7 +158,12 @@ namespace corsika::cascade {
Stack& fStack;
corsika::environment::Environment const& fEnvironment;
corsika::random::RNG& fRNG =
<<<<<<< HEAD
corsika::random::RNGManager::GetInstance().GetRandomStream("cascade");
=======
corsika::random::RNGManager::GetInstance().GetRandomStream("cascade");
>>>>>>> e9023467d9ae486f2436418f2004da612ebd02a7
};
} // namespace corsika::cascade
......
......@@ -31,6 +31,8 @@ namespace corsika::geometry {
, v0(pV0) {}
Point GetPosition(corsika::units::si::TimeType t) const { return r0 + v0 * t; }
Point PositionFromArclength(corsika::units::si::LengthType l) const { return r0 + v0.normalized() * l; }
Point PositionFromArclength(corsika::units::si::LengthType l) const {
return r0 + v0.normalized() * l;
......
......@@ -225,6 +225,7 @@ namespace corsika::process {
EProcessReturn SelectInteraction(
Particle& p, Stack& s, corsika::units::si::InverseGrammageType lambda_select,
corsika::units::si::InverseGrammageType& lambda_inv_count) const {
if constexpr (is_process_sequence<T1>::value) {
// if A is a process sequence --> check inside
const EProcessReturn ret =
......
......@@ -60,7 +60,6 @@ namespace corsika::units::si {
phys::units::quantity<phys::units::dimensions<0, 0, -1>, double>;
using InverseGrammageType =
phys::units::quantity<phys::units::dimensions<2, -1, 0>, double>;
} // end namespace corsika::units::si
/**
......
......@@ -76,7 +76,6 @@ namespace corsika::process {
auto GetTrack(Particle const& p) {
using namespace corsika::units::si;
geometry::Vector<SpeedType::dimension_type> const velocity =
p.GetMomentum() / p.GetEnergy() * corsika::units::si::constants::cSquared;
......
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