IAP GITLAB

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

clang-format

parent 1d6a61e4
No related branches found
No related tags found
1 merge request!440Resolve "Create SIBYLL process that handles everything including nuclei"
Pipeline #7233 failed
......@@ -20,7 +20,9 @@
namespace corsika::sibyll {
inline void HadronInteractionModel::setVerbose(bool const flag) { sibyll_listing_ = flag; }
inline void HadronInteractionModel::setVerbose(bool const flag) {
sibyll_listing_ = flag;
}
inline HadronInteractionModel::HadronInteractionModel()
: sibyll_listing_(false) {
......@@ -36,9 +38,8 @@ namespace corsika::sibyll {
CORSIKA_LOG_DEBUG("Sibyll::Model n={}, Nnuc={}", count_, nucCount_);
}
inline bool constexpr HadronInteractionModel::isValid(Code const projectileId,
Code const targetId,
HEPEnergyType const sqrtSnn) const {
inline bool constexpr HadronInteractionModel::isValid(
Code const projectileId, Code const targetId, HEPEnergyType const sqrtSnn) const {
if ((minEnergyCoM_ > sqrtSnn) || (sqrtSnn > maxEnergyCoM_)) { return false; }
if (is_nucleus(targetId)) {
......@@ -57,9 +58,10 @@ namespace corsika::sibyll {
}
inline std::tuple<CrossSectionType, CrossSectionType>
HadronInteractionModel::getCrossSectionInelEla(Code const projectileId, Code const targetId,
FourMomentum const& projectileP4,
FourMomentum const& targetP4) const {
HadronInteractionModel::getCrossSectionInelEla(Code const projectileId,
Code const targetId,
FourMomentum const& projectileP4,
FourMomentum const& targetP4) const {
int targetSibCode = 1; // nucleon or particle count
if (is_nucleus(targetId)) { targetSibCode = get_nucleus_A(targetId); }
......@@ -98,10 +100,10 @@ namespace corsika::sibyll {
template <typename TSecondaryView>
inline void HadronInteractionModel::doInteraction(TSecondaryView& secondaries,
Code const projectileId,
Code const targetId,
FourMomentum const& projectileP4,
FourMomentum const& targetP4) {
Code const projectileId,
Code const targetId,
FourMomentum const& projectileP4,
FourMomentum const& targetP4) {
int targetSibCode = 1; // nucleon or particle count
if (is_nucleus(targetId)) { targetSibCode = get_nucleus_A(targetId); }
......
......@@ -5,7 +5,7 @@
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#pragma once
#include <corsika/framework/core/ParticleProperties.hpp>
......@@ -23,8 +23,9 @@ namespace corsika::sibyll {
inline HadronInteractionModel& InteractionModel::getHadronInteractionModel() {
return hadronSibyll_;
}
inline HadronInteractionModel const& InteractionModel::getHadronInteractionModel() const {
inline HadronInteractionModel const& InteractionModel::getHadronInteractionModel()
const {
return hadronSibyll_;
}
......@@ -51,9 +52,9 @@ namespace corsika::sibyll {
template <typename TSecondaries>
inline void InteractionModel::doInteraction(TSecondaries& view, Code projCode,
Code targetCode,
FourMomentum const& proj4mom,
FourMomentum const& target4mom) {
Code targetCode,
FourMomentum const& proj4mom,
FourMomentum const& target4mom) {
if (is_nucleus(projCode))
return getNuclearInteractionModel().doInteraction(view, projCode, targetCode,
proj4mom, target4mom);
......
......@@ -53,8 +53,7 @@ namespace corsika::sibyll {
} // namespace corsika::sibyll
template <typename TNucleonModel>
inline void
NuclearInteractionModel<TNucleonModel>::printCrossSectionTable(
inline void NuclearInteractionModel<TNucleonModel>::printCrossSectionTable(
Code const pCode) const {
if (!hadronicInteraction_.isValid(Code::Proton, pCode, 100_GeV)) { // LCOV_EXCL_START
CORSIKA_LOG_ERROR("Invalid target type {} for hadron interaction model.", pCode);
......@@ -86,8 +85,8 @@ namespace corsika::sibyll {
template <typename TNucleonModel>
template <typename TEnvironment>
inline void
NuclearInteractionModel<TNucleonModel>::initializeNuclearCrossSections(TEnvironment const& environment) {
inline void NuclearInteractionModel<TNucleonModel>::initializeNuclearCrossSections(
TEnvironment const& environment) {
auto const& universe = *(environment.getUniverse());
// generate complete list of all nuclei types in universe
......@@ -158,8 +157,7 @@ namespace corsika::sibyll {
}
template <typename TNucleonModel>
inline CrossSectionType
NuclearInteractionModel<TNucleonModel>::readCrossSectionTable(
inline CrossSectionType NuclearInteractionModel<TNucleonModel>::readCrossSectionTable(
int const ia, Code const pTarget, HEPEnergyType const elabnuc) const {
int const ib = targetComponentsIndex_.at(pTarget) + 1; // table index in fortran
......@@ -176,11 +174,9 @@ namespace corsika::sibyll {
}
template <typename TNucleonModel>
CrossSectionType inline NuclearInteractionModel<
TNucleonModel>::getCrossSection(Code const projectileId,
Code const targetId,
FourMomentum const& projectileP4,
FourMomentum const& targetP4) const {
CrossSectionType inline NuclearInteractionModel<TNucleonModel>::getCrossSection(
Code const projectileId, Code const targetId, FourMomentum const& projectileP4,
FourMomentum const& targetP4) const {
HEPEnergyType const sqrtSnn = (projectileP4 + targetP4).getNorm();
if (!isValid(projectileId, targetId, sqrtSnn)) { return CrossSectionType::zero(); }
......
......@@ -31,10 +31,10 @@ namespace corsika::sibyll {
* The sibyll::InteractionModel is wrapped as an InteractionProcess here in order
* to provide all the functions for ProcessSequence.
*/
struct Interaction : public InteractionModel,
public InteractionProcess<Interaction> {
template <typename TEnvironment>
Interaction(TEnvironment const& env) : InteractionModel{env} {}
struct Interaction : public InteractionModel, public InteractionProcess<Interaction> {
template <typename TEnvironment>
Interaction(TEnvironment const& env)
: InteractionModel{env} {}
};
/**
......
......@@ -28,7 +28,7 @@ namespace corsika::sibyll {
public:
template <class TEnvironment>
NuclearInteractionModel(TNucleonModel&, TEnvironment const&);
~NuclearInteractionModel();
bool constexpr isValid(Code const projectileId, Code const targetId,
......@@ -36,7 +36,7 @@ namespace corsika::sibyll {
template <class TEnvironment>
void initializeNuclearCrossSections(TEnvironment const&);
void printCrossSectionTable(Code) const;
CrossSectionType readCrossSectionTable(int const, Code const,
HEPEnergyType const) const;
......
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