diff --git a/Documentation/Examples/CMakeLists.txt b/Documentation/Examples/CMakeLists.txt index afb1a5f60ecbbb3df423a10393fdd509c21f2ec8..1c4a2e76c84b9d32a567fd07792987841416b784 100644 --- a/Documentation/Examples/CMakeLists.txt +++ b/Documentation/Examples/CMakeLists.txt @@ -14,73 +14,26 @@ target_link_libraries (stack_example SuperStupidStack CORSIKAunits) # address sanitizer is making this example too slow, so we only do "undefined" CORSIKA_ADD_EXAMPLE (boundary_example) target_link_libraries (boundary_example - SuperStupidStack - CORSIKAunits - CORSIKAlogging - CORSIKArandom - ProcessSibyll - ProcessProposal - CORSIKAcascade - ProcessTrackWriter - ProcessParticleCut - ProcessTrackingLine - CORSIKAprocesses - CORSIKAparticles - CORSIKAgeometry - CORSIKAenvironment - CORSIKAprocesssequence - ) - -CORSIKA_ADD_EXAMPLE (cascade_example) -target_link_libraries (cascade_example - SuperStupidStack - CORSIKAunits - CORSIKAlogging - CORSIKArandom - ProcessSibyll - CORSIKAcascade - ProcessEnergyLoss - ProcessTrackWriter - ProcessStackInspector - ProcessTrackingLine - ProcessParticleCut - ProcessHadronicElasticModel - ProcessStackInspector - CORSIKAprocesses - CORSIKAcascade - CORSIKAparticles - CORSIKAgeometry - CORSIKAenvironment - CORSIKAprocesssequence - ) - -if (Pythia8_FOUND) - CORSIKA_ADD_EXAMPLE (cascade_proton_example) - target_link_libraries (cascade_proton_example SuperStupidStack CORSIKAunits CORSIKAlogging CORSIKArandom ProcessSibyll ProcessPythia8 + ProcessProposal CORSIKAcascade - ProcessEnergyLoss ProcessTrackWriter - ProcessStackInspector - ProcessTrackingLine ProcessParticleCut - ProcessHadronicElasticModel - ProcessStackInspector + ProcessTrackingLine CORSIKAprocesses - CORSIKAcascade CORSIKAparticles CORSIKAgeometry CORSIKAenvironment CORSIKAprocesssequence ) - CORSIKA_ADD_EXAMPLE (vertical_EAS RUN_OPTIONS 4 2 10000.) - target_link_libraries (vertical_EAS +CORSIKA_ADD_EXAMPLE (cascade_example) +target_link_libraries (cascade_example SuperStupidStack CORSIKAunits CORSIKAlogging @@ -92,14 +45,14 @@ if (Pythia8_FOUND) CORSIKAcascade ProcessCONEXSourceCut ProcessEnergyLoss - ProcessObservationPlane - ProcessInteractionCounter ProcessTrackWriter + ProcessStackInspector ProcessTrackingLine + ProcessProposal ProcessParticleCut ProcessOnShellCheck + ProcessHadronicElasticModel ProcessStackInspector - ProcessLongitudinalProfile CORSIKAprocesses CORSIKAcascade CORSIKAparticles @@ -107,27 +60,79 @@ if (Pythia8_FOUND) CORSIKAenvironment CORSIKAprocesssequence ) + +if (Pythia8_FOUND) + CORSIKA_ADD_EXAMPLE (cascade_proton_example) + target_link_libraries (cascade_proton_example + SuperStupidStack + CORSIKAunits + CORSIKAlogging + CORSIKArandom + ProcessSibyll + ProcessPythia + CORSIKAcascade + ProcessEnergyLoss + ProcessTrackWriter + ProcessStackInspector + ProcessTrackingLine + ProcessParticleCut + ProcessHadronicElasticModel + ProcessStackInspector + CORSIKAprocesses + CORSIKAcascade + CORSIKAparticles + CORSIKAgeometry + CORSIKAenvironment + CORSIKAprocesssequence + ) + + CORSIKA_ADD_EXAMPLE (vertical_EAS RUN_OPTIONS 4 2 10000.) + target_link_libraries (vertical_EAS + SuperStupidStack + CORSIKAunits + CORSIKAlogging + CORSIKArandom + ProcessSibyll + ProcessPythia + ProcessUrQMD + ProcessSwitch + CORSIKAcascade + ProcessEnergyLoss + ProcessObservationPlane + ProcessInteractionCounter + ProcessTrackWriter + ProcessTrackingLine + ProcessParticleCut + ProcessStackInspector + ProcessLongitudinalProfile + CORSIKAprocesses + CORSIKAcascade + CORSIKAparticles + CORSIKAgeometry + CORSIKAenvironment + CORSIKAprocesssequence + ) endif() CORSIKA_ADD_EXAMPLE (stopping_power stopping_power) target_link_libraries (stopping_power - SuperStupidStack - CORSIKAunits - ProcessEnergyLoss - CORSIKAparticles - CORSIKAgeometry - CORSIKAenvironment - ) + SuperStupidStack + CORSIKAunits + ProcessEnergyLoss + CORSIKAparticles + CORSIKAgeometry + CORSIKAenvironment + ) CORSIKA_ADD_EXAMPLE (staticsequence_example) target_link_libraries (staticsequence_example - CORSIKAprocesssequence - CORSIKAunits - CORSIKAgeometry - CORSIKAlogging) + CORSIKAprocesssequence + CORSIKAunits + CORSIKAgeometry + CORSIKAlogging) CORSIKA_ADD_EXAMPLE (proposal_example RUN_OPTIONS 100.) - target_link_libraries (proposal_example +target_link_libraries (proposal_example SuperStupidStack CORSIKAunits CORSIKAlogging @@ -136,6 +141,7 @@ CORSIKA_ADD_EXAMPLE (proposal_example RUN_OPTIONS 100.) ProcessObservationPlane ProcessInteractionCounter ProcessTrackWriter + ProcessProposal ProcessTrackingLine ProcessParticleCut ProcessStackInspector @@ -146,4 +152,4 @@ CORSIKA_ADD_EXAMPLE (proposal_example RUN_OPTIONS 100.) CORSIKAgeometry CORSIKAenvironment CORSIKAprocesssequence -) + ) diff --git a/Documentation/Examples/proposal_example.cc b/Documentation/Examples/proposal_example.cc index eb04a77a4054e2b5aa9af36ffb125e44cba7af61..002845600afc9aff29466ae65352d84d42112f42 100644 --- a/Documentation/Examples/proposal_example.cc +++ b/Documentation/Examples/proposal_example.cc @@ -28,6 +28,8 @@ #include <corsika/units/PhysicalUnits.h> #include <corsika/utl/CorsikaFenv.h> +#include <corsika/process/proposal/Interaction.h> + #include <iomanip> #include <iostream> #include <limits> @@ -48,6 +50,7 @@ using namespace corsika::units::si; void registerRandomStreams() { random::RNGManager::GetInstance().RegisterRandomStream("cascade"); + random::RNGManager::GetInstance().RegisterRandomStream("proposal"); // add PROPOSAL here (?) random::RNGManager::GetInstance().SeedAll(); } @@ -129,10 +132,12 @@ int main(int argc, char** argv) { // setup processes, decays and interactions // PROPOSAL processs proposal{...}; + process::particle_cut::ParticleCut cut(10_GeV); + process::proposal::Interaction proposal(env, cut); process::interaction_counter::InteractionCounter proposalCounted(proposal); // energy cut; n.b. ParticleCut needs to be modified not to discard EM particles! - process::particle_cut::ParticleCut cut{60_GeV}; + /* process::particle_cut::ParticleCut cut{60_GeV}; */ // long. profile; columns for gamma, e+, e- still need to be added process::longitudinal_profile::LongitudinalProfile longprof{showerAxis}; @@ -141,7 +146,7 @@ int main(int argc, char** argv) { process::observation_plane::ObservationPlane observationLevel(obsPlane, "particles.dat"); - auto sequence = proposalCounted << longprof << cut << observationLevel; + auto sequence = proposalCounted << longprof << proposal << cut << observationLevel; // define air shower object, run simulation tracking_line::TrackingLine tracking; diff --git a/Processes/Proposal/Interaction.cc b/Processes/Proposal/Interaction.cc index 97364849368ec7509f3de53ae80ea08b6d66e563..ea9186b019b56ab48a8dd2e41b757cf35ed0c745 100644 --- a/Processes/Proposal/Interaction.cc +++ b/Processes/Proposal/Interaction.cc @@ -105,7 +105,7 @@ namespace corsika::process::proposal { template <> corsika::units::si::GrammageType Interaction::GetInteractionLength( - setup::Stack::StackIterator& vP) { + setup::Stack::StackIterator const& vP) { if (CanInteract(vP.GetPID())) { auto calc = GetCalculator(vP); // [CrossSections] std::uniform_real_distribution<double> distr(0., 1.); diff --git a/Processes/Proposal/Interaction.h b/Processes/Proposal/Interaction.h index 0598aef9ce0c00d86884cd8e664bf9f5a3c23d76..d4b3c103a4380c10332f506e312397b3140c8769 100644 --- a/Processes/Proposal/Interaction.h +++ b/Processes/Proposal/Interaction.h @@ -70,7 +70,7 @@ namespace corsika::process::proposal { corsika::process::EProcessReturn DoInteraction(Particle&); template <typename TParticle> - corsika::units::si::GrammageType GetInteractionLength(TParticle& p); + corsika::units::si::GrammageType GetInteractionLength(TParticle const& p); }; } // namespace corsika::process::proposal #endif