diff --git a/Documentation/Examples/boundary_example.cc b/Documentation/Examples/boundary_example.cc index d0857537ffa5729b9dbf3d3c977175b5d6c88866..f9839a7b2685cf972a191034a53bd4b6008e1023 100644 --- a/Documentation/Examples/boundary_example.cc +++ b/Documentation/Examples/boundary_example.cc @@ -122,7 +122,6 @@ int main() { random::RNGManager::GetInstance().RegisterRandomStream("s_rndm"); process::sibyll::Interaction sibyll; process::sibyll::Decay decay; - process::sibyll::CheckDecay checkDecay; process::particle_cut::ParticleCut cut(20_GeV); @@ -130,7 +129,7 @@ int main() { MyBoundaryCrossingProcess<true> boundaryCrossing("crossings.dat"); // assemble all processes into an ordered process list - auto sequence = sibyll << decay << checkDecay << cut << boundaryCrossing << trackWriter; + auto sequence = sibyll << decay << cut << boundaryCrossing << trackWriter; // setup particle stack, and add primary particles setup::Stack stack; diff --git a/Documentation/Examples/cascade_example.cc b/Documentation/Examples/cascade_example.cc index 328cc11fc0eb9569fb95336882f0cad339123e9b..3b5d561005c4cb2bb904c0fff358979ec5d2b5b6 100644 --- a/Documentation/Examples/cascade_example.cc +++ b/Documentation/Examples/cascade_example.cc @@ -135,14 +135,13 @@ int main() { process::sibyll::Interaction sibyll; process::sibyll::NuclearInteraction sibyllNuc(sibyll, env); process::sibyll::Decay decay; - process::sibyll::CheckDecay checkDecay; process::particle_cut::ParticleCut cut(20_GeV); process::track_writer::TrackWriter trackWriter("tracks.dat"); process::energy_loss::EnergyLoss eLoss; // assemble all processes into an ordered process list - auto sequence = stackInspect << sibyll << sibyllNuc << decay << checkDecay << eLoss << cut + auto sequence = stackInspect << sibyll << sibyllNuc << decay << eLoss << cut << trackWriter; // define air shower object, run simulation diff --git a/Documentation/Examples/vertical_EAS.cc b/Documentation/Examples/vertical_EAS.cc index 0b9a8537c7a9dba2dbb329ffeaccbb08541147cc..0b3d4641a8fa6db56ea407049ceef2332d185228 100644 --- a/Documentation/Examples/vertical_EAS.cc +++ b/Documentation/Examples/vertical_EAS.cc @@ -129,14 +129,13 @@ int main() { process::sibyll::Interaction sibyll; process::sibyll::NuclearInteraction sibyllNuc(sibyll, env); process::sibyll::Decay decay; - process::sibyll::CheckDecay checkDecay; process::particle_cut::ParticleCut cut(20_GeV); process::track_writer::TrackWriter trackWriter("tracks.dat"); process::energy_loss::EnergyLoss eLoss; // assemble all processes into an ordered process list - auto sequence = sibyll << sibyllNuc << decay << checkDecay << eLoss << cut << stackInspect; + auto sequence = sibyll << sibyllNuc << decay << eLoss << cut << stackInspect; // define air shower object, run simulation cascade::Cascade EAS(env, tracking, sequence, stack); diff --git a/Framework/Cascade/Cascade.h b/Framework/Cascade/Cascade.h index 873e47817c20ade54e96c517df4662857a1247a0..547c2604a68c660b3ee202e2501279bf91edfabd 100644 --- a/Framework/Cascade/Cascade.h +++ b/Framework/Cascade/Cascade.h @@ -263,6 +263,10 @@ namespace corsika::cascade { InverseTimeType inv_decay_count = 0 / second; fProcessSequence.SelectDecay(vParticle, projectile, sample_process, inv_decay_count); + // make sure particle actually did decay if it should have done so + if (secondaries.GetSize() == 1 && + projectile.GetPID() == secondaries.GetNextParticle().GetPID()) + throw std::runtime_error("Cascade::Step: Particle decays into itself!"); } fProcessSequence.DoSecondaries(secondaries); @@ -273,6 +277,7 @@ namespace corsika::cascade { // be "protected" and not accessible to physics } else { // step-length limitation within volume + std::cout << "step-length limitation" << std::endl; fProcessSequence.DoSecondaries(secondaries); } diff --git a/Processes/Sibyll/Decay.cc b/Processes/Sibyll/Decay.cc index 595d3b1b0c9e993e3423fb8b3c90018ad63af403..ea50d4477715e7d765abb000087fb56ef6f3e722 100644 --- a/Processes/Sibyll/Decay.cc +++ b/Processes/Sibyll/Decay.cc @@ -166,21 +166,4 @@ namespace corsika::process::sibyll { ss.Clear(); } - template <> - EProcessReturn CheckDecay::DoSecondaries(SetupView& vS) { // corsika::setup::StackView&vS){} - auto pCode = vS.GetProjectile().GetPID(); - if (vS.GetSize() == 1 && pCode == vS.GetNextParticle().GetPID()) - throw std::runtime_error("Sibyll::CheckDecay: Particle decays into itself!"); - - /* - here we could also post-process the decay products and let short-lived resonances - decay, etc - - See Issue 196 - - https://gitlab.ikp.kit.edu/AirShowerPhysics/corsika/issues/196 - - */ - return EProcessReturn::eOk; - } } // namespace corsika::process::sibyll diff --git a/Processes/Sibyll/Decay.h b/Processes/Sibyll/Decay.h index c332aed6951da72345be6584dfd8b201dd04dedc..feb2309dad14443a364023ec9f013987be58a673 100644 --- a/Processes/Sibyll/Decay.h +++ b/Processes/Sibyll/Decay.h @@ -56,15 +56,8 @@ namespace corsika::process { EProcessReturn DoSecondaries(TParticleView&); }; - class CheckDecay : public corsika::process::SecondariesProcess<CheckDecay> { - public: - CheckDecay() {}; - void Init() {}; - template <typename TSecondaryView> - EProcessReturn DoSecondaries(TSecondaryView&); - }; - } // namespace sibyll + } // namespace corsika::process #endif diff --git a/Processes/Sibyll/testSibyll.cc b/Processes/Sibyll/testSibyll.cc index 9da1dc0d0d1ae1265368b4238603bd676bbf3b56..17706ebd8f659d998be5c1d547786de2411b5e85 100644 --- a/Processes/Sibyll/testSibyll.cc +++ b/Processes/Sibyll/testSibyll.cc @@ -163,12 +163,10 @@ TEST_CASE("SibyllInterface", "[processes]") { auto projectile = view.GetProjectile(); Decay model; - CheckDecay checkModel; model.Init(); /*[[maybe_unused]] const process::EProcessReturn ret =*/model.DoDecay(projectile); // run checks - checkModel.DoSecondaries(view); [[maybe_unused]] const TimeType time = model.GetLifetime(particle); }