IAP GITLAB

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

call code conversion after isValid when it's guaranteed to not throw

parent 6b06b403
No related branches found
No related tags found
1 merge request!468Resolve "Add FLUKA"
...@@ -50,7 +50,6 @@ namespace corsika::fluka { ...@@ -50,7 +50,6 @@ namespace corsika::fluka {
HEPEnergyType /*sqrtS*/) const { HEPEnergyType /*sqrtS*/) const {
if (!fluka::canInteract(projectileID)) { if (!fluka::canInteract(projectileID)) {
// invalid projectile // invalid projectile
//~ std::cout << "invalid projecile (cannot interact)";
return false; return false;
} }
...@@ -81,8 +80,6 @@ namespace corsika::fluka { ...@@ -81,8 +80,6 @@ namespace corsika::fluka {
inline CrossSectionType InteractionModel::getCrossSection( inline CrossSectionType InteractionModel::getCrossSection(
Code const projectileId, Code const targetId, FourMomentum const& projectileP4, Code const projectileId, Code const targetId, FourMomentum const& projectileP4,
FourMomentum const& targetP4) const { FourMomentum const& targetP4) const {
auto const flukaCodeProj =
static_cast<FLUKACodeIntType>(convertToFluka(projectileId));
auto const flukaMaterial = getMaterialIndex(targetId); auto const flukaMaterial = getMaterialIndex(targetId);
HEPEnergyType const sqrtS = (projectileP4 + targetP4).getNorm(); HEPEnergyType const sqrtS = (projectileP4 + targetP4).getNorm();
...@@ -98,6 +95,8 @@ namespace corsika::fluka { ...@@ -98,6 +95,8 @@ namespace corsika::fluka {
auto const plab = projectileLab4mom.getSpaceLikeComponents(); auto const plab = projectileLab4mom.getSpaceLikeComponents();
CORSIKA_LOGGER_DEBUG(logger_, fmt::format("Elab = {} GeV", Elab * invGeV)); CORSIKA_LOGGER_DEBUG(logger_, fmt::format("Elab = {} GeV", Elab * invGeV));
auto const flukaCodeProj =
static_cast<FLUKACodeIntType>(convertToFluka(projectileId));
double const dummyEkin = 0; double const dummyEkin = 0;
CrossSectionType const xs = ::fluka::sgmxyz_(&flukaCodeProj, &flukaMaterial, CrossSectionType const xs = ::fluka::sgmxyz_(&flukaCodeProj, &flukaMaterial,
......
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