IAP GITLAB

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

add: Initialize PROPOSAL Process with media dependent constants and add sternheimer constant aa.

EM-Processes which are in a different media than Air are now provided.
parent 3324153b
No related branches found
No related tags found
No related merge requests found
......@@ -41,11 +41,12 @@ namespace corsika::environment {
double corrected_density_;
State state_;
MediumType type_;
std::string symbol_;
std::string symbol_;
double Ieff_;
double Cbar_;
double x0_;
double x1_;
double aa_;
double sk_;
double dlt0_;
......@@ -63,11 +64,12 @@ namespace corsika::environment {
double Ieff() const { return Ieff_; }
double Cbar() const { return Cbar_; }
double x0() const { return x0_; }
double x1() const { return x1_; }
double sk() const { return sk_; }
double x1() const { return x1_; }
double aa() const { return aa_; }
double sk() const { return sk_; }
double dlt0() const { return dlt0_; }
};
} // namespace corsika::environment
......
......@@ -299,20 +299,24 @@ def gen_classes(media_db):
static State state() {{ return data_.state(); }}
static MediumType type() {{ return data_.type(); }}
static std::string const symbol() {{ return data_.symbol(); }}
static double Ieff() {{ return data_.Ieff(); }}
static double Cbar() {{ return data_.Cbar(); }}
static double x0() {{ return data_.x0(); }}
static double x1() {{ return data_.x1(); }}
static double aa() {{ return data_.aa(); }}
static double sk() {{ return data_.sk(); }}
static double dlt0() {{ return data_.dlt0(); }}
//static constexpr Constituents constituents() {{ return {constituents}; }}
//static constexpr Properties properties() {{ return {properties}; }}
inline static const MediumData data_ {{ "{name}", "{nice_name}", {weight}, {weight_significant_figure}, {weight_error_last_digit}, {Z_over_A}, {sternheimer_density}, {corrected_density}, State::{state}, MediumType::{type}, "{symbol}", {Ieff}, {Cbar}, {x0}, {x1}, {sk}, {dlt0} }};
inline static const MediumData data_ {{ "{name}", "{nice_name}", {weight},
{weight_significant_figure}, {weight_error_last_digit}, {Z_over_A},
{sternheimer_density}, {corrected_density}, State::{state},
MediumType::{type}, "{symbol}", {Ieff}, {Cbar}, {x0}, {x1}, {aa}, {sk}, {dlt0} }};
}};
""".format(cname=cname,
stern_label=entry["sternheimer_label"],
stern_index=entry["sternheimer_index"],
......@@ -349,15 +353,16 @@ def gen_classes(media_db):
# static constexpr State state() {{ return State::{state}; }}
# static constexpr MediumType type() {{ return MediumType::{type}; }}
# static std::string const symbol() {{ return "{symbol}"; }}
# static constexpr double Ieff() {{ return {Ieff}; }}
# static constexpr double Cbar() {{ return {Cbar}; }}
# static constexpr double x0() {{ return {x0}; }}
# static constexpr double x1() {{ return {x1}; }}
# static constexpr double aa() {{ return {aa}; }}
# static constexpr double sk() {{ return {sk}; }}
# static constexpr double dlt0() {{ return {dlt0}; }}
string += class_string
......
......@@ -15,6 +15,7 @@
#include <corsika/units/PhysicalUnits.h>
#include <corsika/utl/COMBoost.h>
#include <cstdlib>
#include <iostream>
#include <limits>
#include <memory>
#include <random>
......@@ -30,24 +31,29 @@ namespace corsika::process::proposal {
corsika::units::si::HEPEnergyType _emCut)
: emCut_(_emCut)
, fRNG(corsika::random::RNGManager::GetInstance().GetRandomStream("proposal")) {
auto all_compositions = std::vector<const environment::NuclearComposition*>();
using namespace corsika::units::si; // required for operator::_MeV
_env.GetUniverse()->walk([&](auto& vtn) {
if (vtn.HasModelProperties())
all_compositions.push_back(&vtn.GetModelProperties().GetNuclearComposition());
});
for (auto& ncarg : all_compositions) {
auto comp_vec = std::vector<PROPOSAL::Components::Component>();
auto frac_iter = ncarg->GetFractions().cbegin();
for (auto& pcode : ncarg->GetComponents()) {
comp_vec.emplace_back(GetName(pcode), GetNucleusZ(pcode), GetNucleusA(pcode),
*frac_iter);
++frac_iter;
if (vtn.HasModelProperties()) {
auto prop = &vtn.GetModelProperties();
auto medium = mediumData(prop->medium(corsika::geometry::Point(
geometry::RootCoordinateSystem::GetInstance().GetRootCoordinateSystem(), 0_cm,
0_cm, 0_cm)));
auto comp_vec = std::vector<PROPOSAL::Components::Component>();
auto comp = prop->GetNuclearComposition();
auto frac_iter = comp.GetFractions().cbegin();
for (auto& pcode : comp.GetComponents()) {
comp_vec.emplace_back(GetName(pcode), GetNucleusZ(pcode), GetNucleusA(pcode),
*frac_iter);
++frac_iter;
}
media[comp.hash()] =
PROPOSAL::Medium(medium.name(), medium.Ieff(), -medium.Cbar(), medium.aa(), medium.sk(),
medium.x0(), medium.x1(), medium.dlt0(), medium.corrected_density(), comp_vec);
}
media[ncarg->hash()] = PROPOSAL::Medium(
"Modified Air", PROPOSAL::Air().GetI(), PROPOSAL::Air().GetC(),
PROPOSAL::Air().GetA(), PROPOSAL::Air().GetM(), PROPOSAL::Air().GetX0(),
PROPOSAL::Air().GetX1(), PROPOSAL::Air().GetD0(), 1.0, comp_vec);
}
});
PROPOSAL::InterpolationDef::order_of_interpolation = 2;
PROPOSAL::InterpolationDef::nodes_cross_section = 100;
PROPOSAL::InterpolationDef::nodes_propagate = 1000;
......
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