From fd9282af801a361f090d848a0b80ab7920c5ec9a Mon Sep 17 00:00:00 2001 From: Maximilian Sackel <maximilian.sackel@tu-dortmund.de> Date: Mon, 22 Jun 2020 20:53:46 +0000 Subject: [PATCH] some minor bug fixes for previous commit --- Processes/Proposal/Interaction.cc | 17 +++++------------ Processes/Proposal/Interaction.h | 4 +--- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Processes/Proposal/Interaction.cc b/Processes/Proposal/Interaction.cc index f84ea98b5..973648493 100644 --- a/Processes/Proposal/Interaction.cc +++ b/Processes/Proposal/Interaction.cc @@ -8,10 +8,8 @@ #include <corsika/units/PhysicalUnits.h> #include <corsika/utl/COMBoost.h> #include <limits> -#include <map> #include <memory> #include <random> -#include <set> #include <tuple> using Component_PROPOSAL = PROPOSAL::Components::Component; @@ -21,7 +19,6 @@ namespace corsika::process::proposal { using namespace corsika::environment; using namespace corsika::units::si; - template <> std::unordered_map<particles::Code, PROPOSAL::ParticleDef> Interaction::particles{ {particles::Code::Gamma, PROPOSAL::GammaDef()}, {particles::Code::Electron, PROPOSAL::EMinusDef()}, @@ -36,15 +33,14 @@ namespace corsika::process::proposal { auto search = particles.find(pcode); if (search != particles.end()) return true; return false; - }; + } template <> - Interaction::Interaction(SetupEnvironment const& env, CORSIKA_ParticleCut const& e_cut) - : fEnvironment(env) - , cut(make_shared<const PROPOSAL::EnergyCutSettings>(e_cut.GetCutEnergy() / 1_GeV, - 1, false)) { + Interaction::Interaction(SetupEnvironment const& _env, CORSIKA_ParticleCut const& _cut) + : cut(make_shared<const PROPOSAL::EnergyCutSettings>(_cut.GetCutEnergy() / 1_GeV, 1, + false)) { auto all_compositions = std::vector<NuclearComposition>(); - fEnvironment.GetUniverse()->walk([&](auto& vtn) { + _env.GetUniverse()->walk([&](auto& vtn) { if (vtn.HasModelProperties()) all_compositions.push_back(vtn.GetModelProperties().GetNuclearComposition()); }); @@ -63,10 +59,8 @@ namespace corsika::process::proposal { } } - template <> void Interaction::Init() {} - template <> template <> corsika::process::EProcessReturn Interaction::DoInteraction( setup::StackView::StackIterator& vP) { @@ -109,7 +103,6 @@ namespace corsika::process::proposal { return process::EProcessReturn::eOk; } - template <> template <> corsika::units::si::GrammageType Interaction::GetInteractionLength( setup::Stack::StackIterator& vP) { diff --git a/Processes/Proposal/Interaction.h b/Processes/Proposal/Interaction.h index 6eff905a8..0598aef9c 100644 --- a/Processes/Proposal/Interaction.h +++ b/Processes/Proposal/Interaction.h @@ -17,7 +17,6 @@ #include <corsika/process/particle_cut/ParticleCut.h> #include <corsika/random/RNGManager.h> #include <corsika/random/UniformRealDistribution.h> -#include <random> #include <unordered_map> #include "PROPOSAL/PROPOSAL.h" @@ -29,14 +28,13 @@ namespace corsika::process::proposal { class Interaction : public corsika::process::InteractionProcess<Interaction> { - private: shared_ptr<const PROPOSAL::EnergyCutSettings> cut; static std::unordered_map<particles::Code, PROPOSAL::ParticleDef> particles; std::unordered_map<const NuclearComposition*, PROPOSAL::Medium> media; corsika::random::RNG& fRNG = - corsika::random::RNGManager::GetInstance().GetRandomStream("p_rndm"); + corsika::random::RNGManager::GetInstance().GetRandomStream("proposal"); bool CanInteract(particles::Code pcode) const noexcept; -- GitLab