IAP GITLAB

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

fix physical factors for energy conversions

parent 063f8edf
No related branches found
No related tags found
1 merge request!245Include proposal process rebase
...@@ -39,8 +39,8 @@ namespace corsika::process::proposal { ...@@ -39,8 +39,8 @@ namespace corsika::process::proposal {
Interaction::Interaction(SetupEnvironment const& _env, CORSIKA_ParticleCut const& _cut) Interaction::Interaction(SetupEnvironment const& _env, CORSIKA_ParticleCut const& _cut)
: cut(make_shared<const PROPOSAL::EnergyCutSettings>(_cut.GetECut() / 1_MeV, 1, : cut(make_shared<const PROPOSAL::EnergyCutSettings>(_cut.GetECut() / 1_MeV, 1,
false)) { false)) {
std::cout << "corsika set cut to " << _cut.GetECut() / 1_GeV << " [GeV]" << std::endl; std::cout << "corsika set cut to " << _cut.GetECut() / 1_GeV << " [GeV]" << std::endl;
std::cout << "proposal set ecut to " << cut->GetEcut() << " [MeV]" << std::endl; std::cout << "proposal set ecut to " << cut->GetEcut() << " [MeV]" << std::endl;
auto all_compositions = std::vector<const NuclearComposition*>(); auto all_compositions = std::vector<const NuclearComposition*>();
_env.GetUniverse()->walk([&](auto& vtn) { _env.GetUniverse()->walk([&](auto& vtn) {
if (vtn.HasModelProperties()) { if (vtn.HasModelProperties()) {
...@@ -72,12 +72,13 @@ namespace corsika::process::proposal { ...@@ -72,12 +72,13 @@ namespace corsika::process::proposal {
std::uniform_real_distribution<double> distr(0., 1.); std::uniform_real_distribution<double> distr(0., 1.);
auto [type, comp_ptr, v] = auto [type, comp_ptr, v] =
std::get<INTERACTION>(calc->second) std::get<INTERACTION>(calc->second)
->TypeInteraction(vP.GetEnergy() / 1_GeV, distr(fRNG)); ->TypeInteraction(vP.GetEnergy() / 1_MeV, distr(fRNG));
std::cout << "InteractionType: "<< static_cast<int>(type) << std::endl;
auto rnd = std::vector<double>(); auto rnd = std::vector<double>();
for (size_t i = 0; for (size_t i = 0;
i < std::get<SECONDARIES>(calc->second).RequiredRandomNumbers(type); ++i) i < std::get<SECONDARIES>(calc->second).RequiredRandomNumbers(type); ++i)
rnd.push_back(distr(fRNG)); rnd.push_back(distr(fRNG));
double primary_energy = vP.GetEnergy() / 1_GeV; double primary_energy = vP.GetEnergy() / 1_MeV;
auto point = PROPOSAL::Vector3D(vP.GetPosition().GetX() / 1_cm, auto point = PROPOSAL::Vector3D(vP.GetPosition().GetX() / 1_cm,
vP.GetPosition().GetY() / 1_cm, vP.GetPosition().GetY() / 1_cm,
vP.GetPosition().GetZ() / 1_cm); vP.GetPosition().GetZ() / 1_cm);
...@@ -112,10 +113,11 @@ namespace corsika::process::proposal { ...@@ -112,10 +113,11 @@ namespace corsika::process::proposal {
if (CanInteract(vP.GetPID())) { if (CanInteract(vP.GetPID())) {
auto calc = GetCalculator(vP); // [CrossSections] auto calc = GetCalculator(vP); // [CrossSections]
std::uniform_real_distribution<double> distr(0., 1.); std::uniform_real_distribution<double> distr(0., 1.);
auto rnd = distr(fRNG);
auto energy = get<INTERACTION>(calc->second) auto energy = get<INTERACTION>(calc->second)
->EnergyInteraction(vP.GetEnergy() / 1_GeV, distr(fRNG)); ->EnergyInteraction(vP.GetEnergy() / 1_MeV, rnd);
return get<DISPLACEMENT>(calc->second) return get<DISPLACEMENT>(calc->second)
->SolveTrackIntegral(vP.GetEnergy() / 1_GeV, energy) * ->SolveTrackIntegral(vP.GetEnergy() / 1_MeV, energy) *
1_g / 1_cm / 1_cm; 1_g / 1_cm / 1_cm;
} }
return std::numeric_limits<double>::infinity() * 1_g / (1_cm * 1_cm); return std::numeric_limits<double>::infinity() * 1_g / (1_cm * 1_cm);
......
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