IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 60a345b5 authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan: Committed by Maximilian Reininghaus
Browse files

use tabulated cross-sections in UrQMD

parent 8a9ba767
No related branches found
No related tags found
2 merge requests!234WIP: Initial example of python as script language from C++,!205UrQMD improvements
...@@ -185,22 +185,24 @@ CrossSectionType UrQMD::GetCrossSection(particles::Code vProjectileCode, ...@@ -185,22 +185,24 @@ CrossSectionType UrQMD::GetCrossSection(particles::Code vProjectileCode,
template <typename TParticle> // need template here, as this is called both with template <typename TParticle> // need template here, as this is called both with
// SetupParticle as well as SetupProjectile // SetupParticle as well as SetupProjectile
CrossSectionType UrQMD::GetCrossSection(TParticle const& vProjectile, CrossSectionType UrQMD::GetCrossSection(TParticle const& projectile,
corsika::particles::Code vTargetCode) const { corsika::particles::Code targetCode) const {
// TODO: return 0 for non-hadrons? // TODO: return 0 for non-hadrons?
auto const projectileCode = vProjectile.GetPID(); auto const projectileCode = projectile.GetPID();
auto const projectileEnergyLab = vProjectile.GetEnergy(); auto const projectileEnergyLab = projectile.GetEnergy();
if (projectileCode == particles::Code::K0Long) { return GetTabulatedCrossSection(projectileCode, targetCode, projectileEnergyLab);
return 0.5 *
(GetCrossSection(particles::Code::K0, vTargetCode, projectileEnergyLab) + // if (projectileCode == particles::Code::K0Long) {
GetCrossSection(particles::Code::K0Bar, vTargetCode, projectileEnergyLab)); // return 0.5 *
} // (GetCrossSection(particles::Code::K0, vTargetCode, projectileEnergyLab) +
// GetCrossSection(particles::Code::K0Bar, vTargetCode, projectileEnergyLab));
// }
int const Ap = // int const Ap =
(projectileCode == particles::Code::Nucleus) ? vProjectile.GetNuclearA() : 1; // (projectileCode == particles::Code::Nucleus) ? vProjectile.GetNuclearA() : 1;
return GetCrossSection(projectileCode, vTargetCode, projectileEnergyLab, Ap); // return GetCrossSection(projectileCode, vTargetCode, projectileEnergyLab, Ap);
} }
bool UrQMD::CanInteract(particles::Code vCode) const { bool UrQMD::CanInteract(particles::Code vCode) const {
...@@ -210,10 +212,10 @@ bool UrQMD::CanInteract(particles::Code vCode) const { ...@@ -210,10 +212,10 @@ bool UrQMD::CanInteract(particles::Code vCode) const {
// TODO: Charmed mesons should be added to the list, too // TODO: Charmed mesons should be added to the list, too
static particles::Code const validProjectileCodes[] = { static particles::Code const validProjectileCodes[] = {
particles::Code::Nucleus, particles::Code::Proton, particles::Code::AntiProton, particles::Code::Proton, particles::Code::AntiProton, particles::Code::Neutron,
particles::Code::Neutron, particles::Code::AntiNeutron, particles::Code::PiPlus, particles::Code::AntiNeutron, particles::Code::PiPlus, particles::Code::PiMinus,
particles::Code::PiMinus, particles::Code::KPlus, particles::Code::KMinus, particles::Code::KPlus, particles::Code::KMinus, particles::Code::K0Short,
particles::Code::K0, particles::Code::K0Bar, particles::Code::K0Long}; particles::Code::K0Long};
return std::find(std::cbegin(validProjectileCodes), std::cend(validProjectileCodes), return std::find(std::cbegin(validProjectileCodes), std::cend(validProjectileCodes),
vCode) != std::cend(validProjectileCodes); vCode) != std::cend(validProjectileCodes);
......
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