diff --git a/Documentation/Examples/CMakeLists.txt b/Documentation/Examples/CMakeLists.txt index c3ca32be4008b70f09609436a7032c48e0bfe3ad..131476a3a7c133e7d1b093a05a67ca830494be39 100644 --- a/Documentation/Examples/CMakeLists.txt +++ b/Documentation/Examples/CMakeLists.txt @@ -108,7 +108,6 @@ target_link_libraries (vertical_EAS SuperStupidStack CORSIKAunits install (TARGETS vertical_EAS DESTINATION share/examples) CORSIKA_ADD_TEST (vertical_EAS) - add_executable (staticsequence_example staticsequence_example.cc) target_compile_options(staticsequence_example PRIVATE -g) # do not skip asserts target_link_libraries (staticsequence_example diff --git a/Framework/Cascade/Cascade.h b/Framework/Cascade/Cascade.h index eb378a793049f47184d38b80c5e288be27413247..d3ee524313d5af50c4bbb50ce34e00cd7a6218b7 100644 --- a/Framework/Cascade/Cascade.h +++ b/Framework/Cascade/Cascade.h @@ -54,7 +54,6 @@ namespace corsika::cascade { * <code>auto GetTrack(Particle const& p)</auto>, * with the return type <code>geometry::Trajectory<corsika::geometry::Line> * </code> - * * <b>TProcessList</b> must be a ProcessSequence. * * <b>Stack</b> is the storage object for particle data, i.e. with * Particle class type <code>Stack::ParticleType</code> @@ -221,6 +220,18 @@ namespace corsika::cascade { setup::StackView secondaries(vParticle); [[maybe_unused]] auto projectile = secondaries.GetProjectile(); + /* + Create SecondaryView object on Stack. The data container + remains untouched and identical, and 'projectil' is identical + to 'vParticle' above this line. However, + projectil.AddSecondaries populate the SecondaryView, which can + then be used afterwards for further processing. Thus: it is + important to use projectle (and not vParticle) for Interaction, + and Decay! + */ + setup::StackView secondaries(vParticle); + [[maybe_unused]] auto projectile = secondaries.GetProjectile(); + if (min_distance < distance_max) { // interaction to happen within geometric limit // check whether decay or interaction limits this step diff --git a/Framework/ProcessSequence/ProcessSequence.h b/Framework/ProcessSequence/ProcessSequence.h index bc1a5f779fa6eaa6ac26df2379ba4694b7d03721..51380c15bd89896cf2aa7c240e92ec44111fe101 100644 --- a/Framework/ProcessSequence/ProcessSequence.h +++ b/Framework/ProcessSequence/ProcessSequence.h @@ -118,6 +118,20 @@ namespace corsika::process { return ret; } + template <typename TSecondaries> + EProcessReturn DoSecondaries(TSecondaries& vS) { + EProcessReturn ret = EProcessReturn::eOk; + if constexpr (std::is_base_of<SecondariesProcess<T1type>, T1type>::value || + is_process_sequence<T1>::value) { + ret |= A.DoSecondaries(vS); + } + if constexpr (std::is_base_of<SecondariesProcess<T2type>, T2type>::value || + is_process_sequence<T2>::value) { + ret |= B.DoSecondaries(vS); + } + return ret; + } + template <typename TParticle, typename TTrack> corsika::units::si::LengthType MaxStepLength(TParticle& vP, TTrack& vTrack) { corsika::units::si::LengthType