IAP GITLAB

Skip to content
Snippets Groups Projects
Commit d34cdcc8 authored by Felix Riehn's avatar Felix Riehn Committed by ralfulrich
Browse files

change threshold to kinetic energy for proposal and energy loss modules

parent f2dd4868
No related branches found
No related tags found
1 merge request!337Resolve "Add kinetic energy getter for particles"
...@@ -180,14 +180,15 @@ namespace corsika { ...@@ -180,14 +180,15 @@ namespace corsika {
auto constexpr dX = 1_g / square(1_cm); auto constexpr dX = 1_g / square(1_cm);
auto const dEdX = -getTotalEnergyLoss(vParticle, dX) / dX; auto const dEdX = -getTotalEnergyLoss(vParticle, dX) / dX;
auto const energy = vParticle.getEnergy(); auto const energy = vParticle.getEnergy();
auto const energy_lim = std::max( auto const energy_lim =
energy * 0.9, // either 10% relative loss max., or std::max(energy * 0.9, // either 10% relative loss max., or
get_energy_threshold(vParticle.getPID()) // energy thresholds globally defined for get_kinetic_energy_threshold(vParticle.getPID()) +
// individual particles get_mass(vParticle.getPID()) // energy thresholds globally defined
* 0.99999 // need to go slightly below global e-cut to assure removal in // for individual particles
// ParticleCut. This does not matter since at cut-time the entire * 0.99999 // need to go slightly below global e-cut to assure removal in
// energy is removed. // ParticleCut. The 1% does not matter since at cut-time
); // the entire energy is removed.
);
auto const maxGrammage = (vParticle.getEnergy() - energy_lim) / dEdX; auto const maxGrammage = (vParticle.getEnergy() - energy_lim) / dEdX;
return vParticle.getNode()->getModelProperties().getArclengthFromGrammage( return vParticle.getNode()->getModelProperties().getArclengthFromGrammage(
......
...@@ -33,8 +33,9 @@ namespace corsika::proposal { ...@@ -33,8 +33,9 @@ namespace corsika::proposal {
// interpolate the crosssection for given media and energy cut. These may // interpolate the crosssection for given media and energy cut. These may
// take some minutes if you have to build the tables and cannot read the // take some minutes if you have to build the tables and cannot read the
// from disk // from disk
auto const emCut = get_energy_threshold( auto const emCut =
code); //! energy thresholds globally defined for individual particles get_kinetic_energy_threshold(code) +
get_mass(code); //! energy thresholds globally defined for individual particles
auto c = p_cross->second(media.at(comp.getHash()), emCut); auto c = p_cross->second(media.at(comp.getHash()), emCut);
// Build displacement integral and scattering object and interpolate them too and // Build displacement integral and scattering object and interpolate them too and
......
...@@ -36,8 +36,9 @@ namespace corsika::proposal { ...@@ -36,8 +36,9 @@ namespace corsika::proposal {
// interpolate the crosssection for given media and energy cut. These may // interpolate the crosssection for given media and energy cut. These may
// take some minutes if you have to build the tables and cannot read the // take some minutes if you have to build the tables and cannot read the
// from disk // from disk
auto const emCut = get_energy_threshold( auto const emCut =
code); //! energy thresholds globally defined for individual particles get_kinetic_energy_threshold(code) +
get_mass(code); //! energy thresholds globally defined for individual particles
auto c = p_cross->second(media.at(comp.getHash()), emCut); auto c = p_cross->second(media.at(comp.getHash()), emCut);
......
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