diff --git a/Documentation/Examples/boundary_example.cc b/Documentation/Examples/boundary_example.cc index f9839a7b2685cf972a191034a53bd4b6008e1023..d0857537ffa5729b9dbf3d3c977175b5d6c88866 100644 --- a/Documentation/Examples/boundary_example.cc +++ b/Documentation/Examples/boundary_example.cc @@ -122,6 +122,7 @@ 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); @@ -129,7 +130,7 @@ int main() { MyBoundaryCrossingProcess<true> boundaryCrossing("crossings.dat"); // assemble all processes into an ordered process list - auto sequence = sibyll << decay << cut << boundaryCrossing << trackWriter; + auto sequence = sibyll << decay << checkDecay << 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 3b5d561005c4cb2bb904c0fff358979ec5d2b5b6..31281b56bbb15d6c4871490669d83449bb8a32bd 100644 --- a/Documentation/Examples/cascade_example.cc +++ b/Documentation/Examples/cascade_example.cc @@ -99,7 +99,7 @@ int main() { const int nuclA = 4; const int nuclZ = int(nuclA / 2.15 + 0.7); const HEPMassType mass = GetNucleusMass(nuclA, nuclZ); - const HEPEnergyType E0 = nuclA * 1_TeV; + const HEPEnergyType E0 = nuclA * 100_TeV; double theta = 0.; double phi = 0.; @@ -135,13 +135,14 @@ 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 << eLoss << cut + auto sequence = stackInspect << sibyll << sibyllNuc << decay << checkDecay << eLoss << cut << trackWriter; // define air shower object, run simulation diff --git a/Documentation/Examples/vertical_EAS.cc b/Documentation/Examples/vertical_EAS.cc index 0b3d4641a8fa6db56ea407049ceef2332d185228..0b9a8537c7a9dba2dbb329ffeaccbb08541147cc 100644 --- a/Documentation/Examples/vertical_EAS.cc +++ b/Documentation/Examples/vertical_EAS.cc @@ -129,13 +129,14 @@ 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 << eLoss << cut << stackInspect; + auto sequence = sibyll << sibyllNuc << decay << checkDecay << eLoss << cut << stackInspect; // define air shower object, run simulation cascade::Cascade EAS(env, tracking, sequence, stack); diff --git a/Processes/Sibyll/Decay.cc b/Processes/Sibyll/Decay.cc index f7f0c1f360279bb4e968da747dd59d53cbe79b9f..595d3b1b0c9e993e3423fb8b3c90018ad63af403 100644 --- a/Processes/Sibyll/Decay.cc +++ b/Processes/Sibyll/Decay.cc @@ -167,10 +167,10 @@ namespace corsika::process::sibyll { } template <> - EProcessReturn Decay::DoSecondaries(SetupView& vS) { // corsika::setup::StackView&vS){} + 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::Decay: Particle decays into itself!"); + throw std::runtime_error("Sibyll::CheckDecay: Particle decays into itself!"); /* here we could also post-process the decay products and let short-lived resonances diff --git a/Processes/Sibyll/Decay.h b/Processes/Sibyll/Decay.h index 745a83072814f60fb017703ab2a8c286eaa11b7e..c332aed6951da72345be6584dfd8b201dd04dedc 100644 --- a/Processes/Sibyll/Decay.h +++ b/Processes/Sibyll/Decay.h @@ -13,6 +13,7 @@ #include <corsika/particles/ParticleProperties.h> #include <corsika/process/DecayProcess.h> +#include <corsika/process/SecondariesProcess.h> #include <vector> @@ -54,6 +55,15 @@ namespace corsika::process { template <typename TParticleView> 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 diff --git a/Processes/Sibyll/testSibyll.cc b/Processes/Sibyll/testSibyll.cc index 3a0f365d587a95680f8464a6dc3464f25bbafc40..9da1dc0d0d1ae1265368b4238603bd676bbf3b56 100644 --- a/Processes/Sibyll/testSibyll.cc +++ b/Processes/Sibyll/testSibyll.cc @@ -158,19 +158,21 @@ TEST_CASE("SibyllInterface", "[processes]") { auto particle = stack.AddParticle( std::tuple<particles::Code, units::si::HEPEnergyType, corsika::stack::MomentumVector, geometry::Point, units::si::TimeType>{ - particles::Code::Proton, E0, plab, pos, 0_ns}); + particles::Code::Lambda0, E0, plab, pos, 0_ns}); corsika::stack::SecondaryView view(particle); auto projectile = view.GetProjectile(); Decay model; - + CheckDecay checkModel; + model.Init(); /*[[maybe_unused]] const process::EProcessReturn ret =*/model.DoDecay(projectile); // run checks - model.DoSecondaries(view); + checkModel.DoSecondaries(view); [[maybe_unused]] const TimeType time = model.GetLifetime(particle); } + SECTION("DecayConfiguration") { Decay model;