IAP GITLAB

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

adapt testCascade

parent 7a6af436
No related branches found
No related tags found
1 merge request!258Interface change of DoDecay() and DoInteraction()
This commit is part of merge request !254. Comments created here will be created in the context of that merge request.
......@@ -145,8 +145,7 @@ namespace corsika::cascade {
std::cout << "forced interaction!" << std::endl;
auto vParticle = fStack.GetNextParticle();
TStackView secondaries(vParticle);
auto projectile = secondaries.GetProjectile();
interaction(vParticle, projectile);
interaction(vParticle, secondaries);
fProcessSequence.DoSecondaries(secondaries);
vParticle.Delete(); // todo: this should be reviewed, see below
}
......
......@@ -69,18 +69,19 @@ public:
return fX0;
}
template <typename TProjectile>
corsika::process::EProcessReturn DoInteraction(TProjectile& vP) {
template <typename TSecondaryView>
corsika::process::EProcessReturn DoInteraction(TSecondaryView& view) {
fCalls++;
const HEPEnergyType E = vP.GetEnergy();
vP.AddSecondary(
auto const projectile = view.GetProjectile();
const HEPEnergyType E = projectile.GetEnergy();
view.AddSecondary(
std::tuple<particles::Code, units::si::HEPEnergyType,
corsika::stack::MomentumVector, geometry::Point, units::si::TimeType>{
vP.GetPID(), E / 2, vP.GetMomentum(), vP.GetPosition(), vP.GetTime()});
vP.AddSecondary(
projectile.GetPID(), E / 2, projectile.GetMomentum(), projectile.GetPosition(), projectile.GetTime()});
view.AddSecondary(
std::tuple<particles::Code, units::si::HEPEnergyType,
corsika::stack::MomentumVector, geometry::Point, units::si::TimeType>{
vP.GetPID(), E / 2, vP.GetMomentum(), vP.GetPosition(), vP.GetTime()});
projectile.GetPID(), E / 2, projectile.GetMomentum(), projectile.GetPosition(), projectile.GetTime()});
return EProcessReturn::eInteracted;
}
......
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