IAP GITLAB

Skip to content
Snippets Groups Projects
Commit fd9282af authored by Maximilian Sackel's avatar Maximilian Sackel Committed by Ralf Ulrich
Browse files

some minor bug fixes for previous commit

parent a15c879a
No related branches found
No related tags found
1 merge request!245Include proposal process rebase
...@@ -8,10 +8,8 @@ ...@@ -8,10 +8,8 @@
#include <corsika/units/PhysicalUnits.h> #include <corsika/units/PhysicalUnits.h>
#include <corsika/utl/COMBoost.h> #include <corsika/utl/COMBoost.h>
#include <limits> #include <limits>
#include <map>
#include <memory> #include <memory>
#include <random> #include <random>
#include <set>
#include <tuple> #include <tuple>
using Component_PROPOSAL = PROPOSAL::Components::Component; using Component_PROPOSAL = PROPOSAL::Components::Component;
...@@ -21,7 +19,6 @@ namespace corsika::process::proposal { ...@@ -21,7 +19,6 @@ namespace corsika::process::proposal {
using namespace corsika::environment; using namespace corsika::environment;
using namespace corsika::units::si; using namespace corsika::units::si;
template <>
std::unordered_map<particles::Code, PROPOSAL::ParticleDef> Interaction::particles{ std::unordered_map<particles::Code, PROPOSAL::ParticleDef> Interaction::particles{
{particles::Code::Gamma, PROPOSAL::GammaDef()}, {particles::Code::Gamma, PROPOSAL::GammaDef()},
{particles::Code::Electron, PROPOSAL::EMinusDef()}, {particles::Code::Electron, PROPOSAL::EMinusDef()},
...@@ -36,15 +33,14 @@ namespace corsika::process::proposal { ...@@ -36,15 +33,14 @@ namespace corsika::process::proposal {
auto search = particles.find(pcode); auto search = particles.find(pcode);
if (search != particles.end()) return true; if (search != particles.end()) return true;
return false; return false;
}; }
template <> template <>
Interaction::Interaction(SetupEnvironment const& env, CORSIKA_ParticleCut const& e_cut) Interaction::Interaction(SetupEnvironment const& _env, CORSIKA_ParticleCut const& _cut)
: fEnvironment(env) : cut(make_shared<const PROPOSAL::EnergyCutSettings>(_cut.GetCutEnergy() / 1_GeV, 1,
, cut(make_shared<const PROPOSAL::EnergyCutSettings>(e_cut.GetCutEnergy() / 1_GeV, false)) {
1, false)) {
auto all_compositions = std::vector<NuclearComposition>(); auto all_compositions = std::vector<NuclearComposition>();
fEnvironment.GetUniverse()->walk([&](auto& vtn) { _env.GetUniverse()->walk([&](auto& vtn) {
if (vtn.HasModelProperties()) if (vtn.HasModelProperties())
all_compositions.push_back(vtn.GetModelProperties().GetNuclearComposition()); all_compositions.push_back(vtn.GetModelProperties().GetNuclearComposition());
}); });
...@@ -63,10 +59,8 @@ namespace corsika::process::proposal { ...@@ -63,10 +59,8 @@ namespace corsika::process::proposal {
} }
} }
template <>
void Interaction::Init() {} void Interaction::Init() {}
template <>
template <> template <>
corsika::process::EProcessReturn Interaction::DoInteraction( corsika::process::EProcessReturn Interaction::DoInteraction(
setup::StackView::StackIterator& vP) { setup::StackView::StackIterator& vP) {
...@@ -109,7 +103,6 @@ namespace corsika::process::proposal { ...@@ -109,7 +103,6 @@ namespace corsika::process::proposal {
return process::EProcessReturn::eOk; return process::EProcessReturn::eOk;
} }
template <>
template <> template <>
corsika::units::si::GrammageType Interaction::GetInteractionLength( corsika::units::si::GrammageType Interaction::GetInteractionLength(
setup::Stack::StackIterator& vP) { setup::Stack::StackIterator& vP) {
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <corsika/process/particle_cut/ParticleCut.h> #include <corsika/process/particle_cut/ParticleCut.h>
#include <corsika/random/RNGManager.h> #include <corsika/random/RNGManager.h>
#include <corsika/random/UniformRealDistribution.h> #include <corsika/random/UniformRealDistribution.h>
#include <random>
#include <unordered_map> #include <unordered_map>
#include "PROPOSAL/PROPOSAL.h" #include "PROPOSAL/PROPOSAL.h"
...@@ -29,14 +28,13 @@ namespace corsika::process::proposal { ...@@ -29,14 +28,13 @@ namespace corsika::process::proposal {
class Interaction : public corsika::process::InteractionProcess<Interaction> { class Interaction : public corsika::process::InteractionProcess<Interaction> {
private:
shared_ptr<const PROPOSAL::EnergyCutSettings> cut; shared_ptr<const PROPOSAL::EnergyCutSettings> cut;
static std::unordered_map<particles::Code, PROPOSAL::ParticleDef> particles; static std::unordered_map<particles::Code, PROPOSAL::ParticleDef> particles;
std::unordered_map<const NuclearComposition*, PROPOSAL::Medium> media; std::unordered_map<const NuclearComposition*, PROPOSAL::Medium> media;
corsika::random::RNG& fRNG = corsika::random::RNG& fRNG =
corsika::random::RNGManager::GetInstance().GetRandomStream("p_rndm"); corsika::random::RNGManager::GetInstance().GetRandomStream("proposal");
bool CanInteract(particles::Code pcode) const noexcept; bool CanInteract(particles::Code pcode) const noexcept;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment