From 896d611ba6b4044dfc401b8049e5b71e24ca03b4 Mon Sep 17 00:00:00 2001 From: ralfulrich <ralf.ulrich@kit.edu> Date: Wed, 3 Feb 2021 09:26:14 +0100 Subject: [PATCH] fixed a lot of inlines and other details --- .../detail/framework/analytics/ClassTimer.inl | 22 +-- .../framework/analytics/FunctionTimer.inl | 4 +- corsika/detail/framework/core/Cascade.inl | 15 +- .../framework/core/ParticleProperties.inl | 34 +++-- .../detail/framework/geometry/BaseVector.inl | 7 +- .../framework/geometry/CoordinateSystem.inl | 6 +- .../detail/framework/geometry/FourVector.inl | 40 ++--- corsika/detail/framework/geometry/Helix.inl | 10 +- corsika/detail/framework/geometry/Point.inl | 15 +- corsika/detail/framework/geometry/Vector.inl | 34 +++-- .../framework/process/InteractionCounter.inl | 2 +- .../process/InteractionHistogram.inl | 11 +- .../framework/process/ProcessSequence.inl | 30 ++-- .../process/SwitchProcessSequence.inl | 2 +- .../detail/framework/stack/CombinedStack.inl | 1 - .../detail/framework/stack/SecondaryView.inl | 59 ++++---- corsika/detail/framework/stack/Stack.inl | 142 ++++++++---------- corsika/detail/framework/utility/COMBoost.inl | 2 +- .../detail/framework/utility/CorsikaData.inl | 2 +- .../framework/utility/CorsikaFenvOSX.inl | 4 +- corsika/detail/media/BaseExponential.inl | 11 +- corsika/detail/media/Environment.inl | 15 +- corsika/detail/media/FlatExponential.inl | 20 +-- corsika/detail/media/HomogeneousMedium.inl | 17 ++- corsika/detail/media/InhomogeneousMedium.inl | 10 +- .../LayeredSphericalAtmosphereBuilder.inl | 15 +- .../media/LinearApproximationIntegrator.inl | 8 +- corsika/detail/media/MediumPropertyModel.inl | 6 +- corsika/detail/media/NuclearComposition.inl | 4 +- corsika/detail/media/ShowerAxis.inl | 20 +-- .../detail/media/SlidingPlanarExponential.inl | 12 +- .../detail/media/UniformRefractiveIndex.inl | 6 +- corsika/detail/media/Universe.inl | 4 +- corsika/detail/media/VolumeTreeNode.inl | 20 +-- corsika/detail/media/WeightProvider.inl | 12 +- .../detail/modules/HadronicElasticModel.inl | 13 +- .../detail/modules/LongitudinalProfile.inl | 12 +- corsika/detail/modules/ObservationPlane.inl | 13 +- corsika/detail/modules/OnShellCheck.inl | 8 +- corsika/detail/modules/ParticleCut.inl | 36 +++-- corsika/detail/modules/StackInspector.inl | 8 +- corsika/detail/modules/TrackWriter.inl | 8 +- corsika/detail/modules/TrackingLine.inl | 4 +- corsika/detail/modules/conex/CONEXhybrid.inl | 16 +- .../modules/energy_loss/BetheBlochPDG.inl | 40 ++--- .../modules/proposal/ContinuousProcess.inl | 24 +-- .../detail/modules/proposal/Interaction.inl | 8 +- .../modules/proposal/ProposalProcessBase.inl | 7 +- corsika/detail/modules/pythia8/Decay.inl | 34 ++--- .../detail/modules/pythia8/Interaction.inl | 25 +-- corsika/detail/modules/pythia8/Random.inl | 2 +- .../detail/modules/qgsjetII/Interaction.inl | 17 ++- .../detail/modules/qgsjetII/QGSJetIIStack.inl | 51 ++++--- .../detail/modules/qgsjetII/qgsjet-II-04.inl | 10 +- .../modules/sibyll/NuclearInteraction.inl | 21 ++- .../tracking/TrackingLeapFrogCurved.inl | 4 +- .../modules/tracking/TrackingStraight.inl | 12 +- corsika/detail/modules/urqmd/UrQMD.inl | 22 +-- corsika/detail/stack/VectorStack.inl | 4 +- .../stack/history/HistoryObservationPlane.inl | 14 +- corsika/framework/analytics/Timer.hpp | 10 +- corsika/framework/core/ParticleProperties.hpp | 6 +- .../framework/geometry/CoordinateSystem.hpp | 29 ++-- corsika/framework/geometry/FourVector.hpp | 4 +- corsika/framework/geometry/Helix.hpp | 10 +- corsika/framework/geometry/Line.hpp | 16 +- corsika/framework/geometry/Point.hpp | 20 +-- corsika/framework/geometry/QuantityVector.hpp | 4 +- corsika/framework/geometry/Vector.hpp | 20 +-- corsika/framework/process/ProcessSequence.hpp | 50 +++--- .../framework/process/SecondariesProcess.hpp | 2 +- corsika/framework/process/StackProcess.hpp | 2 +- .../process/SwitchProcessSequence.hpp | 27 ++-- corsika/framework/random/RNGManager.hpp | 21 ++- .../random/UniformRealDistribution.hpp | 12 +- corsika/framework/stack/CombinedStack.hpp | 27 ++-- corsika/framework/stack/ParticleBase.hpp | 22 ++- corsika/framework/stack/SecondaryView.hpp | 78 +++++----- corsika/framework/stack/Stack.hpp | 85 ++++++----- .../stack/StackIteratorInterface.hpp | 38 ++--- corsika/framework/utility/COMBoost.hpp | 8 +- .../framework/utility/SaveBoostHistogram.hpp | 4 +- corsika/framework/utility/Singleton.hpp | 2 - corsika/media/NameModel.hpp | 1 - corsika/media/NuclearComposition.hpp | 22 +-- corsika/media/Universe.hpp | 4 +- corsika/media/VolumeTreeNode.hpp | 29 ++-- corsika/modules/qgsjetII/Interaction.hpp | 3 - corsika/stack/DummyStack.hpp | 16 +- corsika/stack/GeometryNodeStackExtension.hpp | 36 +++-- corsika/stack/NuclearStackExtension.hpp | 58 ++++--- corsika/stack/VectorStack.hpp | 10 +- examples/vertical_EAS.cpp | 4 + tests/framework/testProcessSequence.cpp | 20 +-- tests/modules/testQGSJetII.cpp | 10 ++ 95 files changed, 868 insertions(+), 877 deletions(-) diff --git a/corsika/detail/framework/analytics/ClassTimer.inl b/corsika/detail/framework/analytics/ClassTimer.inl index dca6fb5ce..8f2c6945a 100644 --- a/corsika/detail/framework/analytics/ClassTimer.inl +++ b/corsika/detail/framework/analytics/ClassTimer.inl @@ -23,12 +23,13 @@ namespace corsika { template <typename TClass, typename TRet, typename... TArgs, TRet (TClass::*TFuncPtr)(TArgs...), typename TTimer> - ClassTimer<TRet (TClass::*)(TArgs...), TFuncPtr, TTimer>::ClassTimer(TClass& obj) + inline ClassTimer<TRet (TClass::*)(TArgs...), TFuncPtr, TTimer>::ClassTimer(TClass& obj) : ClassTimerImpl<TClass, TTimer>(obj) {} template <typename TClass, typename TRet, typename... TArgs, TRet (TClass::*TFuncPtr)(TArgs...), typename TTimer> - TRet ClassTimer<TRet (TClass::*)(TArgs...), TFuncPtr, TTimer>::call(TArgs... args) { + inline TRet ClassTimer<TRet (TClass::*)(TArgs...), TFuncPtr, TTimer>::call( + TArgs... args) { this->start_ = ClassTimerImpl<TClass, TTimer>::clock_type::now(); auto tmp = (this->obj_.*TFuncPtr)(std::forward<TArgs>(args)...); this->timeDiff_ = std::chrono::duration_cast< @@ -41,12 +42,13 @@ namespace corsika { template <typename TClass, typename... TArgs, void (TClass::*TFuncPtr)(TArgs...), typename TTimer> - ClassTimer<void (TClass::*)(TArgs...), TFuncPtr, TTimer>::ClassTimer(TClass& obj) + inline ClassTimer<void (TClass::*)(TArgs...), TFuncPtr, TTimer>::ClassTimer(TClass& obj) : ClassTimerImpl<TClass, TTimer>(obj) {} template <typename TClass, typename... TArgs, void (TClass::*TFuncPtr)(TArgs...), typename TTimer> - void ClassTimer<void (TClass::*)(TArgs...), TFuncPtr, TTimer>::call(TArgs... args) { + inline void ClassTimer<void (TClass::*)(TArgs...), TFuncPtr, TTimer>::call( + TArgs... args) { this->start_ = ClassTimerImpl<TClass, TTimer>::clock_type::now(); (this->obj_.*TFuncPtr)(std::forward<TArgs>(args)...); this->timeDiff_ = std::chrono::duration_cast< @@ -59,12 +61,13 @@ namespace corsika { template <typename TClass, typename TRet, typename... TArgs, TRet (TClass::*TFuncPtr)(TArgs...) const, typename TTimer> - ClassTimer<TRet (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::ClassTimer(TClass& obj) + inline ClassTimer<TRet (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::ClassTimer( + TClass& obj) : ClassTimerImpl<TClass, TTimer>(obj) {} template <typename TClass, typename TRet, typename... TArgs, TRet (TClass::*TFuncPtr)(TArgs...) const, typename TTimer> - TRet ClassTimer<TRet (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::call( + inline TRet ClassTimer<TRet (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::call( TArgs... args) { this->start_ = ClassTimerImpl<TClass, TTimer>::clock_type::now(); auto tmp = (this->obj_.*TFuncPtr)(std::forward<TArgs>(args)...); @@ -77,12 +80,13 @@ namespace corsika { /// Specialisation 3 template <typename TClass, typename... TArgs, void (TClass::*TFuncPtr)(TArgs...) const, typename TTimer> - ClassTimer<void (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::ClassTimer(TClass& obj) + inline ClassTimer<void (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::ClassTimer( + TClass& obj) : ClassTimerImpl<TClass, TTimer>(obj) {} template <typename TClass, typename... TArgs, void (TClass::*TFuncPtr)(TArgs...) const, typename TTimer> - void ClassTimer<void (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::call( + inline void ClassTimer<void (TClass::*)(TArgs...) const, TFuncPtr, TTimer>::call( TArgs... args) { this->start_ = ClassTimerImpl<TClass, TTimer>::clock_type::now(); (this->obj_.*TFuncPtr)(std::forward<TArgs>(args)...); @@ -92,4 +96,4 @@ namespace corsika { return; } -} // namespace corsika \ No newline at end of file +} // namespace corsika diff --git a/corsika/detail/framework/analytics/FunctionTimer.inl b/corsika/detail/framework/analytics/FunctionTimer.inl index e00bebc33..911fb683c 100644 --- a/corsika/detail/framework/analytics/FunctionTimer.inl +++ b/corsika/detail/framework/analytics/FunctionTimer.inl @@ -13,12 +13,12 @@ namespace corsika { template <typename TFunc, typename TTime> - FunctionTimer<TFunc, TTime>::FunctionTimer(TFunc f) + inline FunctionTimer<TFunc, TTime>::FunctionTimer(TFunc f) : function_(f) {} template <typename TFunc, typename TTime> template <typename... TArgs> - auto FunctionTimer<TFunc, TTime>::operator()(TArgs&&... args) + inline auto FunctionTimer<TFunc, TTime>::operator()(TArgs&&... args) -> std::invoke_result_t<TFunc, TArgs...> { this->startTimer(); auto tmp = function_(std::forward<TArgs>(args)...); diff --git a/corsika/detail/framework/core/Cascade.inl b/corsika/detail/framework/core/Cascade.inl index 75c74d2b7..5f218b878 100644 --- a/corsika/detail/framework/core/Cascade.inl +++ b/corsika/detail/framework/core/Cascade.inl @@ -28,7 +28,7 @@ namespace corsika { template <typename TTracking, typename TProcessList, typename TStack, typename TStackView> - void Cascade<TTracking, TProcessList, TStack, TStackView>::run() { + inline void Cascade<TTracking, TProcessList, TStack, TStackView>::run() { setNodes(); // put each particle on stack in correct environment volume while (!stack_.isEmpty()) { @@ -55,7 +55,7 @@ namespace corsika { template <typename TTracking, typename TProcessList, typename TStack, typename TStackView> - void Cascade<TTracking, TProcessList, TStack, TStackView>::forceInteraction() { + inline void Cascade<TTracking, TProcessList, TStack, TStackView>::forceInteraction() { CORSIKA_LOG_TRACE("forced interaction!"); setNodes(); auto vParticle = stack_.getNextParticle(); @@ -67,7 +67,8 @@ namespace corsika { template <typename TTracking, typename TProcessList, typename TStack, typename TStackView> - void Cascade<TTracking, TProcessList, TStack, TStackView>::step(Particle& vParticle) { + inline void Cascade<TTracking, TProcessList, TStack, TStackView>::step( + Particle& vParticle) { // determine combined total interaction length (inverse) InverseGrammageType const total_inv_lambda = @@ -236,7 +237,7 @@ namespace corsika { template <typename TTracking, typename TProcessList, typename TStack, typename TStackView> - ProcessReturn Cascade<TTracking, TProcessList, TStack, TStackView>::decay( + inline ProcessReturn Cascade<TTracking, TProcessList, TStack, TStackView>::decay( TStackView& view) { CORSIKA_LOG_DEBUG("decay"); InverseTimeType const actual_decay_time = sequence_.getInverseLifetime(view.parent()); @@ -254,7 +255,7 @@ namespace corsika { template <typename TTracking, typename TProcessList, typename TStack, typename TStackView> - ProcessReturn Cascade<TTracking, TProcessList, TStack, TStackView>::interaction( + inline ProcessReturn Cascade<TTracking, TProcessList, TStack, TStackView>::interaction( TStackView& view) { CORSIKA_LOG_DEBUG("collide"); @@ -274,7 +275,7 @@ namespace corsika { template <typename TTracking, typename TProcessList, typename TStack, typename TStackView> - void Cascade<TTracking, TProcessList, TStack, TStackView>::setNodes() { + inline void Cascade<TTracking, TProcessList, TStack, TStackView>::setNodes() { std::for_each(stack_.begin(), stack_.end(), [&](auto& p) { auto const* numericalNode = environment_.getUniverse()->getContainingNode(p.getPosition()); @@ -284,7 +285,7 @@ namespace corsika { template <typename TTracking, typename TProcessList, typename TStack, typename TStackView> - void Cascade<TTracking, TProcessList, TStack, TStackView>::setEventType( + inline void Cascade<TTracking, TProcessList, TStack, TStackView>::setEventType( TStackView& view, [[maybe_unused]] history::EventType eventType) { if constexpr (TStackView::has_event) { for (auto&& sec : view) { sec.getEvent()->setEventType(eventType); } diff --git a/corsika/detail/framework/core/ParticleProperties.inl b/corsika/detail/framework/core/ParticleProperties.inl index b478b1e17..7d0aa253b 100644 --- a/corsika/detail/framework/core/ParticleProperties.inl +++ b/corsika/detail/framework/core/ParticleProperties.inl @@ -13,72 +13,74 @@ namespace corsika { - HEPEnergyType constexpr get_energy_threshold(Code const p) { + inline HEPEnergyType constexpr get_energy_threshold(Code const p) { return particle::detail::thresholds[static_cast<CodeIntType>(p)]; } - void constexpr set_energy_threshold(Code const p, HEPEnergyType const val) { + inline void constexpr set_energy_threshold(Code const p, HEPEnergyType const val) { particle::detail::thresholds[static_cast<CodeIntType>(p)] = val; } - HEPMassType constexpr get_mass(Code const p) { + inline HEPMassType constexpr get_mass(Code const p) { if (p == Code::Nucleus) throw std::runtime_error("Cannot GetMass() of particle::Nucleus -> unspecified"); return particle::detail::masses[static_cast<CodeIntType>(p)]; } - PDGCode constexpr get_PDG(Code const p) { + inline PDGCode constexpr get_PDG(Code const p) { return particle::detail::pdg_codes[static_cast<CodeIntType>(p)]; } - int16_t constexpr get_charge_number(Code const code) { + inline int16_t constexpr get_charge_number(Code const code) { if (code == Code::Nucleus) throw std::runtime_error("charge of particle::Nucleus undefined"); return particle::detail::electric_charges[static_cast<CodeIntType>(code)]; } - ElectricChargeType constexpr get_charge(Code const code) { + inline ElectricChargeType constexpr get_charge(Code const code) { return get_charge_number(code) * constants::e; } - std::string_view constexpr get_name(Code const code) { + inline std::string_view constexpr get_name(Code const code) { return particle::detail::names[static_cast<CodeIntType>(code)]; } - TimeType constexpr get_lifetime(Code const p) { + inline TimeType constexpr get_lifetime(Code const p) { return particle::detail::lifetime[static_cast<CodeIntType>(p)] * second; } - bool constexpr is_hadron(Code const p) { + inline bool constexpr is_hadron(Code const p) { return particle::detail::isHadron[static_cast<CodeIntType>(p)]; } - bool constexpr is_em(Code c) { + inline bool constexpr is_em(Code c) { return c == Code::Electron || c == Code::Positron || c == Code::Gamma; } - bool constexpr is_muon(Code c) { return c == Code::MuPlus || c == Code::MuMinus; } + inline bool constexpr is_muon(Code c) { + return c == Code::MuPlus || c == Code::MuMinus; + } - bool constexpr is_neutrino(Code c) { + inline bool constexpr is_neutrino(Code c) { return c == Code::NuE || c == Code::NuMu || c == Code::NuTau || c == Code::NuEBar || c == Code::NuMuBar || c == Code::NuTauBar; } - int constexpr get_nucleus_A(Code const code) { + inline int constexpr get_nucleus_A(Code const code) { if (code == Code::Nucleus) { throw std::runtime_error("get_nucleus_A(Code::Nucleus) is impossible!"); } return particle::detail::nucleusA[static_cast<CodeIntType>(code)]; } - int constexpr get_nucleus_Z(Code const code) { + inline int constexpr get_nucleus_Z(Code const code) { if (code == Code::Nucleus) { throw std::runtime_error("get_nucleus_Z(Code::Nucleus) is impossible!"); } return particle::detail::nucleusZ[static_cast<CodeIntType>(code)]; } - bool constexpr is_nucleus(Code const code) { + inline bool constexpr is_nucleus(Code const code) { return (code == Code::Nucleus) || (get_nucleus_A(code) != 0); } @@ -102,7 +104,7 @@ namespace corsika { return get_mass(Code::Proton) * Z + (A - Z) * get_mass(Code::Neutron); } - std::initializer_list<Code> constexpr get_all_particles() { + inline std::initializer_list<Code> constexpr get_all_particles() { return particle::detail::all_particles; } diff --git a/corsika/detail/framework/geometry/BaseVector.inl b/corsika/detail/framework/geometry/BaseVector.inl index 50ec4b03b..486a62d26 100644 --- a/corsika/detail/framework/geometry/BaseVector.inl +++ b/corsika/detail/framework/geometry/BaseVector.inl @@ -14,17 +14,18 @@ namespace corsika { template <typename TDimension> - CoordinateSystemPtr BaseVector<TDimension>::getCoordinateSystem() const { + inline CoordinateSystemPtr BaseVector<TDimension>::getCoordinateSystem() const { return cs_; } template <typename TDimension> - QuantityVector<TDimension> const& BaseVector<TDimension>::getQuantityVector() const { + inline QuantityVector<TDimension> const& BaseVector<TDimension>::getQuantityVector() + const { return quantityVector_; } template <typename TDimension> - QuantityVector<TDimension>& BaseVector<TDimension>::getQuantityVector() { + inline QuantityVector<TDimension>& BaseVector<TDimension>::getQuantityVector() { return quantityVector_; } diff --git a/corsika/detail/framework/geometry/CoordinateSystem.inl b/corsika/detail/framework/geometry/CoordinateSystem.inl index efcf716d3..faa759aa7 100644 --- a/corsika/detail/framework/geometry/CoordinateSystem.inl +++ b/corsika/detail/framework/geometry/CoordinateSystem.inl @@ -19,9 +19,11 @@ namespace corsika { - CoordinateSystemPtr CoordinateSystem::getReferenceCS() const { return referenceCS_; } + inline CoordinateSystemPtr CoordinateSystem::getReferenceCS() const { + return referenceCS_; + } - EigenTransform const& CoordinateSystem::getTransform() const { return transf_; } + inline EigenTransform const& CoordinateSystem::getTransform() const { return transf_; } inline bool CoordinateSystem::operator==(CoordinateSystem const& cs) const { return referenceCS_ == cs.referenceCS_ && transf_.matrix() == cs.transf_.matrix(); diff --git a/corsika/detail/framework/geometry/FourVector.inl b/corsika/detail/framework/geometry/FourVector.inl index 6c0a039e5..5d871430d 100644 --- a/corsika/detail/framework/geometry/FourVector.inl +++ b/corsika/detail/framework/geometry/FourVector.inl @@ -15,47 +15,47 @@ namespace corsika { template <typename TTimeType, typename TSpaceVecType> - TTimeType FourVector<TTimeType, TSpaceVecType>::getTimeLikeComponent() const { + inline TTimeType FourVector<TTimeType, TSpaceVecType>::getTimeLikeComponent() const { return timeLike_; } template <typename TTimeType, typename TSpaceVecType> - TSpaceVecType& FourVector<TTimeType, TSpaceVecType>::getSpaceLikeComponents() { + inline TSpaceVecType& FourVector<TTimeType, TSpaceVecType>::getSpaceLikeComponents() { return spaceLike_; } template <typename TTimeType, typename TSpaceVecType> - TSpaceVecType const& FourVector<TTimeType, TSpaceVecType>::getSpaceLikeComponents() - const { + inline TSpaceVecType const& + FourVector<TTimeType, TSpaceVecType>::getSpaceLikeComponents() const { return spaceLike_; } template <typename TTimeType, typename TSpaceVecType> - typename FourVector<TTimeType, TSpaceVecType>::norm_square_type + inline typename FourVector<TTimeType, TSpaceVecType>::norm_square_type FourVector<TTimeType, TSpaceVecType>::getNormSqr() const { return getTimeSquared() - spaceLike_.getSquaredNorm(); } template <typename TTimeType, typename TSpaceVecType> - typename FourVector<TTimeType, TSpaceVecType>::norm_type + inline typename FourVector<TTimeType, TSpaceVecType>::norm_type FourVector<TTimeType, TSpaceVecType>::getNorm() const { return sqrt(abs(getNormSqr())); } template <typename TTimeType, typename TSpaceVecType> - bool FourVector<TTimeType, TSpaceVecType>::isTimelike() const { + inline bool FourVector<TTimeType, TSpaceVecType>::isTimelike() const { return getTimeSquared() < spaceLike_.getSquaredNorm(); } template <typename TTimeType, typename TSpaceVecType> - bool FourVector<TTimeType, TSpaceVecType>::isSpacelike() const { + inline bool FourVector<TTimeType, TSpaceVecType>::isSpacelike() const { return getTimeSquared() > spaceLike_.getSquaredNorm(); } template <typename TTimeType, typename TSpaceVecType> - FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::operator+=( - FourVector const& b) { + inline FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>:: + operator+=(FourVector const& b) { timeLike_ += b.timeLike_; spaceLike_ += b.spaceLike_; @@ -63,38 +63,38 @@ namespace corsika { } template <typename TTimeType, typename TSpaceVecType> - FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::operator-=( - FourVector const& b) { + inline FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>:: + operator-=(FourVector const& b) { timeLike_ -= b.timeLike_; spaceLike_ -= b.spaceLike_; return *this; } template <typename TTimeType, typename TSpaceVecType> - FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::operator*=( - double const b) { + inline FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>:: + operator*=(double const b) { timeLike_ *= b; spaceLike_ *= b; return *this; } template <typename TTimeType, typename TSpaceVecType> - FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::operator/=( - double const b) { + inline FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>:: + operator/=(double const b) { timeLike_ /= b; spaceLike_.getComponents() /= b; return *this; } template <typename TTimeType, typename TSpaceVecType> - FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>::operator/( - double const b) { + inline FourVector<TTimeType, TSpaceVecType>& FourVector<TTimeType, TSpaceVecType>:: + operator/(double const b) { *this /= b; return *this; } template <typename TTimeType, typename TSpaceVecType> - typename FourVector<TTimeType, TSpaceVecType>::norm_type + inline typename FourVector<TTimeType, TSpaceVecType>::norm_type FourVector<TTimeType, TSpaceVecType>::operator*(FourVector const& b) { if constexpr (std::is_same<time_type, decltype(std::declval<space_type>() / meter * second)>::value) @@ -104,7 +104,7 @@ namespace corsika { } template <typename TTimeType, typename TSpaceVecType> - typename FourVector<TTimeType, TSpaceVecType>::norm_square_type + inline typename FourVector<TTimeType, TSpaceVecType>::norm_square_type FourVector<TTimeType, TSpaceVecType>::getTimeSquared() const { if constexpr (std::is_same<time_type, decltype(std::declval<space_type>() / meter * second)>::value) diff --git a/corsika/detail/framework/geometry/Helix.inl b/corsika/detail/framework/geometry/Helix.inl index daf0c310f..03c0fd85d 100644 --- a/corsika/detail/framework/geometry/Helix.inl +++ b/corsika/detail/framework/geometry/Helix.inl @@ -15,23 +15,23 @@ namespace corsika { - LengthType Helix::getRadius() const { return radius_; } + inline LengthType Helix::getRadius() const { return radius_; } - Point Helix::getPosition(TimeType const t) const { + inline Point Helix::getPosition(TimeType const t) const { return r0_ + vPar_ * t + (vPerp_ * (std::cos(omegaC_ * t) - 1) + uPerp_ * std::sin(omegaC_ * t)) / omegaC_; } - Point Helix::getPositionFromArclength(LengthType const l) const { + inline Point Helix::getPositionFromArclength(LengthType const l) const { return getPosition(getTimeFromArclength(l)); } - LengthType Helix::getArcLength(TimeType const t1, TimeType const t2) const { + inline LengthType Helix::getArcLength(TimeType const t1, TimeType const t2) const { return (vPar_ + vPerp_).getNorm() * (t2 - t1); } - TimeType Helix::getTimeFromArclength(LengthType const l) const { + inline TimeType Helix::getTimeFromArclength(LengthType const l) const { return l / (vPar_ + vPerp_).getNorm(); } diff --git a/corsika/detail/framework/geometry/Point.inl b/corsika/detail/framework/geometry/Point.inl index 45c6900f5..c5c0a98a6 100644 --- a/corsika/detail/framework/geometry/Point.inl +++ b/corsika/detail/framework/geometry/Point.inl @@ -15,11 +15,11 @@ namespace corsika { - QuantityVector<length_d> const& Point::getCoordinates() const { + inline QuantityVector<length_d> const& Point::getCoordinates() const { return BaseVector<length_d>::getQuantityVector(); } - QuantityVector<length_d>& Point::getCoordinates() { + inline QuantityVector<length_d>& Point::getCoordinates() { return BaseVector<length_d>::getQuantityVector(); } @@ -60,7 +60,8 @@ namespace corsika { } /// this always returns a QuantityVector as triple - QuantityVector<length_d> Point::getCoordinates(CoordinateSystemPtr const& pCS) const { + inline QuantityVector<length_d> Point::getCoordinates( + CoordinateSystemPtr const& pCS) const { CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem(); if (*pCS == *cs) { return BaseVector<length_d>::getQuantityVector(); @@ -72,12 +73,12 @@ namespace corsika { } /// this always returns a QuantityVector as triple - QuantityVector<length_d>& Point::getCoordinates(CoordinateSystemPtr const& pCS) { + inline QuantityVector<length_d>& Point::getCoordinates(CoordinateSystemPtr const& pCS) { if (*pCS != *BaseVector<length_d>::getCoordinateSystem()) { rebase(pCS); } return BaseVector<length_d>::getQuantityVector(); } - void Point::rebase(CoordinateSystemPtr const& pCS) { + inline void Point::rebase(CoordinateSystemPtr const& pCS) { BaseVector<length_d>::setQuantityVector(QuantityVector<length_d>( get_transformation(*BaseVector<length_d>::getCoordinateSystem().get(), *pCS.get()) * @@ -85,12 +86,12 @@ namespace corsika { BaseVector<length_d>::setCoordinateSystem(pCS); } - Point Point::operator+(Vector<length_d> const& pVec) const { + inline Point Point::operator+(Vector<length_d> const& pVec) const { CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem(); return Point(cs, getCoordinates() + pVec.getComponents(cs)); } - Vector<length_d> Point::operator-(Point const& pB) const { + inline Vector<length_d> Point::operator-(Point const& pB) const { CoordinateSystemPtr const& cs = BaseVector<length_d>::getCoordinateSystem(); return Vector<length_d>(cs, getCoordinates() - pB.getCoordinates(cs)); } diff --git a/corsika/detail/framework/geometry/Vector.inl b/corsika/detail/framework/geometry/Vector.inl index ff968693f..352eb8b30 100644 --- a/corsika/detail/framework/geometry/Vector.inl +++ b/corsika/detail/framework/geometry/Vector.inl @@ -88,7 +88,7 @@ namespace corsika { } template <typename TDimension> - void Vector<TDimension>::rebase(CoordinateSystemPtr const& pCS) { + inline void Vector<TDimension>::rebase(CoordinateSystemPtr const& pCS) { BaseVector<TDimension>::setQuantityVector(QuantityVector<TDimension>( get_transformation(*BaseVector<TDimension>::getCoordinateSystem().get(), *pCS.get()) @@ -110,7 +110,7 @@ namespace corsika { template <typename TDimension> template <typename TDimension2> - auto Vector<TDimension>::getParallelProjectionOnto( + inline auto Vector<TDimension>::getParallelProjectionOnto( Vector<TDimension2> const& pVec, CoordinateSystemPtr const& pCS) const { auto const ourCompVec = getComponents(pCS); auto const otherCompVec = pVec.getComponents(pCS); @@ -123,34 +123,36 @@ namespace corsika { template <typename TDimension> template <typename TDimension2> - auto Vector<TDimension>::getParallelProjectionOnto( + inline auto Vector<TDimension>::getParallelProjectionOnto( Vector<TDimension2> const& pVec) const { return getParallelProjectionOnto<TDimension2>( pVec, BaseVector<TDimension>::getCoordinateSystem()); } template <typename TDimension> - Vector<TDimension> Vector<TDimension>::operator+(Vector<TDimension> const& pVec) const { + inline Vector<TDimension> Vector<TDimension>::operator+( + Vector<TDimension> const& pVec) const { CoordinateSystemPtr const& cs = BaseVector<TDimension>::getCoordinateSystem(); auto const components = getComponents(cs) + pVec.getComponents(cs); return Vector<TDimension>(BaseVector<TDimension>::getCoordinateSystem(), components); } template <typename TDimension> - Vector<TDimension> Vector<TDimension>::operator-(Vector<TDimension> const& pVec) const { + inline Vector<TDimension> Vector<TDimension>::operator-( + Vector<TDimension> const& pVec) const { CoordinateSystemPtr const& cs = BaseVector<TDimension>::getCoordinateSystem(); return Vector<TDimension>(cs, getComponents() - pVec.getComponents(cs)); } template <typename TDimension> - auto& Vector<TDimension>::operator*=(double const p) { + inline auto& Vector<TDimension>::operator*=(double const p) { BaseVector<TDimension>::getQuantityVector() *= p; return *this; } template <typename TDimension> template <typename TScalarDim> - auto Vector<TDimension>::operator*( + inline auto Vector<TDimension>::operator*( phys::units::quantity<TScalarDim, double> const p) const { using ProdDim = phys::units::detail::product_d<TDimension, TScalarDim>; @@ -160,51 +162,51 @@ namespace corsika { template <typename TDimension> template <typename TScalarDim> - auto Vector<TDimension>::operator/( + inline auto Vector<TDimension>::operator/( phys::units::quantity<TScalarDim, double> const p) const { return (*this) * (1 / p); } template <typename TDimension> - auto Vector<TDimension>::operator*(double const p) const { + inline auto Vector<TDimension>::operator*(double const p) const { return Vector<TDimension>(BaseVector<TDimension>::getCoordinateSystem(), BaseVector<TDimension>::getQuantityVector() * p); } template <typename TDimension> - auto Vector<TDimension>::operator/(double const p) const { + inline auto Vector<TDimension>::operator/(double const p) const { return Vector<TDimension>(BaseVector<TDimension>::getCoordinateSystem(), BaseVector<TDimension>::getQuantityVector() / p); } template <typename TDimension> - auto& Vector<TDimension>::operator+=(Vector<TDimension> const& pVec) { + inline auto& Vector<TDimension>::operator+=(Vector<TDimension> const& pVec) { BaseVector<TDimension>::getQuantityVector() += pVec.getComponents(BaseVector<TDimension>::getCoordinateSystem()); return *this; } template <typename TDimension> - auto& Vector<TDimension>::operator-=(Vector<TDimension> const& pVec) { + inline auto& Vector<TDimension>::operator-=(Vector<TDimension> const& pVec) { BaseVector<TDimension>::getQuantityVector() -= pVec.getComponents(BaseVector<TDimension>::getCoordinateSystem()); return *this; } template <typename TDimension> - auto& Vector<TDimension>::operator-() const { + inline auto& Vector<TDimension>::operator-() const { return Vector<TDimension>(BaseVector<TDimension>::getCoordinateSystem(), -BaseVector<TDimension>::getQuantityVector()); } template <typename TDimension> - auto Vector<TDimension>::normalized() const { + inline auto Vector<TDimension>::normalized() const { return (*this) * (1 / getNorm()); } template <typename TDimension> template <typename TDimension2> - auto Vector<TDimension>::cross(Vector<TDimension2> const& pV) const { + inline auto Vector<TDimension>::cross(Vector<TDimension2> const& pV) const { auto const c1 = getComponents().eigenVector_; auto const c2 = pV.getComponents(BaseVector<TDimension>::getCoordinateSystem()).eigenVector_; @@ -216,7 +218,7 @@ namespace corsika { template <typename TDimension> template <typename TDimension2> - auto Vector<TDimension>::dot(Vector<TDimension2> const& pV) const { + inline auto Vector<TDimension>::dot(Vector<TDimension2> const& pV) const { auto const c1 = getComponents().eigenVector_; auto const c2 = pV.getComponents(BaseVector<TDimension>::getCoordinateSystem()).eigenVector_; diff --git a/corsika/detail/framework/process/InteractionCounter.inl b/corsika/detail/framework/process/InteractionCounter.inl index 34c93ce43..d3572bf98 100644 --- a/corsika/detail/framework/process/InteractionCounter.inl +++ b/corsika/detail/framework/process/InteractionCounter.inl @@ -13,7 +13,7 @@ namespace corsika { template <class TCountedProcess> - InteractionCounter<TCountedProcess>::InteractionCounter(TCountedProcess& process) + inline InteractionCounter<TCountedProcess>::InteractionCounter(TCountedProcess& process) : process_(process) {} template <class TCountedProcess> diff --git a/corsika/detail/framework/process/InteractionHistogram.inl b/corsika/detail/framework/process/InteractionHistogram.inl index e6cfae869..efeb29c00 100644 --- a/corsika/detail/framework/process/InteractionHistogram.inl +++ b/corsika/detail/framework/process/InteractionHistogram.inl @@ -16,13 +16,13 @@ namespace corsika { - InteractionHistogram::InteractionHistogram() + inline InteractionHistogram::InteractionHistogram() : inthist_cms_{detail::hist_factory(num_bins_cms, lower_edge_cms, upper_edge_cms)} , inthist_lab_{detail::hist_factory(num_bins_lab, lower_edge_lab, upper_edge_lab)} { } - void InteractionHistogram::fill(Code projectile_id, HEPEnergyType lab_energy, - HEPEnergyType mass_target, int A, int Z) { + inline void InteractionHistogram::fill(Code projectile_id, HEPEnergyType lab_energy, + HEPEnergyType mass_target, int A, int Z) { auto constexpr inv_eV = 1 / 1_eV; if (projectile_id == Code::Nucleus) { auto const sqrtS = sqrt(A * A * (constants::nucleonMass * constants::nucleonMass) + @@ -42,7 +42,7 @@ namespace corsika { } } - InteractionHistogram& InteractionHistogram::operator+=( + inline InteractionHistogram& InteractionHistogram::operator+=( InteractionHistogram const& other) { inthist_lab_ += other.inthist_lab_; inthist_cms_ += other.inthist_cms_; @@ -50,7 +50,8 @@ namespace corsika { return *this; } - InteractionHistogram InteractionHistogram::operator+(InteractionHistogram other) const { + inline InteractionHistogram InteractionHistogram::operator+( + InteractionHistogram other) const { other.inthist_lab_ += inthist_lab_; other.inthist_cms_ += inthist_cms_; diff --git a/corsika/detail/framework/process/ProcessSequence.inl b/corsika/detail/framework/process/ProcessSequence.inl index 19056ad6c..7a0d6409f 100644 --- a/corsika/detail/framework/process/ProcessSequence.inl +++ b/corsika/detail/framework/process/ProcessSequence.inl @@ -29,7 +29,7 @@ namespace corsika { template <typename TProcess1, typename TProcess2, int IndexStart, int IndexProcess1, int IndexProcess2> template <typename TParticle> - ProcessReturn ProcessSequence< + inline ProcessReturn ProcessSequence< TProcess1, TProcess2, IndexStart, IndexProcess1, IndexProcess2>::doBoundaryCrossing(TParticle& particle, typename TParticle::node_type const& from, @@ -54,7 +54,7 @@ namespace corsika { template <typename TProcess1, typename TProcess2, int IndexStart, int IndexProcess1, int IndexProcess2> template <typename TParticle, typename TTrack> - ProcessReturn + inline ProcessReturn ProcessSequence<TProcess1, TProcess2, IndexStart, IndexProcess1, IndexProcess2>:: doContinuous(TParticle& particle, TTrack& vT, [[maybe_unused]] ContinuousProcessIndex const limitId) { @@ -81,8 +81,8 @@ namespace corsika { template <typename TProcess1, typename TProcess2, int IndexStart, int IndexProcess1, int IndexProcess2> template <typename TSecondaries> - void ProcessSequence<TProcess1, TProcess2, IndexStart, IndexProcess1, - IndexProcess2>::doSecondaries(TSecondaries& vS) { + inline void ProcessSequence<TProcess1, TProcess2, IndexStart, IndexProcess1, + IndexProcess2>::doSecondaries(TSecondaries& vS) { if constexpr (std::is_base_of_v<SecondariesProcess<process1_type>, process1_type> || t1ProcSeq) { A_.doSecondaries(vS); @@ -95,8 +95,8 @@ namespace corsika { template <typename TProcess1, typename TProcess2, int IndexStart, int IndexProcess1, int IndexProcess2> - bool ProcessSequence<TProcess1, TProcess2, IndexStart, IndexProcess1, - IndexProcess2>::checkStep() { + inline bool ProcessSequence<TProcess1, TProcess2, IndexStart, IndexProcess1, + IndexProcess2>::checkStep() { bool ret = false; if constexpr (std::is_base_of_v<StackProcess<process1_type>, process1_type> || (t1ProcSeq && !t1SwitchProcSeq)) { @@ -112,8 +112,8 @@ namespace corsika { template <typename TProcess1, typename TProcess2, int IndexStart, int IndexProcess1, int IndexProcess2> template <typename TStack> - void ProcessSequence<TProcess1, TProcess2, IndexStart, IndexProcess1, - IndexProcess2>::doStack(TStack& stack) { + inline void ProcessSequence<TProcess1, TProcess2, IndexStart, IndexProcess1, + IndexProcess2>::doStack(TStack& stack) { if constexpr (std::is_base_of_v<StackProcess<process1_type>, process1_type> || (t1ProcSeq && !t1SwitchProcSeq)) { if (A_.checkStep()) { A_.doStack(stack); } @@ -124,20 +124,10 @@ namespace corsika { } } - /** - * Calculate the maximum allowed length of the next tracking step, based on all - * ContinuousProcess-es - * - * The maximum allowed step length is the minimum of the allowed track lenght over all - * ContinuousProcess-es in the ProcessSequence. - * - * \return: ContinuousProcessStepLength which contains the step length itself in - * LengthType, and a unique identifier of the related ContinuousProcess. - **/ template <typename TProcess1, typename TProcess2, int IndexStart, int IndexProcess1, int IndexProcess2> template <typename TParticle, typename TTrack> - ContinuousProcessStepLength + inline ContinuousProcessStepLength ProcessSequence<TProcess1, TProcess2, IndexStart, IndexProcess1, IndexProcess2>::getMaxStepLength(TParticle& particle, TTrack& vTrack) { // if no other process in the sequence implements it @@ -167,7 +157,7 @@ namespace corsika { template <typename TProcess1, typename TProcess2, int IndexStart, int IndexProcess1, int IndexProcess2> template <typename TParticle> - InverseGrammageType + inline InverseGrammageType ProcessSequence<TProcess1, TProcess2, IndexStart, IndexProcess1, IndexProcess2>::getInverseInteractionLength(TParticle&& particle) { diff --git a/corsika/detail/framework/process/SwitchProcessSequence.inl b/corsika/detail/framework/process/SwitchProcessSequence.inl index 2eadc8782..c4f8ede12 100644 --- a/corsika/detail/framework/process/SwitchProcessSequence.inl +++ b/corsika/detail/framework/process/SwitchProcessSequence.inl @@ -30,7 +30,7 @@ namespace corsika { template <typename TProcess1, typename TProcess2, typename TSelect, int IndexStart, int IndexProcess1, int IndexProcess2> template <typename TParticle, typename TVTNType> - ProcessReturn + inline ProcessReturn SwitchProcessSequence<TProcess1, TProcess2, TSelect, IndexStart, IndexProcess1, IndexProcess2>::doBoundaryCrossing(TParticle& particle, TVTNType const& from, diff --git a/corsika/detail/framework/stack/CombinedStack.inl b/corsika/detail/framework/stack/CombinedStack.inl index 0c95ad15e..1cdc7abd9 100644 --- a/corsika/detail/framework/stack/CombinedStack.inl +++ b/corsika/detail/framework/stack/CombinedStack.inl @@ -59,7 +59,6 @@ namespace corsika { pi_b_type::setParticleData(static_cast<pi_b_type&>(p), vB); } - ///@} template <template <typename> class TParticleInterfaceA, template <typename> class TParticleInterfaceB, typename TStackIterator> inline std::string CombinedParticleInterface<TParticleInterfaceA, TParticleInterfaceB, diff --git a/corsika/detail/framework/stack/SecondaryView.inl b/corsika/detail/framework/stack/SecondaryView.inl index 33160aa08..4b27a5087 100644 --- a/corsika/detail/framework/stack/SecondaryView.inl +++ b/corsika/detail/framework/stack/SecondaryView.inl @@ -15,17 +15,11 @@ #include <vector> namespace corsika { - /* - template <typename TStackDataType, template <typename> typename TParticleInterface, - template <typename T1, template <class> class T2> class MSecondaryProducer> - SecondaryView< TStackDataType,TParticleInterface, MSecondaryProducer>:: - - */ template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> template <typename... Args> - typename SecondaryView<TStackDataType, TParticleInterface, - MSecondaryProducer>::stack_view_iterator + inline typename SecondaryView<TStackDataType, TParticleInterface, + MSecondaryProducer>::stack_view_iterator SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::addSecondary( const Args... v) { CORSIKA_LOG_TRACE("SecondaryView::addSecondary(Args&&)"); @@ -35,8 +29,8 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - typename SecondaryView<TStackDataType, TParticleInterface, - MSecondaryProducer>::stack_view_iterator + inline typename SecondaryView<TStackDataType, TParticleInterface, + MSecondaryProducer>::stack_view_iterator SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::begin() { unsigned int i = 0; for (; i < getSize(); ++i) { @@ -48,8 +42,8 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - typename SecondaryView<TStackDataType, TParticleInterface, - MSecondaryProducer>::const_stack_view_iterator + inline typename SecondaryView<TStackDataType, TParticleInterface, + MSecondaryProducer>::const_stack_view_iterator SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::begin() const { unsigned int i = 0; for (; i < getSize(); ++i) { @@ -61,8 +55,8 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - typename SecondaryView<TStackDataType, TParticleInterface, - MSecondaryProducer>::const_stack_view_iterator + inline typename SecondaryView<TStackDataType, TParticleInterface, + MSecondaryProducer>::const_stack_view_iterator SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::cbegin() const { unsigned int i = 0; for (; i < getSize(); ++i) { @@ -74,8 +68,8 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - typename SecondaryView<TStackDataType, TParticleInterface, - MSecondaryProducer>::stack_view_iterator + inline typename SecondaryView<TStackDataType, TParticleInterface, + MSecondaryProducer>::stack_view_iterator SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::last() { unsigned int i = 0; for (; i < getSize(); ++i) { @@ -86,8 +80,8 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - typename SecondaryView<TStackDataType, TParticleInterface, - MSecondaryProducer>::const_stack_view_iterator + inline typename SecondaryView<TStackDataType, TParticleInterface, + MSecondaryProducer>::const_stack_view_iterator SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::last() const { unsigned int i = 0; for (; i < getSize(); ++i) { @@ -98,8 +92,8 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - typename SecondaryView<TStackDataType, TParticleInterface, - MSecondaryProducer>::const_stack_view_iterator + inline typename SecondaryView<TStackDataType, TParticleInterface, + MSecondaryProducer>::const_stack_view_iterator SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::clast() const { unsigned int i = 0; for (; i < getSize(); ++i) { @@ -111,7 +105,7 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - void SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::swap( + inline void SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::swap( stack_view_iterator a, stack_view_iterator b) { CORSIKA_LOG_TRACE("View::swap"); @@ -121,7 +115,7 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - void SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::copy( + inline void SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::copy( stack_view_iterator a, stack_view_iterator b) { CORSIKA_LOG_TRACE("View::copy"); @@ -131,7 +125,7 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - void SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::copy( + inline void SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::copy( const_stack_view_iterator a, stack_view_iterator b) { CORSIKA_LOG_TRACE("View::copy"); @@ -141,8 +135,8 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - void SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::erase( - stack_view_iterator p) { + inline void SecondaryView<TStackDataType, TParticleInterface, + MSecondaryProducer>::erase(stack_view_iterator p) { CORSIKA_LOG_TRACE("SecondaryView::Delete"); if (isEmpty()) { /*error*/ @@ -157,8 +151,8 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - bool SecondaryView<TStackDataType, TParticleInterface, - MSecondaryProducer>::purgeLastIfDeleted() { + inline bool SecondaryView<TStackDataType, TParticleInterface, + MSecondaryProducer>::purgeLastIfDeleted() { CORSIKA_LOG_TRACE("SecondaryView::purgeLastIfDeleted"); if (!isErased(getSize() - 1)) return false; // the last particle is not marked for deletion. Do nothing. @@ -170,7 +164,8 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - void SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::purge() { + inline void + SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::purge() { unsigned int iStack = 0; unsigned int size = getSize(); while (iStack < size) { @@ -187,8 +182,8 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> - std::string SecondaryView<TStackDataType, TParticleInterface, - MSecondaryProducer>::asString() const { + inline std::string SecondaryView<TStackDataType, TParticleInterface, + MSecondaryProducer>::asString() const { std::string str(fmt::format("size {}\n", getSize())); // we make our own begin/end since we want ALL entries std::string new_line = " "; @@ -206,8 +201,8 @@ namespace corsika { template <typename TStackDataType, template <typename> typename TParticleInterface, template <typename T1, template <class> class T2> class MSecondaryProducer> template <typename... Args> - typename SecondaryView<TStackDataType, TParticleInterface, - MSecondaryProducer>::stack_view_iterator + inline typename SecondaryView<TStackDataType, TParticleInterface, + MSecondaryProducer>::stack_view_iterator SecondaryView<TStackDataType, TParticleInterface, MSecondaryProducer>::addSecondary( stack_view_iterator& proj, const Args... v) { CORSIKA_LOG_TRACE("SecondaryView::addSecondary(stack_view_iterator&, Args&&)"); diff --git a/corsika/detail/framework/stack/Stack.inl b/corsika/detail/framework/stack/Stack.inl index 30c7c7460..4569a23a8 100644 --- a/corsika/detail/framework/stack/Stack.inl +++ b/corsika/detail/framework/stack/Stack.inl @@ -21,15 +21,15 @@ namespace corsika { template <typename StackData, template <typename> typename MParticleInterface> template <typename... TArgs> - void Stack<StackData, MParticleInterface>::clear(TArgs... args) { + inline void Stack<StackData, MParticleInterface>::clear(TArgs... args) { data_.clear(args...); deleted_ = std::vector<bool>(data_.getSize(), false); nDeleted_ = 0; } template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::stack_iterator_type - Stack<StackData, MParticleInterface>::begin() { + typename Stack<StackData, MParticleInterface>::stack_iterator_type inline Stack< + StackData, MParticleInterface>::begin() { unsigned int i = 0; for (; i < getSize(); ++i) { if (!deleted_[i]) break; @@ -38,14 +38,14 @@ namespace corsika { } template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::stack_iterator_type - Stack<StackData, MParticleInterface>::end() { + typename Stack<StackData, MParticleInterface>::stack_iterator_type inline Stack< + StackData, MParticleInterface>::end() { return stack_iterator_type(*this, getSize()); } template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::stack_iterator_type - Stack<StackData, MParticleInterface>::last() { + typename Stack<StackData, MParticleInterface>::stack_iterator_type inline Stack< + StackData, MParticleInterface>::last() { unsigned int i = 0; for (; i < getSize(); ++i) { if (!deleted_[getSize() - 1 - i]) break; @@ -54,8 +54,8 @@ namespace corsika { } template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::const_stack_iterator_type - Stack<StackData, MParticleInterface>::begin() const { + typename Stack<StackData, MParticleInterface>::const_stack_iterator_type inline Stack< + StackData, MParticleInterface>::begin() const { unsigned int i = 0; for (; i < getSize(); ++i) { if (!deleted_[i]) break; @@ -64,8 +64,8 @@ namespace corsika { } template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::const_stack_iterator_type - Stack<StackData, MParticleInterface>::end() const { + typename Stack<StackData, MParticleInterface>::const_stack_iterator_type inline Stack< + StackData, MParticleInterface>::end() const { return const_stack_iterator_type(*this, getSize()); } @@ -80,8 +80,8 @@ namespace corsika { } template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::const_stack_iterator_type - Stack<StackData, MParticleInterface>::cbegin() const { + typename Stack<StackData, MParticleInterface>::const_stack_iterator_type inline Stack< + StackData, MParticleInterface>::cbegin() const { unsigned int i = 0; for (; i < getSize(); ++i) { if (!deleted_[i]) break; @@ -90,14 +90,14 @@ namespace corsika { } template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::const_stack_iterator_type - Stack<StackData, MParticleInterface>::cend() const { + typename Stack<StackData, MParticleInterface>::const_stack_iterator_type inline Stack< + StackData, MParticleInterface>::cend() const { return const_stack_iterator_type(*this, getSize()); } template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::const_stack_iterator_type - Stack<StackData, MParticleInterface>::clast() const { + typename Stack<StackData, MParticleInterface>::const_stack_iterator_type inline Stack< + StackData, MParticleInterface>::clast() const { unsigned int i = 0; for (; i < getSize(); ++i) { if (!deleted_[getSize() - 1 - i]) break; @@ -107,41 +107,40 @@ namespace corsika { } template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::stack_iterator_type - Stack<StackData, MParticleInterface>::at(unsigned int i) { + typename Stack<StackData, MParticleInterface>::stack_iterator_type inline Stack< + StackData, MParticleInterface>::at(unsigned int i) { return stack_iterator_type(*this, i); } template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::const_stack_iterator_type - Stack<StackData, MParticleInterface>::at(unsigned int i) const { + typename Stack<StackData, MParticleInterface>::const_stack_iterator_type inline Stack< + StackData, MParticleInterface>::at(unsigned int i) const { return const_stack_iterator_type(*this, i); } template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::stack_iterator_type - Stack<StackData, MParticleInterface>::first() { + typename Stack<StackData, MParticleInterface>::stack_iterator_type inline Stack< + StackData, MParticleInterface>::first() { return stack_iterator_type{*this, 0}; } template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::const_stack_iterator_type - Stack<StackData, MParticleInterface>::cfirst() const { + typename Stack<StackData, MParticleInterface>::const_stack_iterator_type inline Stack< + StackData, MParticleInterface>::cfirst() const { return const_stack_iterator_type{*this, 0}; } - /// @} template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::stack_iterator_type - Stack<StackData, MParticleInterface>::getNextParticle() { + typename Stack<StackData, MParticleInterface>::stack_iterator_type inline Stack< + StackData, MParticleInterface>::getNextParticle() { while (purgeLastIfDeleted()) {} return last(); } template <typename StackData, template <typename> typename MParticleInterface> template <typename... TArgs> - typename Stack<StackData, MParticleInterface>::stack_iterator_type - Stack<StackData, MParticleInterface>::addParticle(const TArgs... v) { + typename Stack<StackData, MParticleInterface>::stack_iterator_type inline Stack< + StackData, MParticleInterface>::addParticle(const TArgs... v) { CORSIKA_LOG_TRACE("Stack::AddParticle"); data_.incrementSize(); deleted_.push_back(false); @@ -149,22 +148,22 @@ namespace corsika { } template <typename StackData, template <typename> typename MParticleInterface> - void Stack<StackData, MParticleInterface>::swap(stack_iterator_type a, - stack_iterator_type b) { + inline void Stack<StackData, MParticleInterface>::swap(stack_iterator_type a, + stack_iterator_type b) { CORSIKA_LOG_TRACE("Stack::Swap"); swap(a.getIndex(), b.getIndex()); } template <typename StackData, template <typename> typename MParticleInterface> - void Stack<StackData, MParticleInterface>::copy(stack_iterator_type a, - stack_iterator_type b) { + inline void Stack<StackData, MParticleInterface>::copy(stack_iterator_type a, + stack_iterator_type b) { CORSIKA_LOG_TRACE("Stack::Copy"); copy(a.getIndex(), b.getIndex()); } template <typename StackData, template <typename> typename MParticleInterface> - void Stack<StackData, MParticleInterface>::copy(const_stack_iterator_type a, - stack_iterator_type b) { + inline void Stack<StackData, MParticleInterface>::copy(const_stack_iterator_type a, + stack_iterator_type b) { CORSIKA_LOG_TRACE("Stack::Copy"); data_.copy(a.getIndex(), b.getIndex()); if (deleted_[b.getIndex()] && !deleted_[a.getIndex()]) nDeleted_--; @@ -173,7 +172,7 @@ namespace corsika { } template <typename StackData, template <typename> typename MParticleInterface> - void Stack<StackData, MParticleInterface>::erase(stack_iterator_type p) { + inline void Stack<StackData, MParticleInterface>::erase(stack_iterator_type p) { CORSIKA_LOG_TRACE("Stack::Delete"); if (this->isEmpty()) { /*error*/ throw std::runtime_error("Stack, cannot delete entry since size is zero"); @@ -183,54 +182,52 @@ namespace corsika { } this->erase(p.getIndex()); } - /** + + /* * delete this particle */ - template <typename StackData, template <typename> typename MParticleInterface> - void Stack<StackData, MParticleInterface>::erase(particle_interface_type p) { + inline void Stack<StackData, MParticleInterface>::erase(particle_interface_type p) { this->erase(p.getIterator()); } - /** + /* * check if there are no further non-deleted particles on stack */ template <typename StackData, template <typename> typename MParticleInterface> - bool Stack<StackData, MParticleInterface>::isEmpty() { + inline bool Stack<StackData, MParticleInterface>::isEmpty() { return getEntries() == 0; } - /** + /* * check if this particle was already deleted */ - template <typename StackData, template <typename> typename MParticleInterface> - bool Stack<StackData, MParticleInterface>::isErased( + inline bool Stack<StackData, MParticleInterface>::isErased( const stack_iterator_type& p) const { return isErased(p.getIndex()); } template <typename StackData, template <typename> typename MParticleInterface> - bool Stack<StackData, MParticleInterface>::isErased( + inline bool Stack<StackData, MParticleInterface>::isErased( const const_stack_iterator_type& p) const { return isErased(p.getIndex()); } template <typename StackData, template <typename> typename MParticleInterface> - bool Stack<StackData, MParticleInterface>::isErased( + inline bool Stack<StackData, MParticleInterface>::isErased( const particle_interface_type& p) const { return isErased(p.getIterator()); } - /** + /* * Function to ultimatively remove the last entry from the stack, * if it was marked as deleted before. If this is not the case, * the function will just return false and do nothing. */ - template <typename StackData, template <typename> typename MParticleInterface> - bool Stack<StackData, MParticleInterface>::purgeLastIfDeleted() { + inline bool Stack<StackData, MParticleInterface>::purgeLastIfDeleted() { if (!deleted_.back()) return false; // the last particle is not marked for deletion. Do nothing. @@ -241,7 +238,7 @@ namespace corsika { return true; } - /** + /* * Function to ultimatively remove all entries from the stack * marked as deleted. * @@ -251,7 +248,7 @@ namespace corsika { */ template <typename StackData, template <typename> typename MParticleInterface> - void Stack<StackData, MParticleInterface>::purge() { + inline void Stack<StackData, MParticleInterface>::purge() { unsigned int iStackFront = 0; unsigned int iStackBack = getSize() - 1; @@ -269,12 +266,12 @@ namespace corsika { } template <typename StackData, template <typename> typename MParticleInterface> - unsigned int Stack<StackData, MParticleInterface>::getSize() const { + inline unsigned int Stack<StackData, MParticleInterface>::getSize() const { return data_.getSize(); } template <typename StackData, template <typename> typename MParticleInterface> - std::string Stack<StackData, MParticleInterface>::asString() const { + inline std::string Stack<StackData, MParticleInterface>::asString() const { std::string str(fmt::format("size {}, entries {}, deleted {} \n", getSize(), getEntries(), getErased())); // we make our own begin/end since we want ALL entries @@ -290,7 +287,7 @@ namespace corsika { template <typename StackData, template <typename> typename MParticleInterface> template <typename... TArgs> - typename Stack<StackData, MParticleInterface>::stack_iterator_type + inline typename Stack<StackData, MParticleInterface>::stack_iterator_type Stack<StackData, MParticleInterface>::addSecondary(stack_iterator_type& parent, const TArgs... v) { CORSIKA_LOG_TRACE("Stack::AddSecondary"); @@ -300,16 +297,16 @@ namespace corsika { } template <typename StackData, template <typename> typename MParticleInterface> - void Stack<StackData, MParticleInterface>::swap(unsigned int const a, - unsigned int const b) { + inline void Stack<StackData, MParticleInterface>::swap(unsigned int const a, + unsigned int const b) { CORSIKA_LOG_TRACE("Stack::Swap(unsigned int)"); data_.swap(a, b); std::swap(deleted_[a], deleted_[b]); } template <typename StackData, template <typename> typename MParticleInterface> - void Stack<StackData, MParticleInterface>::copy(unsigned int const a, - unsigned int const b) { + inline void Stack<StackData, MParticleInterface>::copy(unsigned int const a, + unsigned int const b) { CORSIKA_LOG_TRACE("Stack::Copy"); data_.copy(a, b); if (deleted_[b] && !deleted_[a]) nDeleted_--; @@ -318,24 +315,23 @@ namespace corsika { } template <typename StackData, template <typename> typename MParticleInterface> - bool Stack<StackData, MParticleInterface>::isErased(unsigned int const i) const { + inline bool Stack<StackData, MParticleInterface>::isErased(unsigned int const i) const { if (i >= deleted_.size()) return false; return deleted_.at(i); } template <typename StackData, template <typename> typename MParticleInterface> - void Stack<StackData, MParticleInterface>::erase(unsigned int const i) { + inline void Stack<StackData, MParticleInterface>::erase(unsigned int const i) { deleted_[i] = true; nDeleted_++; } - /** + /* * will remove from storage the element i. This is a helper * function for SecondaryView. */ - template <typename StackData, template <typename> typename MParticleInterface> - void Stack<StackData, MParticleInterface>::purge(unsigned int i) { + inline void Stack<StackData, MParticleInterface>::purge(unsigned int i) { unsigned int iStackBack = getSize() - 1; // search for last non-deleted particle on stack while (deleted_[iStackBack]) { iStackBack--; } @@ -347,33 +343,21 @@ namespace corsika { deleted_.pop_back(); } - /** - * Function to perform eventual transformation from - * StackIterator::getIndex() to index in data stored in - * StackData data_. By default (and in almost all cases) this - * should just be identiy. See class SecondaryView for an alternative implementation. - */ - template <typename StackData, template <typename> typename MParticleInterface> - unsigned int Stack<StackData, MParticleInterface>::getIndexFromIterator( + inline unsigned int Stack<StackData, MParticleInterface>::getIndexFromIterator( const unsigned int vI) const { // this is too much: CORSIKA_LOG_TRACE("Stack::getIndexFromIterator({})={}", vI, vI); return vI; } - /** - * @name Return reference to StackData object data_ for data access - * @{ - */ - template <typename StackData, template <typename> typename MParticleInterface> - typename Stack<StackData, MParticleInterface>::value_type& + inline typename Stack<StackData, MParticleInterface>::value_type& Stack<StackData, MParticleInterface>::getStackData() { return data_; } template <typename StackData, template <typename> typename MParticleInterface> - const typename Stack<StackData, MParticleInterface>::value_type& + inline const typename Stack<StackData, MParticleInterface>::value_type& Stack<StackData, MParticleInterface>::getStackData() const { return data_; } diff --git a/corsika/detail/framework/utility/COMBoost.inl b/corsika/detail/framework/utility/COMBoost.inl index 54d1162c3..9b05bef0e 100644 --- a/corsika/detail/framework/utility/COMBoost.inl +++ b/corsika/detail/framework/utility/COMBoost.inl @@ -108,6 +108,6 @@ namespace corsika { inverseBoost_ << coshEta, -sinhEta, -sinhEta, coshEta; } - CoordinateSystemPtr COMBoost::getRotatedCS() const { return rotatedCS_; } + inline CoordinateSystemPtr COMBoost::getRotatedCS() const { return rotatedCS_; } } // namespace corsika diff --git a/corsika/detail/framework/utility/CorsikaData.inl b/corsika/detail/framework/utility/CorsikaData.inl index 80a1b77ca..e2ea1e99b 100644 --- a/corsika/detail/framework/utility/CorsikaData.inl +++ b/corsika/detail/framework/utility/CorsikaData.inl @@ -11,7 +11,7 @@ #include <stdexcept> #include <string> -std::string corsika::corsika_data(std::string const& key) { +inline std::string corsika::corsika_data(std::string const& key) { if (auto const* p = std::getenv("CORSIKA_DATA"); p != nullptr) { auto const path = std::string(p) + "/" + key; return path; diff --git a/corsika/detail/framework/utility/CorsikaFenvOSX.inl b/corsika/detail/framework/utility/CorsikaFenvOSX.inl index b57a6973d..e1f7cc480 100644 --- a/corsika/detail/framework/utility/CorsikaFenvOSX.inl +++ b/corsika/detail/framework/utility/CorsikaFenvOSX.inl @@ -28,7 +28,7 @@ extern "C" { -int feenableexcept(int excepts) noexcept { +inline int feenableexcept(int excepts) noexcept { static fenv_t fenv; int new_excepts = excepts & FE_ALL_EXCEPT; // previous masks @@ -44,7 +44,7 @@ int feenableexcept(int excepts) noexcept { return fesetenv(&fenv) ? -1 : old_excepts; } -int fedisableexcept(int excepts) noexcept { +inline int fedisableexcept(int excepts) noexcept { static fenv_t fenv; int new_excepts = excepts & FE_ALL_EXCEPT; // all previous masks diff --git a/corsika/detail/media/BaseExponential.inl b/corsika/detail/media/BaseExponential.inl index 35b506610..a40981bef 100644 --- a/corsika/detail/media/BaseExponential.inl +++ b/corsika/detail/media/BaseExponential.inl @@ -15,12 +15,12 @@ namespace corsika { template <typename TDerived> - auto const& BaseExponential<TDerived>::getImplementation() const { + inline auto const& BaseExponential<TDerived>::getImplementation() const { return *static_cast<TDerived const*>(this); } template <typename TDerived> - GrammageType BaseExponential<TDerived>::getIntegratedGrammage( + inline GrammageType BaseExponential<TDerived>::getIntegratedGrammage( setup::Trajectory const& traj, LengthType vL, DirectionVector const& axis) const { if (vL == LengthType::zero()) { return GrammageType::zero(); } @@ -35,7 +35,7 @@ namespace corsika { } template <typename TDerived> - LengthType BaseExponential<TDerived>::getArclengthFromGrammage( + inline LengthType BaseExponential<TDerived>::getArclengthFromGrammage( setup::Trajectory const& traj, GrammageType grammage, DirectionVector const& axis) const { auto const uDotA = traj.getDirection(0).dot(axis).magnitude(); @@ -55,8 +55,9 @@ namespace corsika { } template <typename TDerived> - BaseExponential<TDerived>::BaseExponential(Point const& point, MassDensityType rho0, - LengthType lambda) + inline BaseExponential<TDerived>::BaseExponential(Point const& point, + MassDensityType rho0, + LengthType lambda) : rho0_(rho0) , lambda_(lambda) , invLambda_(1 / lambda) diff --git a/corsika/detail/media/Environment.inl b/corsika/detail/media/Environment.inl index 792182a9e..40ab05db9 100644 --- a/corsika/detail/media/Environment.inl +++ b/corsika/detail/media/Environment.inl @@ -13,33 +13,34 @@ namespace corsika { template <typename IEnvironmentModel> - Environment<IEnvironmentModel>::Environment() + inline Environment<IEnvironmentModel>::Environment() : coordinateSystem_{get_root_CoordinateSystem()} , universe_(std::make_unique<BaseNodeType>( std::make_unique<Universe>(coordinateSystem_))) {} template <typename IEnvironmentModel> - typename Environment<IEnvironmentModel>::BaseNodeType::VTNUPtr& + inline typename Environment<IEnvironmentModel>::BaseNodeType::VTNUPtr& Environment<IEnvironmentModel>::getUniverse() { return universe_; } template <typename IEnvironmentModel> - typename Environment<IEnvironmentModel>::BaseNodeType::VTNUPtr const& + inline typename Environment<IEnvironmentModel>::BaseNodeType::VTNUPtr const& Environment<IEnvironmentModel>::getUniverse() const { return universe_; } template <typename IEnvironmentModel> - CoordinateSystemPtr const& Environment<IEnvironmentModel>::getCoordinateSystem() const { + inline CoordinateSystemPtr const& Environment<IEnvironmentModel>::getCoordinateSystem() + const { return coordinateSystem_; } // factory method for creation of VolumeTreeNodes template <typename IEnvironmentModel> template <class TVolumeType, typename... TVolumeArgs> - std::unique_ptr<VolumeTreeNode<IEnvironmentModel> > - Environment<IEnvironmentModel>::createNode(TVolumeArgs&&... args) { + std::unique_ptr<VolumeTreeNode<IEnvironmentModel> > inline Environment< + IEnvironmentModel>::createNode(TVolumeArgs&&... args) { static_assert(std::is_base_of_v<IVolume, TVolumeType>, "unusable type provided, needs to be derived from " "\"Volume\""); @@ -48,4 +49,4 @@ namespace corsika { std::make_unique<TVolumeType>(std::forward<TVolumeArgs>(args)...)); } -} // namespace corsika \ No newline at end of file +} // namespace corsika diff --git a/corsika/detail/media/FlatExponential.inl b/corsika/detail/media/FlatExponential.inl index bc782945f..cdada02df 100644 --- a/corsika/detail/media/FlatExponential.inl +++ b/corsika/detail/media/FlatExponential.inl @@ -17,16 +17,16 @@ namespace corsika { template <typename T> - FlatExponential<T>::FlatExponential(Point const& point, - Vector<dimensionless_d> const& axis, - MassDensityType rho, LengthType lambda, - NuclearComposition const& nuclComp) + inline FlatExponential<T>::FlatExponential(Point const& point, + Vector<dimensionless_d> const& axis, + MassDensityType rho, LengthType lambda, + NuclearComposition const& nuclComp) : BaseExponential<FlatExponential<T>>(point, rho, lambda) , axis_(axis) , nuclComp_(nuclComp) {} template <typename T> - MassDensityType FlatExponential<T>::getMassDensity(Point const& point) const { + inline MassDensityType FlatExponential<T>::getMassDensity(Point const& point) const { return BaseExponential<FlatExponential<T>>::getRho0() * exp(BaseExponential<FlatExponential<T>>::getInvLambda() * (point - BaseExponential<FlatExponential<T>>::getAnchorPoint()) @@ -34,19 +34,19 @@ namespace corsika { } template <typename T> - NuclearComposition const& FlatExponential<T>::getNuclearComposition() const { + inline NuclearComposition const& FlatExponential<T>::getNuclearComposition() const { return nuclComp_; } template <typename T> - GrammageType FlatExponential<T>::getIntegratedGrammage(setup::Trajectory const& line, - LengthType to) const { + inline GrammageType FlatExponential<T>::getIntegratedGrammage( + setup::Trajectory const& line, LengthType to) const { return BaseExponential<FlatExponential<T>>::getIntegratedGrammage(line, to, axis_); } template <typename T> - LengthType FlatExponential<T>::getArclengthFromGrammage(setup::Trajectory const& line, - GrammageType grammage) const { + inline LengthType FlatExponential<T>::getArclengthFromGrammage( + setup::Trajectory const& line, GrammageType grammage) const { return BaseExponential<FlatExponential<T>>::getArclengthFromGrammage(line, grammage, axis_); } diff --git a/corsika/detail/media/HomogeneousMedium.inl b/corsika/detail/media/HomogeneousMedium.inl index d73354aa6..fd0148b02 100644 --- a/corsika/detail/media/HomogeneousMedium.inl +++ b/corsika/detail/media/HomogeneousMedium.inl @@ -16,29 +16,30 @@ namespace corsika { template <typename T> - HomogeneousMedium<T>::HomogeneousMedium(MassDensityType density, - NuclearComposition const& nuclComp) + inline HomogeneousMedium<T>::HomogeneousMedium(MassDensityType density, + NuclearComposition const& nuclComp) : density_(density) , nuclComp_(nuclComp) {} template <typename T> - MassDensityType HomogeneousMedium<T>::getMassDensity(Point const&) const { + inline MassDensityType HomogeneousMedium<T>::getMassDensity(Point const&) const { return density_; } + template <typename T> - NuclearComposition const& HomogeneousMedium<T>::getNuclearComposition() const { + inline NuclearComposition const& HomogeneousMedium<T>::getNuclearComposition() const { return nuclComp_; } template <typename T> - GrammageType HomogeneousMedium<T>::getIntegratedGrammage(setup::Trajectory const&, - LengthType to) const { + inline GrammageType HomogeneousMedium<T>::getIntegratedGrammage( + setup::Trajectory const&, LengthType to) const { return to * density_; } template <typename T> - LengthType HomogeneousMedium<T>::getArclengthFromGrammage(setup::Trajectory const&, - GrammageType grammage) const { + inline LengthType HomogeneousMedium<T>::getArclengthFromGrammage( + setup::Trajectory const&, GrammageType grammage) const { return grammage / density_; } } // namespace corsika diff --git a/corsika/detail/media/InhomogeneousMedium.inl b/corsika/detail/media/InhomogeneousMedium.inl index 064e9610e..48d1d266e 100644 --- a/corsika/detail/media/InhomogeneousMedium.inl +++ b/corsika/detail/media/InhomogeneousMedium.inl @@ -17,31 +17,31 @@ namespace corsika { template <typename T, typename TDensityFunction> template <typename... TArgs> - InhomogeneousMedium<T, TDensityFunction>::InhomogeneousMedium( + inline InhomogeneousMedium<T, TDensityFunction>::InhomogeneousMedium( NuclearComposition const& nuclComp, TArgs&&... rhoTArgs) : nuclComp_(nuclComp) , densityFunction_(rhoTArgs...) {} template <typename T, typename TDensityFunction> - MassDensityType InhomogeneousMedium<T, TDensityFunction>::getMassDensity( + inline MassDensityType InhomogeneousMedium<T, TDensityFunction>::getMassDensity( Point const& point) const { return densityFunction_.evaluateAt(point); } template <typename T, typename TDensityFunction> - NuclearComposition const& + inline NuclearComposition const& InhomogeneousMedium<T, TDensityFunction>::getNuclearComposition() const { return nuclComp_; } template <typename T, typename TDensityFunction> - GrammageType InhomogeneousMedium<T, TDensityFunction>::getIntegratedGrammage( + inline GrammageType InhomogeneousMedium<T, TDensityFunction>::getIntegratedGrammage( setup::Trajectory const& line, LengthType to) const { return densityFunction_.getIntegrateGrammage(line, to); } template <typename T, typename TDensityFunction> - LengthType InhomogeneousMedium<T, TDensityFunction>::getArclengthFromGrammage( + inline LengthType InhomogeneousMedium<T, TDensityFunction>::getArclengthFromGrammage( setup::Trajectory const& line, GrammageType grammage) const { return densityFunction_.getArclengthFromGrammage(line, grammage); } diff --git a/corsika/detail/media/LayeredSphericalAtmosphereBuilder.inl b/corsika/detail/media/LayeredSphericalAtmosphereBuilder.inl index e42310da2..74f00f101 100644 --- a/corsika/detail/media/LayeredSphericalAtmosphereBuilder.inl +++ b/corsika/detail/media/LayeredSphericalAtmosphereBuilder.inl @@ -18,8 +18,9 @@ namespace corsika { template <typename TMediumInterface, template <typename> typename TMediumModelExtra, typename... TModelArgs> - void LayeredSphericalAtmosphereBuilder<TMediumInterface, TMediumModelExtra, - TModelArgs...>::checkRadius(LengthType r) const { + inline void LayeredSphericalAtmosphereBuilder<TMediumInterface, TMediumModelExtra, + TModelArgs...>::checkRadius(LengthType r) + const { if (r <= previousRadius_) { throw std::runtime_error("radius must be greater than previous"); } @@ -27,7 +28,7 @@ namespace corsika { template <typename TMediumInterface, template <typename> typename TMediumModelExtra, typename... TModelArgs> - void LayeredSphericalAtmosphereBuilder< + inline void LayeredSphericalAtmosphereBuilder< TMediumInterface, TMediumModelExtra, TModelArgs...>::setNuclearComposition(NuclearComposition const& composition) { composition_ = std::make_unique<NuclearComposition>(composition); @@ -35,7 +36,7 @@ namespace corsika { template <typename TMediumInterface, template <typename> typename TMediumModelExtra, typename... TModelArgs> - void LayeredSphericalAtmosphereBuilder< + inline void LayeredSphericalAtmosphereBuilder< TMediumInterface, TMediumModelExtra, TModelArgs...>::addExponentialLayer(GrammageType b, LengthType c, LengthType upperBoundary) { @@ -70,7 +71,7 @@ namespace corsika { template <typename TMediumInterface, template <typename> typename TMediumModelExtra, typename... TModelArgs> - void LayeredSphericalAtmosphereBuilder< + inline void LayeredSphericalAtmosphereBuilder< TMediumInterface, TMediumModelExtra, TModelArgs...>::addLinearLayer(LengthType c, LengthType upperBoundary) { auto const radius = earthRadius_ + upperBoundary; @@ -104,7 +105,7 @@ namespace corsika { template <typename TMediumInterface, template <typename> typename TMediumModelExtra, typename... TModelArgs> - Environment<TMediumInterface> LayeredSphericalAtmosphereBuilder< + inline Environment<TMediumInterface> LayeredSphericalAtmosphereBuilder< TMediumInterface, TMediumModelExtra, TModelArgs...>::assemble() { Environment<TMediumInterface> env; assemble(env); @@ -113,7 +114,7 @@ namespace corsika { template <typename TMediumInterface, template <typename> typename TMediumModelExtra, typename... TModelArgs> - void LayeredSphericalAtmosphereBuilder< + inline void LayeredSphericalAtmosphereBuilder< TMediumInterface, TMediumModelExtra, TModelArgs...>::assemble(Environment<TMediumInterface>& env) { auto& universe = env.getUniverse(); diff --git a/corsika/detail/media/LinearApproximationIntegrator.inl b/corsika/detail/media/LinearApproximationIntegrator.inl index 7452ff31d..78b7733ed 100644 --- a/corsika/detail/media/LinearApproximationIntegrator.inl +++ b/corsika/detail/media/LinearApproximationIntegrator.inl @@ -13,12 +13,12 @@ namespace corsika { template <typename TDerived> - auto const& LinearApproximationIntegrator<TDerived>::getImplementation() const { + inline auto const& LinearApproximationIntegrator<TDerived>::getImplementation() const { return *static_cast<TDerived const*>(this); } template <typename TDerived> - auto LinearApproximationIntegrator<TDerived>::getIntegrateGrammage( + inline auto LinearApproximationIntegrator<TDerived>::getIntegrateGrammage( setup::Trajectory const& line, LengthType length) const { auto const c0 = getImplementation().evaluateAt(line.getPosition(0)); auto const c1 = getImplementation().rho_.getFirstDerivative(line.getPosition(0), @@ -27,7 +27,7 @@ namespace corsika { } template <typename TDerived> - auto LinearApproximationIntegrator<TDerived>::getArclengthFromGrammage( + inline auto LinearApproximationIntegrator<TDerived>::getArclengthFromGrammage( setup::Trajectory const& line, GrammageType grammage) const { auto const c0 = getImplementation().rho_(line.getPosition(0)); auto const c1 = getImplementation().rho_.getFirstDerivative(line.getPosition(0), @@ -37,7 +37,7 @@ namespace corsika { } template <typename TDerived> - auto LinearApproximationIntegrator<TDerived>::getMaximumLength( + inline auto LinearApproximationIntegrator<TDerived>::getMaximumLength( setup::Trajectory const& line, [[maybe_unused]] double relError) const { [[maybe_unused]] auto const c1 = getImplementation().rho_.getSecondDerivative( line.getPosition(0), line.getDirection(0)); diff --git a/corsika/detail/media/MediumPropertyModel.inl b/corsika/detail/media/MediumPropertyModel.inl index 90cdd9754..604175989 100644 --- a/corsika/detail/media/MediumPropertyModel.inl +++ b/corsika/detail/media/MediumPropertyModel.inl @@ -14,17 +14,17 @@ namespace corsika { template <typename T> template <typename... Args> - MediumPropertyModel<T>::MediumPropertyModel(Medium const medium, Args&&... args) + inline MediumPropertyModel<T>::MediumPropertyModel(Medium const medium, Args&&... args) : T(std::forward<Args>(args)...) , medium_(medium) {} template <typename T> - Medium MediumPropertyModel<T>::getMedium(Point const&) const { + inline Medium MediumPropertyModel<T>::getMedium(Point const&) const { return medium_; } template <typename T> - void MediumPropertyModel<T>::setMedium(Medium const medium) { + inline void MediumPropertyModel<T>::setMedium(Medium const medium) { medium_ = medium; } diff --git a/corsika/detail/media/NuclearComposition.inl b/corsika/detail/media/NuclearComposition.inl index 230dfe1a1..85582510e 100644 --- a/corsika/detail/media/NuclearComposition.inl +++ b/corsika/detail/media/NuclearComposition.inl @@ -22,8 +22,8 @@ namespace corsika { - NuclearComposition::NuclearComposition(std::vector<Code> const& pComponents, - std::vector<float> const& pFractions) + inline NuclearComposition::NuclearComposition(std::vector<Code> const& pComponents, + std::vector<float> const& pFractions) : numberFractions_(pFractions) , components_(pComponents) , avgMassNumber_(std::inner_product( diff --git a/corsika/detail/media/ShowerAxis.inl b/corsika/detail/media/ShowerAxis.inl index 1be5d40a6..a42989e92 100644 --- a/corsika/detail/media/ShowerAxis.inl +++ b/corsika/detail/media/ShowerAxis.inl @@ -14,9 +14,9 @@ namespace corsika { template <typename TEnvModel> - ShowerAxis::ShowerAxis(Point const& pStart, Vector<length_d> const& length, - Environment<TEnvModel> const& env, bool const doThrow, - int const steps) + inline ShowerAxis::ShowerAxis(Point const& pStart, Vector<length_d> const& length, + Environment<TEnvModel> const& env, bool const doThrow, + int const steps) : pointStart_(pStart) , length_(length) , throw_(doThrow) @@ -58,7 +58,7 @@ namespace corsika { assert(std::is_sorted(d_.cbegin(), d_.cend())); } - GrammageType ShowerAxis::getX(LengthType l) const { + inline GrammageType ShowerAxis::getX(LengthType l) const { double const fractionalBin = l / steplength_; int const lower = fractionalBin; // indices of nearest X support points double const fraction = fractionalBin - lower; @@ -97,21 +97,21 @@ namespace corsika { return X_[upper] * fraction + X_[lower] * (1 - fraction); } - LengthType ShowerAxis::getSteplength() const { return steplength_; } + inline LengthType ShowerAxis::getSteplength() const { return steplength_; } - GrammageType ShowerAxis::getMaximumX() const { return *X_.rbegin(); } + inline GrammageType ShowerAxis::getMaximumX() const { return *X_.rbegin(); } - GrammageType ShowerAxis::getMinimumX() const { return GrammageType::zero(); } + inline GrammageType ShowerAxis::getMinimumX() const { return GrammageType::zero(); } - GrammageType ShowerAxis::getProjectedX(Point const& p) const { + inline GrammageType ShowerAxis::getProjectedX(Point const& p) const { auto const projectedLength = (p - pointStart_).dot(axis_normalized_); return getX(projectedLength); } - Vector<dimensionless_d> const& ShowerAxis::getDirection() const { + inline DirectionVector const& ShowerAxis::getDirection() const { return axis_normalized_; } - Point const& ShowerAxis::getStart() const { return pointStart_; } + inline Point const& ShowerAxis::getStart() const { return pointStart_; } } // namespace corsika diff --git a/corsika/detail/media/SlidingPlanarExponential.inl b/corsika/detail/media/SlidingPlanarExponential.inl index c5c517954..56d99404c 100644 --- a/corsika/detail/media/SlidingPlanarExponential.inl +++ b/corsika/detail/media/SlidingPlanarExponential.inl @@ -13,7 +13,7 @@ namespace corsika { template <typename T> - SlidingPlanarExponential<T>::SlidingPlanarExponential( + inline SlidingPlanarExponential<T>::SlidingPlanarExponential( Point const& p0, MassDensityType rho0, LengthType lambda, NuclearComposition const& nuclComp, LengthType referenceHeight) : BaseExponential<SlidingPlanarExponential<T>>(p0, rho0, lambda) @@ -21,7 +21,8 @@ namespace corsika { , referenceHeight_(referenceHeight) {} template <typename T> - MassDensityType SlidingPlanarExponential<T>::getMassDensity(Point const& point) const { + inline MassDensityType SlidingPlanarExponential<T>::getMassDensity( + Point const& point) const { auto const height = (point - BaseExponential<SlidingPlanarExponential<T>>::getAnchorPoint()) .getNorm() - @@ -31,12 +32,13 @@ namespace corsika { } template <typename T> - NuclearComposition const& SlidingPlanarExponential<T>::getNuclearComposition() const { + inline NuclearComposition const& SlidingPlanarExponential<T>::getNuclearComposition() + const { return nuclComp_; } template <typename T> - GrammageType SlidingPlanarExponential<T>::getIntegratedGrammage( + inline GrammageType SlidingPlanarExponential<T>::getIntegratedGrammage( setup::Trajectory const& traj, LengthType l) const { auto const axis = (traj.getPosition(0) - BaseExponential<SlidingPlanarExponential<T>>::getAnchorPoint()) @@ -46,7 +48,7 @@ namespace corsika { } template <typename T> - LengthType SlidingPlanarExponential<T>::getArclengthFromGrammage( + inline LengthType SlidingPlanarExponential<T>::getArclengthFromGrammage( setup::Trajectory const& traj, GrammageType const grammage) const { auto const axis = (traj.getPosition(0) - BaseExponential<SlidingPlanarExponential<T>>::getAnchorPoint()) diff --git a/corsika/detail/media/UniformRefractiveIndex.inl b/corsika/detail/media/UniformRefractiveIndex.inl index 1abea2470..d6e5f5a9d 100644 --- a/corsika/detail/media/UniformRefractiveIndex.inl +++ b/corsika/detail/media/UniformRefractiveIndex.inl @@ -14,17 +14,17 @@ namespace corsika { template <typename T> template <typename... Args> - UniformRefractiveIndex<T>::UniformRefractiveIndex(double const n, Args&&... args) + inline UniformRefractiveIndex<T>::UniformRefractiveIndex(double const n, Args&&... args) : T(std::forward<Args>(args)...) , n_(n) {} template <typename T> - double UniformRefractiveIndex<T>::getRefractiveIndex(Point const&) const { + inline double UniformRefractiveIndex<T>::getRefractiveIndex(Point const&) const { return n_; } template <typename T> - void UniformRefractiveIndex<T>::setRefractiveIndex(double const& n) { + inline void UniformRefractiveIndex<T>::setRefractiveIndex(double const& n) { n_ = n; } diff --git a/corsika/detail/media/Universe.inl b/corsika/detail/media/Universe.inl index b3f4d2541..c965ab335 100644 --- a/corsika/detail/media/Universe.inl +++ b/corsika/detail/media/Universe.inl @@ -12,10 +12,10 @@ namespace corsika { - Universe::Universe(CoordinateSystemPtr const& pCS) + inline Universe::Universe(CoordinateSystemPtr const& pCS) : corsika::Sphere(Point{pCS, 0 * meter, 0 * meter, 0 * meter}, meter * std::numeric_limits<double>::infinity()) {} - bool Universe::contains(corsika::Point const&) const { return true; } + inline bool Universe::contains(corsika::Point const&) const { return true; } } // namespace corsika diff --git a/corsika/detail/media/VolumeTreeNode.inl b/corsika/detail/media/VolumeTreeNode.inl index bdae7cc12..7a334e61f 100644 --- a/corsika/detail/media/VolumeTreeNode.inl +++ b/corsika/detail/media/VolumeTreeNode.inl @@ -14,7 +14,7 @@ namespace corsika { template <typename IModelProperties> - bool VolumeTreeNode<IModelProperties>::contains(Point const& p) const { + inline bool VolumeTreeNode<IModelProperties>::contains(Point const& p) const { return geoVolume_->contains(p); } @@ -32,7 +32,7 @@ namespace corsika { * \class Point \p p, or nullptr iff \p p is not contained in this volume. */ template <typename IModelProperties> - VolumeTreeNode<IModelProperties> const* + inline VolumeTreeNode<IModelProperties> const* VolumeTreeNode<IModelProperties>::getContainingNode(Point const& p) const { if (!contains(p)) { return nullptr; } @@ -54,7 +54,7 @@ namespace corsika { template <typename IModelProperties> template <typename TCallable, bool preorder> - void VolumeTreeNode<IModelProperties>::walk(TCallable func) { + inline void VolumeTreeNode<IModelProperties>::walk(TCallable func) { if constexpr (preorder) { func(*this); } std::for_each(childNodes_.begin(), childNodes_.end(), @@ -64,7 +64,7 @@ namespace corsika { } template <typename IModelProperties> - void VolumeTreeNode<IModelProperties>::addChild( + inline void VolumeTreeNode<IModelProperties>::addChild( typename VolumeTreeNode<IModelProperties>::VTNUPtr pChild) { pChild->parentNode_ = this; childNodes_.push_back(std::move(pChild)); @@ -74,19 +74,9 @@ namespace corsika { } template <typename IModelProperties> - void VolumeTreeNode<IModelProperties>::excludeOverlapWith( + inline void VolumeTreeNode<IModelProperties>::excludeOverlapWith( typename VolumeTreeNode<IModelProperties>::VTNUPtr const& pNode) { excludedNodes_.push_back(pNode.get()); } - /* - template <typename IModelProperties> - template <class MediumType, typename... Args> - auto VolumeTreeNode<IModelProperties>::createMedium(Args&&... args) { - static_assert(std::is_base_of_v<IMediumModel, MediumType>, - "unusable type provided, needs to be derived from \"IMediumModel\""); - - return std::make_shared<MediumType>(std::forward<Args>(args)...); - } - */ } // namespace corsika diff --git a/corsika/detail/media/WeightProvider.inl b/corsika/detail/media/WeightProvider.inl index af9849aa3..b9cf1be7a 100644 --- a/corsika/detail/media/WeightProvider.inl +++ b/corsika/detail/media/WeightProvider.inl @@ -13,19 +13,19 @@ namespace corsika { template <class AConstIterator, class BConstIterator> - WeightProviderIterator<AConstIterator, BConstIterator>::WeightProviderIterator( + inline WeightProviderIterator<AConstIterator, BConstIterator>::WeightProviderIterator( AConstIterator a, BConstIterator b) : aIter_(a) , bIter_(b) {} template <class AConstIterator, class BConstIterator> - typename WeightProviderIterator<AConstIterator, BConstIterator>::value_type + inline typename WeightProviderIterator<AConstIterator, BConstIterator>::value_type WeightProviderIterator<AConstIterator, BConstIterator>::operator*() const { return ((*aIter_) * (*bIter_)).magnitude(); } template <class AConstIterator, class BConstIterator> - WeightProviderIterator<AConstIterator, BConstIterator>& + inline WeightProviderIterator<AConstIterator, BConstIterator>& WeightProviderIterator<AConstIterator, BConstIterator>::operator++() { // prefix ++ ++aIter_; @@ -34,15 +34,15 @@ namespace corsika { } template <class AConstIterator, class BConstIterator> - bool WeightProviderIterator<AConstIterator, BConstIterator>::operator==( + inline bool WeightProviderIterator<AConstIterator, BConstIterator>::operator==( WeightProviderIterator other) { return aIter_ == other.aIter_; } template <class AConstIterator, class BConstIterator> - bool WeightProviderIterator<AConstIterator, BConstIterator>::operator!=( + inline bool WeightProviderIterator<AConstIterator, BConstIterator>::operator!=( WeightProviderIterator other) { return !(*this == other); } -} // namespace corsika \ No newline at end of file +} // namespace corsika diff --git a/corsika/detail/modules/HadronicElasticModel.inl b/corsika/detail/modules/HadronicElasticModel.inl index bb5c16133..e048a2d91 100644 --- a/corsika/detail/modules/HadronicElasticModel.inl +++ b/corsika/detail/modules/HadronicElasticModel.inl @@ -23,13 +23,14 @@ namespace corsika { - HadronicElasticInteraction::HadronicElasticInteraction(CrossSectionType x, - CrossSectionType y) + inline HadronicElasticInteraction::HadronicElasticInteraction(CrossSectionType x, + CrossSectionType y) : parX_(x) , parY_(y) {} template <> - GrammageType HadronicElasticInteraction::getInteractionLength(SetupParticle const& p) { + inline GrammageType HadronicElasticInteraction::getInteractionLength( + SetupParticle const& p) { if (p.getPID() == Code::Proton) { auto const* currentNode = p.getNode(); auto const& mediumComposition = @@ -69,7 +70,7 @@ namespace corsika { } template <typename TParticle> - ProcessReturn HadronicElasticInteraction::doInteraction(TParticle& p) { + inline ProcessReturn HadronicElasticInteraction::doInteraction(TParticle& p) { if (p.getPID() != Code::Proton) { return ProcessReturn::Ok; } const auto* currentNode = p.getNode(); @@ -160,7 +161,7 @@ namespace corsika { return ProcessReturn::Ok; } - HadronicElasticInteraction::inveV2 HadronicElasticInteraction::B(eV2 s) const { + inline HadronicElasticInteraction::inveV2 HadronicElasticInteraction::B(eV2 s) const { auto constexpr b_p = 2.3; auto const result = (2 * b_p + 2 * b_p + 4 * pow(s * constants::invGeVsq, gfEpsilon) - 4.2) * @@ -170,7 +171,7 @@ namespace corsika { return result; } - CrossSectionType HadronicElasticInteraction::getCrossSection( + inline CrossSectionType HadronicElasticInteraction::getCrossSection( SquaredHEPEnergyType s) const { // assuming every target behaves like a proton, parX_ and parY_ are universal CrossSectionType const sigmaTotal = parX_ * pow(s * constants::invGeVsq, gfEpsilon) + diff --git a/corsika/detail/modules/LongitudinalProfile.inl b/corsika/detail/modules/LongitudinalProfile.inl index df6bb471d..d332913b5 100644 --- a/corsika/detail/modules/LongitudinalProfile.inl +++ b/corsika/detail/modules/LongitudinalProfile.inl @@ -20,14 +20,16 @@ namespace corsika { - LongitudinalProfile::LongitudinalProfile(ShowerAxis const& shower_axis, GrammageType dX) + inline LongitudinalProfile::LongitudinalProfile(ShowerAxis const& shower_axis, + GrammageType dX) : dX_(dX) , shower_axis_{shower_axis} , profiles_{static_cast<unsigned int>(shower_axis.getMaximumX() / dX_) + 1} {} template <typename TParticle, typename TTrack> - ProcessReturn LongitudinalProfile::doContinuous(TParticle const& vP, - TTrack const& vTrack, bool const) { + inline ProcessReturn LongitudinalProfile::doContinuous(TParticle const& vP, + TTrack const& vTrack, + bool const) { auto const pid = vP.getPID(); GrammageType const grammageStart = shower_axis_.getProjectedX(vTrack.getPosition(0)); @@ -60,8 +62,8 @@ namespace corsika { return ProcessReturn::Ok; } - void LongitudinalProfile::save(std::string const& filename, const int width, - const int precision) { + inline void LongitudinalProfile::save(std::string const& filename, const int width, + const int precision) { std::ofstream f{filename}; f << "# X / g·cm¯², gamma, e+, e-, mu+, mu-, all hadrons" << std::endl; for (size_t b = 0; b < profiles_.size(); ++b) { diff --git a/corsika/detail/modules/ObservationPlane.inl b/corsika/detail/modules/ObservationPlane.inl index 697481b8b..f3e77a4c8 100644 --- a/corsika/detail/modules/ObservationPlane.inl +++ b/corsika/detail/modules/ObservationPlane.inl @@ -14,8 +14,9 @@ namespace corsika { - ObservationPlane::ObservationPlane(Plane const& obsPlane, DirectionVector const& x_axis, - std::string const& filename, bool deleteOnHit) + inline ObservationPlane::ObservationPlane(Plane const& obsPlane, + DirectionVector const& x_axis, + std::string const& filename, bool deleteOnHit) : plane_(obsPlane) , outputStream_(filename) , deleteOnHit_(deleteOnHit) @@ -27,7 +28,7 @@ namespace corsika { << std::endl; } - ProcessReturn ObservationPlane::doContinuous( + inline ProcessReturn ObservationPlane::doContinuous( corsika::setup::Stack::particle_type& particle, corsika::setup::Trajectory&, bool const stepLimit) { @@ -54,7 +55,7 @@ namespace corsika { } } - LengthType ObservationPlane::getMaxStepLength( + inline LengthType ObservationPlane::getMaxStepLength( corsika::setup::Stack::particle_type const& particle, corsika::setup::Trajectory const& trajectory) { @@ -82,7 +83,7 @@ namespace corsika { return dist; } - void ObservationPlane::showResults() const { + inline void ObservationPlane::showResults() const { CORSIKA_LOG_INFO( " ******************************\n" " ObservationPlane: \n" @@ -92,7 +93,7 @@ namespace corsika { energy_ground_ / 1_GeV, count_ground_); } - void ObservationPlane::reset() { + inline void ObservationPlane::reset() { energy_ground_ = 0_GeV; count_ground_ = 0; } diff --git a/corsika/detail/modules/OnShellCheck.inl b/corsika/detail/modules/OnShellCheck.inl index f8f0b0081..c7ee250f2 100644 --- a/corsika/detail/modules/OnShellCheck.inl +++ b/corsika/detail/modules/OnShellCheck.inl @@ -14,8 +14,8 @@ namespace corsika { - OnShellCheck::OnShellCheck(double const vMassTolerance, double const vEnergyTolerance, - bool const vError) + inline OnShellCheck::OnShellCheck(double const vMassTolerance, + double const vEnergyTolerance, bool const vError) : mass_tolerance_(vMassTolerance) , energy_tolerance_(vEnergyTolerance) , throw_error_(vError) { @@ -25,7 +25,7 @@ namespace corsika { energy_tolerance_ * 100); } - OnShellCheck::~OnShellCheck() { + inline OnShellCheck::~OnShellCheck() { logger_->info( " summary \n" " particles shifted: {} \n" @@ -35,7 +35,7 @@ namespace corsika { } template <typename TView> - void OnShellCheck::doSecondaries(TView& vS) { + inline void OnShellCheck::doSecondaries(TView& vS) { for (auto& p : vS) { auto const pid = p.getPID(); if (is_nucleus(pid)) continue; diff --git a/corsika/detail/modules/ParticleCut.inl b/corsika/detail/modules/ParticleCut.inl index 3fd882225..f4d756675 100644 --- a/corsika/detail/modules/ParticleCut.inl +++ b/corsika/detail/modules/ParticleCut.inl @@ -12,9 +12,10 @@ namespace corsika { - ParticleCut::ParticleCut(HEPEnergyType const eEleCut, HEPEnergyType const ePhoCut, - HEPEnergyType const eHadCut, HEPEnergyType const eMuCut, - bool const inv) + inline ParticleCut::ParticleCut(HEPEnergyType const eEleCut, + HEPEnergyType const ePhoCut, + HEPEnergyType const eHadCut, HEPEnergyType const eMuCut, + bool const inv) : doCutEm_(false) , doCutInv_(inv) , energy_(0_GeV) @@ -41,8 +42,8 @@ namespace corsika { printThresholds(); } - ParticleCut::ParticleCut(HEPEnergyType const eHadCut, HEPEnergyType const eMuCut, - bool const inv) + inline ParticleCut::ParticleCut(HEPEnergyType const eHadCut, HEPEnergyType const eMuCut, + bool const inv) : doCutEm_(true) , doCutInv_(inv) , energy_(0_GeV) @@ -63,7 +64,7 @@ namespace corsika { printThresholds(); } - ParticleCut::ParticleCut(HEPEnergyType const eCut, bool const em, bool const inv) + inline ParticleCut::ParticleCut(HEPEnergyType const eCut, bool const em, bool const inv) : doCutEm_(em) , doCutInv_(inv) , energy_(0_GeV) @@ -76,7 +77,7 @@ namespace corsika { printThresholds(); } - ParticleCut::ParticleCut( + inline ParticleCut::ParticleCut( std::unordered_map<Code const, HEPEnergyType const> const& eCuts, bool const em, bool const inv) : doCutEm_(em) @@ -92,7 +93,7 @@ namespace corsika { } template <typename TParticle> - bool ParticleCut::isBelowEnergyCut(TParticle const& vP) const { + inline bool ParticleCut::isBelowEnergyCut(TParticle const& vP) const { auto const energyLab = vP.getEnergy(); auto const pid = vP.getPID(); // nuclei @@ -105,10 +106,12 @@ namespace corsika { } } - bool ParticleCut::isInvisible(Code const& vCode) const { return is_neutrino(vCode); } + inline bool ParticleCut::isInvisible(Code const& vCode) const { + return is_neutrino(vCode); + } template <typename TParticle> - bool ParticleCut::checkCutParticle(TParticle const& particle) { + inline bool ParticleCut::checkCutParticle(TParticle const& particle) { Code const pid = particle.getPID(); HEPEnergyType energy = particle.getEnergy(); @@ -136,7 +139,7 @@ namespace corsika { return false; // this particle will not be removed/cut } - void ParticleCut::doSecondaries(corsika::setup::StackView& vS) { + inline void ParticleCut::doSecondaries(corsika::setup::StackView& vS) { auto particle = vS.begin(); while (particle != vS.end()) { if (checkCutParticle(particle)) { particle.erase(); } @@ -144,8 +147,9 @@ namespace corsika { } } - ProcessReturn ParticleCut::doContinuous(corsika::setup::Stack::particle_type& particle, - corsika::setup::Trajectory const&, bool const) { + inline ProcessReturn ParticleCut::doContinuous( + corsika::setup::Stack::particle_type& particle, corsika::setup::Trajectory const&, + bool const) { CORSIKA_LOG_TRACE("ParticleCut::DoContinuous"); if (checkCutParticle(particle)) { CORSIKA_LOG_TRACE("removing during continuous"); @@ -156,14 +160,14 @@ namespace corsika { return ProcessReturn::Ok; } - void ParticleCut::printThresholds() { + inline void ParticleCut::printThresholds() { for (auto p : get_all_particles()) { auto const Eth = get_energy_threshold(p); CORSIKA_LOG_INFO("energy threshold for particle {} is {} GeV", p, Eth / 1_GeV); } } - void ParticleCut::showResults() { + inline void ParticleCut::showResults() { CORSIKA_LOG_INFO( " ******************************\n" " energy in em. component (GeV): {} \n " @@ -175,7 +179,7 @@ namespace corsika { em_energy_ / 1_GeV, em_count_, inv_energy_ / 1_GeV, inv_count_, energy_ / 1_GeV); } - void ParticleCut::reset() { + inline void ParticleCut::reset() { em_energy_ = 0_GeV; em_count_ = 0; inv_energy_ = 0_GeV; diff --git a/corsika/detail/modules/StackInspector.inl b/corsika/detail/modules/StackInspector.inl index b657e1531..10b0f1582 100644 --- a/corsika/detail/modules/StackInspector.inl +++ b/corsika/detail/modules/StackInspector.inl @@ -24,18 +24,18 @@ namespace corsika { template <typename TStack> - StackInspector<TStack>::StackInspector(const int vNStep, const bool vReportStack, - const HEPEnergyType vE0) + inline StackInspector<TStack>::StackInspector(const int vNStep, const bool vReportStack, + const HEPEnergyType vE0) : StackProcess<StackInspector<TStack>>(vNStep) , ReportStack_(vReportStack) , E0_(vE0) , StartTime_(std::chrono::system_clock::now()) {} template <typename TStack> - StackInspector<TStack>::~StackInspector() {} + inline StackInspector<TStack>::~StackInspector() {} template <typename TStack> - void StackInspector<TStack>::doStack(const TStack& vS) { + inline void StackInspector<TStack>::doStack(const TStack& vS) { [[maybe_unused]] int i = 0; HEPEnergyType Etot = 0_GeV; diff --git a/corsika/detail/modules/TrackWriter.inl b/corsika/detail/modules/TrackWriter.inl index c6f72edf4..6d4ef2c73 100644 --- a/corsika/detail/modules/TrackWriter.inl +++ b/corsika/detail/modules/TrackWriter.inl @@ -20,7 +20,7 @@ namespace corsika { - TrackWriter::TrackWriter(std::string const& filename) + inline TrackWriter::TrackWriter(std::string const& filename) : filename_(filename) { using namespace std::string_literals; @@ -31,8 +31,8 @@ namespace corsika { } template <typename TParticle, typename TTrack> - ProcessReturn TrackWriter::doContinuous(const TParticle& vP, const TTrack& vT, - bool const) { + inline ProcessReturn TrackWriter::doContinuous(const TParticle& vP, const TTrack& vT, + bool const) { auto const start = vT.getPosition(0).getCoordinates(); auto const delta = vT.getPosition(1).getCoordinates() - start; auto const pdg = static_cast<int>(get_PDG(vP.getPID())); @@ -54,7 +54,7 @@ namespace corsika { } template <typename TParticle, typename TTrack> - LengthType TrackWriter::getMaxStepLength(const TParticle&, const TTrack&) { + inline LengthType TrackWriter::getMaxStepLength(const TParticle&, const TTrack&) { return meter * std::numeric_limits<double>::infinity(); } diff --git a/corsika/detail/modules/TrackingLine.inl b/corsika/detail/modules/TrackingLine.inl index 52200c42d..84400b81d 100644 --- a/corsika/detail/modules/TrackingLine.inl +++ b/corsika/detail/modules/TrackingLine.inl @@ -20,7 +20,7 @@ namespace corsika::tracking_line { - std::optional<std::pair<TimeType, TimeType>> TimeOfIntersection( + inline std::optional<std::pair<TimeType, TimeType>> TimeOfIntersection( corsika::Line const& line, corsika::Sphere const& sphere) { auto const delta = line.getStartPoint() - sphere.getCenter(); auto const v = line.getVelocity(); @@ -42,7 +42,7 @@ namespace corsika::tracking_line { } } - TimeType getTimeOfIntersection(Line const& vLine, Plane const& vPlane) { + inline TimeType getTimeOfIntersection(Line const& vLine, Plane const& vPlane) { auto const delta = vPlane.getCenter() - vLine.getStartPoint(); auto const v = vLine.getVelocity(); diff --git a/corsika/detail/modules/conex/CONEXhybrid.inl b/corsika/detail/modules/conex/CONEXhybrid.inl index 29c3886aa..5b350013f 100644 --- a/corsika/detail/modules/conex/CONEXhybrid.inl +++ b/corsika/detail/modules/conex/CONEXhybrid.inl @@ -22,9 +22,9 @@ namespace corsika { - CONEXhybrid::CONEXhybrid(Point center, ShowerAxis const& showerAxis, - LengthType groundDist, LengthType injectionHeight, - HEPEnergyType primaryEnergy, PDGCode primaryPDG) + inline CONEXhybrid::CONEXhybrid(Point center, ShowerAxis const& showerAxis, + LengthType groundDist, LengthType injectionHeight, + HEPEnergyType primaryEnergy, PDGCode primaryPDG) : center_{center} , showerAxis_{showerAxis} , groundDist_{groundDist} @@ -124,7 +124,7 @@ namespace corsika { ::conex::conexrun_(ipart, eprima, theta, phi, xminp, dimpact, ioseed.data()); } - void CONEXhybrid::doSecondaries(setup::StackView& vS) { + inline void CONEXhybrid::doSecondaries(setup::StackView& vS) { auto p = vS.begin(); while (p != vS.end()) { Code const pid = p.getPID(); @@ -136,9 +136,9 @@ namespace corsika { } } - bool CONEXhybrid::addParticle(Code pid, HEPEnergyType energy, HEPEnergyType mass, - Point const& position, DirectionVector const& direction, - TimeType t) { + inline bool CONEXhybrid::addParticle(Code pid, HEPEnergyType energy, HEPEnergyType mass, + Point const& position, + DirectionVector const& direction, TimeType t) { auto const it = std::find_if(egs_em_codes_.cbegin(), egs_em_codes_.cend(), [=](auto const& p) { return pid == p.first; }); @@ -222,7 +222,7 @@ namespace corsika { return true; } - void CONEXhybrid::solveCE() { + inline void CONEXhybrid::solveCE() { ::conex::conexcascade_(); diff --git a/corsika/detail/modules/energy_loss/BetheBlochPDG.inl b/corsika/detail/modules/energy_loss/BetheBlochPDG.inl index cbabb0892..dff3b2bfb 100644 --- a/corsika/detail/modules/energy_loss/BetheBlochPDG.inl +++ b/corsika/detail/modules/energy_loss/BetheBlochPDG.inl @@ -26,14 +26,14 @@ namespace corsika { return sqrt((Elab - m) * (Elab + m)); }; - BetheBlochPDG::BetheBlochPDG(ShowerAxis const& shower_axis) + inline BetheBlochPDG::BetheBlochPDG(ShowerAxis const& shower_axis) : dX_(10_g / square(1_cm)) // profile binning , dX_threshold_(0.0001_g / square(1_cm)) , shower_axis_(shower_axis) , profile_(int(shower_axis.getMaximumX() / dX_) + 1) {} - HEPEnergyType BetheBlochPDG::getBetheBloch(setup::Stack::particle_type const& p, - GrammageType const dX) { + inline HEPEnergyType BetheBlochPDG::getBetheBloch(setup::Stack::particle_type const& p, + GrammageType const dX) { // all these are material constants and have to come through Environment // right now: values for nitrogen_D @@ -126,21 +126,22 @@ namespace corsika { } // radiation losses according to PDG 2018, ch. 33 ref. [5] - HEPEnergyType BetheBlochPDG::getRadiationLosses(setup::Stack::particle_type const& vP, - GrammageType const vDX) { + inline HEPEnergyType BetheBlochPDG::getRadiationLosses( + setup::Stack::particle_type const& vP, GrammageType const vDX) { // simple-minded hard-coded value for b(E) inspired by data from // http://pdg.lbl.gov/2018/AtomicNuclearProperties/ for N and O. auto constexpr b = 3.0 * 1e-6 * square(1_cm) / 1_g; return -vP.getEnergy() * b * vDX; } - HEPEnergyType BetheBlochPDG::getTotalEnergyLoss(setup::Stack::particle_type const& vP, - GrammageType const vDX) { + inline HEPEnergyType BetheBlochPDG::getTotalEnergyLoss( + setup::Stack::particle_type const& vP, GrammageType const vDX) { return getBetheBloch(vP, vDX) + getRadiationLosses(vP, vDX); } - ProcessReturn BetheBlochPDG::doContinuous(setup::Stack::particle_type& p, - setup::Trajectory const& t, bool const) { + inline ProcessReturn BetheBlochPDG::doContinuous(setup::Stack::particle_type& p, + setup::Trajectory const& t, + bool const) { if (p.getChargeNumber() == 0) return ProcessReturn::Ok; GrammageType const dX = @@ -159,8 +160,9 @@ namespace corsika { return ProcessReturn::Ok; } - LengthType BetheBlochPDG::getMaxStepLength(setup::Stack::particle_type const& vParticle, - setup::Trajectory const& vTrack) const { + inline LengthType BetheBlochPDG::getMaxStepLength( + setup::Stack::particle_type const& vParticle, + setup::Trajectory const& vTrack) const { if (vParticle.getChargeNumber() == 0) { return meter * std::numeric_limits<double>::infinity(); } @@ -187,15 +189,15 @@ namespace corsika { vTrack, maxGrammage); } - void BetheBlochPDG::updateMomentum(corsika::setup::Stack::particle_type& vP, - HEPEnergyType Enew) { + inline void BetheBlochPDG::updateMomentum(corsika::setup::Stack::particle_type& vP, + HEPEnergyType Enew) { HEPMomentumType Pnew = elab2plab(Enew, vP.getMass()); auto pnew = vP.getMomentum(); vP.setMomentum(pnew * Pnew / pnew.getNorm()); } - void BetheBlochPDG::fillProfile(setup::Trajectory const& vTrack, - const HEPEnergyType dE) { + inline void BetheBlochPDG::fillProfile(setup::Trajectory const& vTrack, + const HEPEnergyType dE) { GrammageType grammageStart = shower_axis_.getProjectedX(vTrack.getPosition(0)); GrammageType grammageEnd = shower_axis_.getProjectedX(vTrack.getPosition(1)); @@ -243,7 +245,7 @@ namespace corsika { CORSIKA_LOG_DEBUG("total energy added to histogram: {} ", energyCount); } - void BetheBlochPDG::printProfile() const { + inline void BetheBlochPDG::printProfile() const { std::ofstream file("EnergyLossProfile.dat"); file << "# EnergyLoss profile" << std::endl << "# lower X bin edge [g/cm2] dE/dX [GeV/g/cm2]\n"; @@ -255,11 +257,11 @@ namespace corsika { file.close(); } - HEPEnergyType BetheBlochPDG::getTotal() const { + inline HEPEnergyType BetheBlochPDG::getTotal() const { return std::accumulate(profile_.cbegin(), profile_.cend(), HEPEnergyType::zero()); } - void BetheBlochPDG::showResults() const { + inline void BetheBlochPDG::showResults() const { CORSIKA_LOG_INFO( " ******************************\n" " PROCESS::ContinuousProcess: \n" @@ -267,6 +269,6 @@ namespace corsika { energy_lost_ / 1_GeV); } - void BetheBlochPDG::reset() { energy_lost_ = 0_GeV; } + inline void BetheBlochPDG::reset() { energy_lost_ = 0_GeV; } } // namespace corsika diff --git a/corsika/detail/modules/proposal/ContinuousProcess.inl b/corsika/detail/modules/proposal/ContinuousProcess.inl index b494c7b72..b4b0bf963 100644 --- a/corsika/detail/modules/proposal/ContinuousProcess.inl +++ b/corsika/detail/modules/proposal/ContinuousProcess.inl @@ -23,7 +23,8 @@ namespace corsika::proposal { - void ContinuousProcess::buildCalculator(Code code, NuclearComposition const& comp) { + inline void ContinuousProcess::buildCalculator(Code code, + NuclearComposition const& comp) { // search crosssection builder for given particle auto p_cross = cross.find(code); if (p_cross == cross.end()) @@ -47,13 +48,13 @@ namespace corsika::proposal { } template <> - ContinuousProcess::ContinuousProcess(setup::Environment const& _env) + inline ContinuousProcess::ContinuousProcess(setup::Environment const& _env) : ProposalProcessBase(_env) {} template <> - void ContinuousProcess::scatter(setup::Stack::particle_type& vP, - HEPEnergyType const& loss, - GrammageType const& grammage) { + inline void ContinuousProcess::scatter(setup::Stack::particle_type& vP, + HEPEnergyType const& loss, + GrammageType const& grammage) { // get or build corresponding calculators auto c = getCalculator(vP, calc); @@ -87,8 +88,9 @@ namespace corsika::proposal { } template <> - ProcessReturn ContinuousProcess::doContinuous(setup::Stack::particle_type& vP, - setup::Trajectory const& vT, bool const) { + inline ProcessReturn ContinuousProcess::doContinuous(setup::Stack::particle_type& vP, + setup::Trajectory const& vT, + bool const) { if (!canInteract(vP.getPID())) return ProcessReturn::Ok; if (vT.getLength() == 0_m) return ProcessReturn::Ok; @@ -114,8 +116,8 @@ namespace corsika::proposal { } template <> - LengthType ContinuousProcess::getMaxStepLength(setup::Stack::particle_type const& vP, - setup::Trajectory const& vT) { + inline LengthType ContinuousProcess::getMaxStepLength( + setup::Stack::particle_type const& vP, setup::Trajectory const& vT) { auto const code = vP.getPID(); if (!canInteract(code)) return meter * std::numeric_limits<double>::infinity(); @@ -148,7 +150,7 @@ namespace corsika::proposal { return dist; } - void ContinuousProcess::showResults() const { + inline void ContinuousProcess::showResults() const { CORSIKA_LOG_DEBUG( " ******************************\n" " PROCESS::ContinuousProcess: \n" @@ -156,6 +158,6 @@ namespace corsika::proposal { energy_lost_ / 1_GeV); } - void ContinuousProcess::reset() { energy_lost_ = 0_GeV; } + inline void ContinuousProcess::reset() { energy_lost_ = 0_GeV; } } // namespace corsika::proposal diff --git a/corsika/detail/modules/proposal/Interaction.inl b/corsika/detail/modules/proposal/Interaction.inl index 4874bda1f..fb6c157da 100644 --- a/corsika/detail/modules/proposal/Interaction.inl +++ b/corsika/detail/modules/proposal/Interaction.inl @@ -24,10 +24,10 @@ namespace corsika::proposal { template <> - Interaction::Interaction(setup::Environment const& _env) + inline Interaction::Interaction(setup::Environment const& _env) : ProposalProcessBase(_env) {} - void Interaction::buildCalculator(Code code, NuclearComposition const& comp) { + inline void Interaction::buildCalculator(Code code, NuclearComposition const& comp) { // search crosssection builder for given particle auto p_cross = cross.find(code); if (p_cross == cross.end()) @@ -52,7 +52,7 @@ namespace corsika::proposal { } template <> - ProcessReturn Interaction::doInteraction(setup::StackView& view) { + inline ProcessReturn Interaction::doInteraction(setup::StackView& view) { auto const projectile = view.getProjectile(); @@ -103,7 +103,7 @@ namespace corsika::proposal { } template <> - GrammageType Interaction::getInteractionLength( + inline GrammageType Interaction::getInteractionLength( setup::Stack::particle_type const& projectile) { if (canInteract(projectile.getPID())) { diff --git a/corsika/detail/modules/proposal/ProposalProcessBase.inl b/corsika/detail/modules/proposal/ProposalProcessBase.inl index 21d0cce57..992d24e4d 100644 --- a/corsika/detail/modules/proposal/ProposalProcessBase.inl +++ b/corsika/detail/modules/proposal/ProposalProcessBase.inl @@ -25,12 +25,12 @@ namespace corsika::proposal { - bool ProposalProcessBase::canInteract(Code pcode) const { + inline bool ProposalProcessBase::canInteract(Code pcode) const { if (std::find(begin(tracked), end(tracked), pcode) != end(tracked)) return true; return false; } - ProposalProcessBase::ProposalProcessBase(setup::Environment const& _env) + inline ProposalProcessBase::ProposalProcessBase(setup::Environment const& _env) : RNG_(RNGManager::getInstance().getRandomStream("proposal")) { _env.getUniverse()->walk([&](auto& vtn) { if (vtn.hasModelProperties()) { @@ -71,7 +71,8 @@ namespace corsika::proposal { } } - size_t ProposalProcessBase::hash::operator()(const calc_key_t& p) const noexcept { + inline size_t ProposalProcessBase::hash::operator()(const calc_key_t& p) const + noexcept { return p.first ^ std::hash<Code>{}(p.second); } diff --git a/corsika/detail/modules/pythia8/Decay.inl b/corsika/detail/modules/pythia8/Decay.inl index a0dcc7e7c..d41c14902 100644 --- a/corsika/detail/modules/pythia8/Decay.inl +++ b/corsika/detail/modules/pythia8/Decay.inl @@ -17,21 +17,21 @@ namespace corsika::pythia8 { - Decay::Decay(bool const print_listing) + inline Decay::Decay(bool const print_listing) : Pythia8::Pythia(CORSIKA_Pythia8_XML_DIR) , print_listing_(print_listing) { init(); } - Decay::Decay(std::set<Code> const& those) + inline Decay::Decay(std::set<Code> const& those) : handleAllDecays_(false) , handledDecays_(those) { init(); } - Decay::~Decay() { CORSIKA_LOG_INFO("Pythia::Decay n={}", count_); } + inline Decay::~Decay() { CORSIKA_LOG_INFO("Pythia::Decay n={}", count_); } - void Decay::init() { + inline void Decay::init() { // run this only once during construction @@ -66,7 +66,7 @@ namespace corsika::pythia8 { throw std::runtime_error("Pythia::Decay: Initialization failed!"); } - bool Decay::canHandleDecay(Code const vParticleCode) { + inline bool Decay::canHandleDecay(Code const vParticleCode) { // if known to pythia and not proton, electron or neutrino it can decay if (vParticleCode == Code::Proton || vParticleCode == Code::AntiProton || vParticleCode == Code::NuE || vParticleCode == Code::NuMu || @@ -80,7 +80,7 @@ namespace corsika::pythia8 { return false; } - void Decay::setHandleDecay(Code const vParticleCode) { + inline void Decay::setHandleDecay(Code const vParticleCode) { handleAllDecays_ = false; CORSIKA_LOG_INFO("Pythia::Decay: set to handle decay of {} ", vParticleCode); if (Decay::canHandleDecay(vParticleCode)) @@ -89,37 +89,37 @@ namespace corsika::pythia8 { throw std::runtime_error("this decay can not be handled by pythia!"); } - void Decay::setHandleDecay(std::vector<Code> const& vParticleList) { + inline void Decay::setHandleDecay(std::vector<Code> const& vParticleList) { handleAllDecays_ = false; for (auto p : vParticleList) setHandleDecay(p); } - bool Decay::isDecayHandled(Code const vParticleCode) { + inline bool Decay::isDecayHandled(Code const vParticleCode) { if (handleAllDecays_ && canHandleDecay(vParticleCode)) return true; else return handledDecays_.find(vParticleCode) != Decay::handledDecays_.end(); } - void Decay::setStable(std::vector<Code> const& particleList) { + inline void Decay::setStable(std::vector<Code> const& particleList) { for (auto p : particleList) Decay::setStable(p); } - void Decay::setUnstable(Code const pCode) { + inline void Decay::setUnstable(Code const pCode) { CORSIKA_LOG_INFO("Pythia::Decay: setting {} unstable..", pCode); Pythia8::Pythia::particleData.mayDecay(static_cast<int>(get_PDG(pCode)), true); } - void Decay::setStable(Code const pCode) { + inline void Decay::setStable(Code const pCode) { CORSIKA_LOG_INFO("Pythia::Decay: setting {} stable..", pCode); Pythia8::Pythia::particleData.mayDecay(static_cast<int>(get_PDG(pCode)), false); } - bool Decay::isStable(Code const vCode) { + inline bool Decay::isStable(Code const vCode) { return Pythia8::Pythia::particleData.canDecay(static_cast<int>(get_PDG(vCode))); } - bool Decay::canDecay(Code const pCode) { + inline bool Decay::canDecay(Code const pCode) { bool const ans = Pythia8::Pythia::particleData.canDecay(static_cast<int>(get_PDG(pCode))); CORSIKA_LOG_INFO("Pythia::Decay: checking if particle: {} can decay in PYTHIA? {} ", @@ -127,12 +127,12 @@ namespace corsika::pythia8 { return ans; } - void Decay::printDecayConfig(Code const vCode) { + inline void Decay::printDecayConfig(Code const vCode) { CORSIKA_LOG_INFO("Decay: Pythia decay configuration:"); CORSIKA_LOG_INFO(" {} is {} ", vCode, (isStable(vCode) ? "stable" : "unstable")); } - void Decay::printDecayConfig() { + inline void Decay::printDecayConfig() { CORSIKA_LOG_INFO("Pythia::Decay: decay configuration:"); if (handleAllDecays_) CORSIKA_LOG_INFO(" all particles known to Pythia are handled by Pythia::Decay!"); @@ -142,7 +142,7 @@ namespace corsika::pythia8 { } template <typename TParticle> - TimeType Decay::getLifetime(TParticle const& particle) { + inline TimeType Decay::getLifetime(TParticle const& particle) { auto const pid = particle.getPID(); if (canDecay(pid)) { @@ -167,7 +167,7 @@ namespace corsika::pythia8 { } template <typename TView> - void Decay::doDecay(TView& view) { + inline void Decay::doDecay(TView& view) { auto projectile = view.getProjectile(); diff --git a/corsika/detail/modules/pythia8/Interaction.inl b/corsika/detail/modules/pythia8/Interaction.inl index 5395e8b1f..4b74ed67f 100644 --- a/corsika/detail/modules/pythia8/Interaction.inl +++ b/corsika/detail/modules/pythia8/Interaction.inl @@ -21,9 +21,11 @@ namespace corsika::pythia8 { - Interaction::~Interaction() { CORSIKA_LOG_INFO("Pythia::Interaction n= {}", count_); } + inline Interaction::~Interaction() { + CORSIKA_LOG_INFO("Pythia::Interaction n= {}", count_); + } - Interaction::Interaction(bool const print_listing) + inline Interaction::Interaction(bool const print_listing) : Pythia8::Pythia(CORSIKA_Pythia8_XML_DIR) , print_listing_(print_listing) { @@ -64,22 +66,23 @@ namespace corsika::pythia8 { &(Pythia8::Pythia::particleData), &(Pythia8::Pythia::rndm)); } - void Interaction::setStable(std::vector<Code> const& particleList) { + inline void Interaction::setStable(std::vector<Code> const& particleList) { for (auto p : particleList) Interaction::setStable(p); } - void Interaction::setUnstable(Code const pCode) { + inline void Interaction::setUnstable(Code const pCode) { CORSIKA_LOG_DEBUG("Pythia::Interaction: setting {} unstable..", pCode); Pythia8::Pythia::particleData.mayDecay(static_cast<int>(get_PDG(pCode)), true); } - void Interaction::setStable(Code const pCode) { + inline void Interaction::setStable(Code const pCode) { CORSIKA_LOG_DEBUG("Pythia::Interaction: setting {} stable..", pCode); Pythia8::Pythia::particleData.mayDecay(static_cast<int>(get_PDG(pCode)), false); } - void Interaction::configureLabFrameCollision(Code const BeamId, Code const TargetId, - HEPEnergyType const BeamEnergy) { + inline void Interaction::configureLabFrameCollision(Code const BeamId, + Code const TargetId, + HEPEnergyType const BeamEnergy) { // Pythia configuration of the current event // very clumsy. I am sure this can be done better.. @@ -111,12 +114,12 @@ namespace corsika::pythia8 { throw std::runtime_error("Pythia::Interaction: Initialization failed!"); } - bool Interaction::canInteract(Code const pCode) { + inline bool Interaction::canInteract(Code const pCode) { return pCode == Code::Proton || pCode == Code::Neutron || pCode == Code::AntiProton || pCode == Code::AntiNeutron || pCode == Code::PiMinus || pCode == Code::PiPlus; } - std::tuple<CrossSectionType, CrossSectionType> Interaction::getCrossSection( + inline std::tuple<CrossSectionType, CrossSectionType> Interaction::getCrossSection( Code const BeamId, Code const TargetId, HEPEnergyType const CoMenergy) { // interaction possible in pythia? if (TargetId == Code::Proton || TargetId == Code::Hydrogen) { @@ -146,7 +149,7 @@ namespace corsika::pythia8 { } } - GrammageType Interaction::getInteractionLength( + inline GrammageType Interaction::getInteractionLength( corsika::setup::Stack::particle_type const& particle) { // coordinate system, get global frame of reference @@ -216,7 +219,7 @@ namespace corsika::pythia8 { } template <class TView> - void Interaction::doInteraction(TView& view) { + inline void Interaction::doInteraction(TView& view) { auto projectile = view.getProjectile(); diff --git a/corsika/detail/modules/pythia8/Random.inl b/corsika/detail/modules/pythia8/Random.inl index c077e0bf7..cf1408f1e 100644 --- a/corsika/detail/modules/pythia8/Random.inl +++ b/corsika/detail/modules/pythia8/Random.inl @@ -12,6 +12,6 @@ namespace corsika::pythia8 { - double Random::flat() { return Dist_(RNG_); } + inline double Random::flat() { return Dist_(RNG_); } } // namespace corsika::pythia8 diff --git a/corsika/detail/modules/qgsjetII/Interaction.inl b/corsika/detail/modules/qgsjetII/Interaction.inl index da703d7ef..a97265abc 100644 --- a/corsika/detail/modules/qgsjetII/Interaction.inl +++ b/corsika/detail/modules/qgsjetII/Interaction.inl @@ -27,7 +27,7 @@ namespace corsika::qgsjetII { - Interaction::Interaction(const std::string& dataPath) + inline Interaction::Interaction(const std::string& dataPath) : data_path_(dataPath) { if (dataPath == "") { if (std::getenv("CORSIKA_DATA")) { @@ -46,14 +46,15 @@ namespace corsika::qgsjetII { } } - Interaction::~Interaction() { + inline Interaction::~Interaction() { CORSIKA_LOG_DEBUG("QgsjetII::Interaction n= {}", count_); } - CrossSectionType Interaction::getCrossSection(const Code beamId, const Code targetId, - const HEPEnergyType Elab, - const unsigned int Abeam, - const unsigned int targetA) const { + inline CrossSectionType Interaction::getCrossSection(const Code beamId, + const Code targetId, + const HEPEnergyType Elab, + const unsigned int Abeam, + const unsigned int targetA) const { double sigProd = std::numeric_limits<double>::infinity(); if (corsika::qgsjetII::canInteract(beamId)) { @@ -88,7 +89,7 @@ namespace corsika::qgsjetII { } template <typename TParticle> - GrammageType Interaction::getInteractionLength(const TParticle& vP) const { + inline GrammageType Interaction::getInteractionLength(const TParticle& vP) const { // coordinate system, get global frame of reference CoordinateSystemPtr const& rootCS = get_root_CoordinateSystem(); @@ -160,7 +161,7 @@ namespace corsika::qgsjetII { */ template <typename TView> - void Interaction::doInteraction(TView& view) { + inline void Interaction::doInteraction(TView& view) { auto const projectile = view.getProjectile(); diff --git a/corsika/detail/modules/qgsjetII/QGSJetIIStack.inl b/corsika/detail/modules/qgsjetII/QGSJetIIStack.inl index 60f86fb48..92422c1dc 100644 --- a/corsika/detail/modules/qgsjetII/QGSJetIIStack.inl +++ b/corsika/detail/modules/qgsjetII/QGSJetIIStack.inl @@ -10,58 +10,61 @@ namespace corsika::qgsjetII { - void QGSJetIIStackData::clear() { + inline void QGSJetIIStackData::clear() { qgarr12_.nsp = 0; qgarr13_.nsf = 0; qgarr55_.nwt = 0; } - unsigned int QGSJetIIStackData::getSize() const { return qgarr12_.nsp; } - unsigned int QGSJetIIStackData::getCapacity() const { return nptmax; } + inline unsigned int QGSJetIIStackData::getSize() const { return qgarr12_.nsp; } + inline unsigned int QGSJetIIStackData::getCapacity() const { return nptmax; } - void QGSJetIIStackData::setId(const unsigned int i, const int v) { + inline void QGSJetIIStackData::setId(const unsigned int i, const int v) { qgarr14_.ich[i] = v; } - void QGSJetIIStackData::setEnergy(const unsigned int i, const HEPEnergyType v) { + inline void QGSJetIIStackData::setEnergy(const unsigned int i, const HEPEnergyType v) { qgarr14_.esp[i][0] = v / 1_GeV; } - void QGSJetIIStackData::setMomentum(const unsigned int i, const MomentumVector& v) { + inline void QGSJetIIStackData::setMomentum(const unsigned int i, + const MomentumVector& v) { auto tmp = v.getComponents(); qgarr14_.esp[i][2] = tmp[0] / 1_GeV; qgarr14_.esp[i][3] = tmp[1] / 1_GeV; qgarr14_.esp[i][1] = tmp[2] / 1_GeV; } - int QGSJetIIStackData::getId(const unsigned int i) const { return qgarr14_.ich[i]; } - HEPEnergyType QGSJetIIStackData::getEnergy(const int i) const { + inline int QGSJetIIStackData::getId(const unsigned int i) const { + return qgarr14_.ich[i]; + } + inline HEPEnergyType QGSJetIIStackData::getEnergy(const int i) const { return qgarr14_.esp[i][0] * 1_GeV; } - MomentumVector QGSJetIIStackData::getMomentum(const unsigned int i, - const CoordinateSystemPtr& CS) const { + inline MomentumVector QGSJetIIStackData::getMomentum( + const unsigned int i, const CoordinateSystemPtr& CS) const { QuantityVector<hepmomentum_d> components = {qgarr14_.esp[i][2] * 1_GeV, qgarr14_.esp[i][3] * 1_GeV, qgarr14_.esp[i][1] * 1_GeV}; return MomentumVector(CS, components); } - void QGSJetIIStackData::copy(const unsigned int i1, const unsigned int i2) { + inline void QGSJetIIStackData::copy(const unsigned int i1, const unsigned int i2) { qgarr14_.ich[i2] = qgarr14_.ich[i1]; for (unsigned int i = 0; i < 4; ++i) qgarr14_.esp[i2][i] = qgarr14_.esp[i1][i]; } - void QGSJetIIStackData::swap(const unsigned int i1, const unsigned int i2) { + inline void QGSJetIIStackData::swap(const unsigned int i1, const unsigned int i2) { std::swap(qgarr14_.ich[i1], qgarr14_.ich[i2]); for (unsigned int i = 0; i < 4; ++i) std::swap(qgarr14_.esp[i1][i], qgarr14_.esp[i2][i]); } - void QGSJetIIStackData::incrementSize() { qgarr12_.nsp++; } - void QGSJetIIStackData::decrementSize() { + inline void QGSJetIIStackData::incrementSize() { qgarr12_.nsp++; } + inline void QGSJetIIStackData::decrementSize() { if (qgarr12_.nsp > 0) { qgarr12_.nsp--; } } template <typename StackIteratorInterface> - void ParticleInterface<StackIteratorInterface>::setParticleData( + inline void ParticleInterface<StackIteratorInterface>::setParticleData( const int vID, const HEPEnergyType vE, const MomentumVector& vP, const HEPMassType) { setPID(vID); @@ -70,7 +73,7 @@ namespace corsika::qgsjetII { } template <typename StackIteratorInterface> - void ParticleInterface<StackIteratorInterface>::setParticleData( + inline void ParticleInterface<StackIteratorInterface>::setParticleData( ParticleInterface<StackIteratorInterface>& /*parent*/, const int vID, const HEPEnergyType vE, const MomentumVector& vP, const HEPMassType) { setPID(vID); @@ -79,34 +82,36 @@ namespace corsika::qgsjetII { } template <typename StackIteratorInterface> - void ParticleInterface<StackIteratorInterface>::setEnergy(const HEPEnergyType v) { + inline void ParticleInterface<StackIteratorInterface>::setEnergy( + const HEPEnergyType v) { getStackData().setEnergy(getIndex(), v); } template <typename StackIteratorInterface> - HEPEnergyType ParticleInterface<StackIteratorInterface>::getEnergy() const { + inline HEPEnergyType ParticleInterface<StackIteratorInterface>::getEnergy() const { return getStackData().getEnergy(getIndex()); } template <typename StackIteratorInterface> - void ParticleInterface<StackIteratorInterface>::setPID(const int v) { + inline void ParticleInterface<StackIteratorInterface>::setPID(const int v) { getStackData().setId(getIndex(), v); } template <typename StackIteratorInterface> - corsika::qgsjetII::QgsjetIICode ParticleInterface<StackIteratorInterface>::getPID() - const { + inline corsika::qgsjetII::QgsjetIICode + ParticleInterface<StackIteratorInterface>::getPID() const { return static_cast<corsika::qgsjetII::QgsjetIICode>(getStackData().getId(getIndex())); } template <typename StackIteratorInterface> - MomentumVector ParticleInterface<StackIteratorInterface>::getMomentum( + inline MomentumVector ParticleInterface<StackIteratorInterface>::getMomentum( const CoordinateSystemPtr& CS) const { return getStackData().getMomentum(getIndex(), CS); } template <typename StackIteratorInterface> - void ParticleInterface<StackIteratorInterface>::setMomentum(const MomentumVector& v) { + inline void ParticleInterface<StackIteratorInterface>::setMomentum( + const MomentumVector& v) { getStackData().setMomentum(getIndex(), v); } diff --git a/corsika/detail/modules/qgsjetII/qgsjet-II-04.inl b/corsika/detail/modules/qgsjetII/qgsjet-II-04.inl index aca1429c3..a36268cf5 100644 --- a/corsika/detail/modules/qgsjetII/qgsjet-II-04.inl +++ b/corsika/detail/modules/qgsjetII/qgsjet-II-04.inl @@ -16,7 +16,7 @@ #include <iostream> #include <random> -datadir::datadir(const std::string& dir) { +inline datadir::datadir(const std::string& dir) { if (dir.length() > 130) { CORSIKA_LOG_ERROR("QGSJetII error, will cut datadir \"{}\" to 130 characters: ", {}); } @@ -26,7 +26,7 @@ datadir::datadir(const std::string& dir) { data[i + 1] = '\0'; } -double qgran_(int&) { +inline double qgran_(int&) { static corsika::default_prng_type& rng = corsika::RNGManager::getInstance().GetRandomStream("qgran"); @@ -34,6 +34,6 @@ double qgran_(int&) { return dist(rng); } -void lzmaopenfile_(const char*, int) {} -void lzmaclosefile_() {} -void lzmafillarray_(const double&, const int&) {} +inline void lzmaopenfile_(const char*, int) {} +inline void lzmaclosefile_() {} +inline void lzmafillarray_(const double&, const int&) {} diff --git a/corsika/detail/modules/sibyll/NuclearInteraction.inl b/corsika/detail/modules/sibyll/NuclearInteraction.inl index e5d8662fb..91b85c681 100644 --- a/corsika/detail/modules/sibyll/NuclearInteraction.inl +++ b/corsika/detail/modules/sibyll/NuclearInteraction.inl @@ -27,8 +27,8 @@ namespace corsika::sibyll { template <typename TEnvironment> - NuclearInteraction<TEnvironment>::NuclearInteraction(sibyll::Interaction& hadint, - TEnvironment const& env) + inline NuclearInteraction<TEnvironment>::NuclearInteraction(sibyll::Interaction& hadint, + TEnvironment const& env) : environment_(env) , hadronicInteraction_(hadint) { @@ -49,12 +49,12 @@ namespace corsika::sibyll { } template <typename TEnvironment> - NuclearInteraction<TEnvironment>::~NuclearInteraction() { + inline NuclearInteraction<TEnvironment>::~NuclearInteraction() { CORSIKA_LOG_DEBUG("Nuclib::NuclearInteraction n={} Nnuc={}", count_, nucCount_); } template <typename TEnvironment> - void NuclearInteraction<TEnvironment>::printCrossSectionTable(Code pCode) { + inline void NuclearInteraction<TEnvironment>::printCrossSectionTable(Code pCode) { const int k = targetComponentsIndex_.at(pCode); Code pNuclei[] = {Code::Helium, Code::Lithium7, Code::Oxygen, Code::Neon, Code::Argon, Code::Iron}; @@ -79,7 +79,7 @@ namespace corsika::sibyll { } template <typename TEnvironment> - void NuclearInteraction<TEnvironment>::initializeNuclearCrossSections() { + inline void NuclearInteraction<TEnvironment>::initializeNuclearCrossSections() { auto& universe = *(environment_.getUniverse()); @@ -143,7 +143,7 @@ namespace corsika::sibyll { } template <typename TEnvironment> - CrossSectionType NuclearInteraction<TEnvironment>::readCrossSectionTable( + inline CrossSectionType NuclearInteraction<TEnvironment>::readCrossSectionTable( const int ia, Code pTarget, HEPEnergyType elabnuc) { const int ib = targetComponentsIndex_.at(pTarget) + 1; // table index in fortran @@ -161,9 +161,8 @@ namespace corsika::sibyll { // TODO: remove elastic cross section? template <typename TEnvironment> template <typename TParticle> - std::tuple<CrossSectionType, CrossSectionType> - NuclearInteraction<TEnvironment>::getCrossSection(TParticle const& projectile, - Code const TargetId) { + std::tuple<CrossSectionType, CrossSectionType> inline NuclearInteraction< + TEnvironment>::getCrossSection(TParticle const& projectile, Code const TargetId) { if (projectile.getPID() != Code::Nucleus) throw std::runtime_error( @@ -203,7 +202,7 @@ namespace corsika::sibyll { template <typename TEnvironment> template <typename TParticle> - GrammageType NuclearInteraction<TEnvironment>::getInteractionLength( + inline GrammageType NuclearInteraction<TEnvironment>::getInteractionLength( TParticle const& projectile) { // coordinate system, get global frame of reference @@ -310,7 +309,7 @@ namespace corsika::sibyll { template <typename TEnvironment> template <typename TSecondaryView> - void NuclearInteraction<TEnvironment>::doInteraction(TSecondaryView& view) { + inline void NuclearInteraction<TEnvironment>::doInteraction(TSecondaryView& view) { auto projectile = view.getProjectile(); diff --git a/corsika/detail/modules/tracking/TrackingLeapFrogCurved.inl b/corsika/detail/modules/tracking/TrackingLeapFrogCurved.inl index 5be8e516e..18a1bf0d2 100644 --- a/corsika/detail/modules/tracking/TrackingLeapFrogCurved.inl +++ b/corsika/detail/modules/tracking/TrackingLeapFrogCurved.inl @@ -226,8 +226,8 @@ namespace corsika { } template <typename TParticle, typename TMedium> - Intersections Tracking::intersect(TParticle const& particle, Plane const& plane, - TMedium const& medium) { + inline Intersections Tracking::intersect(TParticle const& particle, + Plane const& plane, TMedium const& medium) { int chargeNumber; if (is_nucleus(particle.getPID())) { diff --git a/corsika/detail/modules/tracking/TrackingStraight.inl b/corsika/detail/modules/tracking/TrackingStraight.inl index 5869601a5..7fc57b21b 100644 --- a/corsika/detail/modules/tracking/TrackingStraight.inl +++ b/corsika/detail/modules/tracking/TrackingStraight.inl @@ -49,8 +49,8 @@ namespace corsika::tracking_line { } template <typename TParticle, typename TMedium> - Intersections Tracking::intersect(TParticle const& particle, Sphere const& sphere, - TMedium const&) { + inline Intersections Tracking::intersect(TParticle const& particle, + Sphere const& sphere, TMedium const&) { auto const delta = particle.getPosition() - sphere.getCenter(); auto const velocity = particle.getMomentum() / particle.getEnergy() * constants::c; auto const vSqNorm = velocity.getSquaredNorm(); @@ -70,8 +70,8 @@ namespace corsika::tracking_line { } template <typename TParticle, typename TBaseNodeType> - Intersections Tracking::intersect(TParticle const& particle, - TBaseNodeType const& volumeNode) { + inline Intersections Tracking::intersect(TParticle const& particle, + TBaseNodeType const& volumeNode) { Sphere const* sphere = dynamic_cast<Sphere const*>(&volumeNode.getVolume()); if (sphere) { typedef typename std::remove_const_t< @@ -85,8 +85,8 @@ namespace corsika::tracking_line { } template <typename TParticle, typename TMedium> - Intersections Tracking::intersect(TParticle const& particle, Plane const& plane, - TMedium const&) { + inline Intersections Tracking::intersect(TParticle const& particle, Plane const& plane, + TMedium const&) { auto const delta = plane.getCenter() - particle.getPosition(); auto const velocity = particle.getMomentum() / particle.getEnergy() * constants::c; auto const n = plane.getNormal(); diff --git a/corsika/detail/modules/urqmd/UrQMD.inl b/corsika/detail/modules/urqmd/UrQMD.inl index c0f530a81..a1abaa6ab 100644 --- a/corsika/detail/modules/urqmd/UrQMD.inl +++ b/corsika/detail/modules/urqmd/UrQMD.inl @@ -23,11 +23,11 @@ namespace corsika::urqmd { - UrQMD::UrQMD() { ::urqmd::iniurqmdc8_(); } + inline UrQMD::UrQMD() { ::urqmd::iniurqmdc8_(); } - CrossSectionType UrQMD::getCrossSection(Code vProjectileCode, Code vTargetCode, - HEPEnergyType vLabEnergy, - int vAProjectile = 1) { + inline CrossSectionType UrQMD::getCrossSection(Code vProjectileCode, Code vTargetCode, + HEPEnergyType vLabEnergy, + int vAProjectile = 1) { // the following is a translation of ptsigtot() into C++ if (vProjectileCode != Code::Nucleus && @@ -63,8 +63,8 @@ namespace corsika::urqmd { template <typename TParticle> // need template here, as this is called both with // SetupParticle as well as SetupProjectile - CrossSectionType UrQMD::getCrossSection(TParticle const& vProjectile, - Code vTargetCode) const { + inline CrossSectionType UrQMD::getCrossSection(TParticle const& vProjectile, + Code vTargetCode) const { // TODO: return 0 for non-hadrons? auto const projectileCode = vProjectile.getPID(); @@ -79,7 +79,7 @@ namespace corsika::urqmd { return getCrossSection(projectileCode, vTargetCode, projectileEnergyLab, Ap); } - bool UrQMD::canInteract(Code vCode) const { + inline bool UrQMD::canInteract(Code vCode) const { // According to the manual, UrQMD can use all mesons, baryons and nucleons // which are modeled also as input particles. I think it is safer to accept // only the usual long-lived species as input. @@ -95,7 +95,7 @@ namespace corsika::urqmd { } template <typename TParticle> - GrammageType UrQMD::getInteractionLength(TParticle const& vParticle) const { + inline GrammageType UrQMD::getInteractionLength(TParticle const& vParticle) const { if (!canInteract(vParticle.getPID())) { // we could do the canInteract check in getCrossSection, too but if @@ -115,7 +115,7 @@ namespace corsika::urqmd { } template <typename TView> - void UrQMD::doInteraction(TView& view) { + inline void UrQMD::doInteraction(TView& view) { auto projectile = view.getProjectile(); @@ -231,7 +231,7 @@ namespace corsika::urqmd { CORSIKA_LOG_DEBUG("UrQMD generated {} secondaries!", ::urqmd::sys_.npart); } - Code convertFromUrQMD(int vItyp, int vIso3) { + inline Code convertFromUrQMD(int vItyp, int vIso3) { int const pdgInt = ::urqmd::pdgid_(vItyp, vIso3); // use the conversion function provided by UrQMD if (pdgInt == 0) { // ::urqmd::pdgid_ returns 0 on error @@ -241,7 +241,7 @@ namespace corsika::urqmd { return convert_from_PDG(pdg); } - std::pair<int, int> convertToUrQMD(Code code) { + inline std::pair<int, int> convertToUrQMD(Code code) { static const std::map<int, std::pair<int, int>> mapPDGToUrQMD{ // data mostly from github.com/afedynitch/ParticleDataTool {22, {100, 0}}, // gamma diff --git a/corsika/detail/stack/VectorStack.inl b/corsika/detail/stack/VectorStack.inl index 44384a131..a89c85ed9 100644 --- a/corsika/detail/stack/VectorStack.inl +++ b/corsika/detail/stack/VectorStack.inl @@ -23,7 +23,7 @@ namespace corsika { template <typename StackIteratorInterface> - void ParticleInterface<StackIteratorInterface>::setParticleData( + inline void ParticleInterface<StackIteratorInterface>::setParticleData( std::tuple<Code, HEPEnergyType, MomentumVector, Point, TimeType> const& v) { this->setPID(std::get<0>(v)); this->setEnergy(std::get<1>(v)); @@ -33,7 +33,7 @@ namespace corsika { } template <typename StackIteratorInterface> - void ParticleInterface<StackIteratorInterface>::setParticleData( + inline void ParticleInterface<StackIteratorInterface>::setParticleData( ParticleInterface<StackIteratorInterface> const&, std::tuple<Code, HEPEnergyType, MomentumVector, Point, TimeType> const& v) { this->setPID(std::get<0>(v)); diff --git a/corsika/detail/stack/history/HistoryObservationPlane.inl b/corsika/detail/stack/history/HistoryObservationPlane.inl index 0536eaf3a..66b0f11e4 100644 --- a/corsika/detail/stack/history/HistoryObservationPlane.inl +++ b/corsika/detail/stack/history/HistoryObservationPlane.inl @@ -13,14 +13,14 @@ namespace corsika::history { - HistoryObservationPlane::HistoryObservationPlane(setup::Stack const& stack, - Plane const& obsPlane, - bool deleteOnHit) + inline HistoryObservationPlane::HistoryObservationPlane(setup::Stack const& stack, + Plane const& obsPlane, + bool deleteOnHit) : stack_{stack} , plane_{obsPlane} , deleteOnHit_{deleteOnHit} {} - ProcessReturn HistoryObservationPlane::DoContinuous( + inline ProcessReturn HistoryObservationPlane::DoContinuous( setup::Stack::ParticleType const& particle, setup::Trajectory const& trajectory) { TimeType const timeOfIntersection = (plane_.getCenter() - trajectory.getR0()).dot(plane_.getNormal()) / @@ -45,8 +45,8 @@ namespace corsika::history { } } - LengthType HistoryObservationPlane::MaxStepLength(setup::Stack::ParticleType const&, - setup::Trajectory const& trajectory) { + inline LengthType HistoryObservationPlane::MaxStepLength( + setup::Stack::ParticleType const&, setup::Trajectory const& trajectory) { TimeType const timeOfIntersection = (plane_.getCenter() - trajectory.getR0()).dot(plane_.getNormal()) / trajectory.getV0().dot(plane_.getNormal()); @@ -59,7 +59,7 @@ namespace corsika::history { return (trajectory.getR0() - pointOfIntersection).norm() * 1.0001; } - void HistoryObservationPlane::fillHistoryHistogram( + inline void HistoryObservationPlane::fillHistoryHistogram( setup::Stack::ParticleType const& muon) { double const muon_energy = muon.getEnergy() / 1_GeV; diff --git a/corsika/framework/analytics/Timer.hpp b/corsika/framework/analytics/Timer.hpp index 4df67f488..a2dba0ea5 100644 --- a/corsika/framework/analytics/Timer.hpp +++ b/corsika/framework/analytics/Timer.hpp @@ -36,10 +36,10 @@ namespace corsika { : timeDiff_(0){}; /// Start the timer - inline void startTimer() { start_ = clock_type::now(); } + void startTimer() { start_ = clock_type::now(); } /// Stop the timer - inline void stopTimer() { + void stopTimer() { timeDiff_ = std::chrono::duration_cast<duration_type>(clock_type::now() - start_); } @@ -48,7 +48,7 @@ namespace corsika { * @return Returns the measured runtime of the wrapped function/functor in the unit * given by TDuration **/ - inline duration_type getTime() const { return timeDiff_; } + duration_type getTime() const { return timeDiff_; } }; std::false_type is_timer_impl(...); @@ -56,7 +56,7 @@ namespace corsika { std::true_type is_timer_impl(Timer<T, U> const volatile&); template <typename T> - inline constexpr bool is_timer_v = + constexpr bool is_timer_v = std::is_same_v<decltype(is_timer_impl(std::declval<T&>())), std::true_type>; -} // namespace corsika \ No newline at end of file +} // namespace corsika diff --git a/corsika/framework/core/ParticleProperties.hpp b/corsika/framework/core/ParticleProperties.hpp index 85227425c..dafc1f024 100644 --- a/corsika/framework/core/ParticleProperties.hpp +++ b/corsika/framework/core/ParticleProperties.hpp @@ -81,15 +81,15 @@ namespace corsika { int constexpr get_nucleus_Z(Code); //!< returns Z for hard-coded nucleus, otherwise 0 //! returns mass of (A,Z) nucleus, disregarding binding energy - inline HEPMassType get_nucleus_mass(unsigned int const, unsigned int const); + HEPMassType get_nucleus_mass(unsigned int const, unsigned int const); //! convert PDG code to CORSIKA 8 internal code - inline Code convert_from_PDG(PDGCode); + Code convert_from_PDG(PDGCode); std::initializer_list<Code> constexpr get_all_particles(); //! the output stream operator for human-readable particle codes - inline std::ostream& operator<<(std::ostream&, corsika::Code); + std::ostream& operator<<(std::ostream&, corsika::Code); } // namespace corsika // data arrays, etc., as generated automatically diff --git a/corsika/framework/geometry/CoordinateSystem.hpp b/corsika/framework/geometry/CoordinateSystem.hpp index ed9c81848..f15b89e99 100644 --- a/corsika/framework/geometry/CoordinateSystem.hpp +++ b/corsika/framework/geometry/CoordinateSystem.hpp @@ -40,31 +40,30 @@ namespace corsika { /** * Creates new CoordinateSystemPtr by translation along \a vector */ - inline CoordinateSystemPtr make_translation(CoordinateSystemPtr const& cs, - QuantityVector<length_d> const& vector); + CoordinateSystemPtr make_translation(CoordinateSystemPtr const& cs, + QuantityVector<length_d> const& vector); /** * creates a new CoordinateSystem in which vVec points in direction of the new z-axis, * \a vVec */ template <typename TDim> - inline CoordinateSystemPtr make_rotationToZ(CoordinateSystemPtr const& cs, - Vector<TDim> const& vVec); + CoordinateSystemPtr make_rotationToZ(CoordinateSystemPtr const& cs, + Vector<TDim> const& vVec); /** * creates a new CoordinateSystem, rotated around axis by angle. */ template <typename TDim> - inline CoordinateSystemPtr make_rotation(CoordinateSystemPtr const& cs, - QuantityVector<TDim> const& axis, - double const angle); + CoordinateSystemPtr make_rotation(CoordinateSystemPtr const& cs, + QuantityVector<TDim> const& axis, double const angle); /** * creates a new CoordinateSystem, translated by \a translation and rotated around \a * axis by \a angle. */ template <typename TDim> - inline CoordinateSystemPtr make_translationAndRotation( + CoordinateSystemPtr make_translationAndRotation( CoordinateSystemPtr const& cs, QuantityVector<length_d> const& translation, QuantityVector<TDim> const& axis, double const angle); @@ -119,14 +118,14 @@ namespace corsika { /** * Checks, if this is the unique ROOT CS */ - inline bool isRoot() const { return !referenceCS_; } + bool isRoot() const { return !referenceCS_; } - inline CoordinateSystemPtr getReferenceCS() const; + CoordinateSystemPtr getReferenceCS() const; - inline EigenTransform const& getTransform() const; + EigenTransform const& getTransform() const; - inline bool operator==(CoordinateSystem const&) const; - inline bool operator!=(CoordinateSystem const&) const; + bool operator==(CoordinateSystem const&) const; + bool operator!=(CoordinateSystem const&) const; protected: static CoordinateSystem createCS() { return CoordinateSystem(); } @@ -171,8 +170,8 @@ namespace corsika { * * \todo make this a protected member of CoordinateSystem */ - inline EigenTransform get_transformation(CoordinateSystem const& c1, - CoordinateSystem const& c2); + EigenTransform get_transformation(CoordinateSystem const& c1, + CoordinateSystem const& c2); } // namespace corsika diff --git a/corsika/framework/geometry/FourVector.hpp b/corsika/framework/geometry/FourVector.hpp index 99932012d..0b87accec 100644 --- a/corsika/framework/geometry/FourVector.hpp +++ b/corsika/framework/geometry/FourVector.hpp @@ -190,8 +190,8 @@ namespace corsika { **/ template <typename TTimeType, typename TSpaceVecType> - inline std::ostream& operator<<( - std::ostream& os, corsika::FourVector<TTimeType, TSpaceVecType> const& qv); + std::ostream& operator<<(std::ostream& os, + corsika::FourVector<TTimeType, TSpaceVecType> const& qv); } // namespace corsika diff --git a/corsika/framework/geometry/Helix.hpp b/corsika/framework/geometry/Helix.hpp index 5bd9fac77..0ed762d6a 100644 --- a/corsika/framework/geometry/Helix.hpp +++ b/corsika/framework/geometry/Helix.hpp @@ -44,17 +44,17 @@ namespace corsika { , uPerp_(vPerp_.cross(vPar_.normalized())) , radius_(pvPar.getNorm() / abs(pOmegaC)) {} - inline LengthType getRadius() const; + LengthType getRadius() const; - inline Point getPosition(TimeType const t) const; + Point getPosition(TimeType const t) const; VelocityVec getVelocity(TimeType const t) const; - inline Point getPositionFromArclength(LengthType const l) const; + Point getPositionFromArclength(LengthType const l) const; - inline LengthType getArcLength(TimeType const t1, TimeType const t2) const; + LengthType getArcLength(TimeType const t1, TimeType const t2) const; - inline TimeType getTimeFromArclength(LengthType const l) const; + TimeType getTimeFromArclength(LengthType const l) const; private: Point r0_; ///! origin of helix, but this is in the center of the diff --git a/corsika/framework/geometry/Line.hpp b/corsika/framework/geometry/Line.hpp index cdb03d624..7f68984bd 100644 --- a/corsika/framework/geometry/Line.hpp +++ b/corsika/framework/geometry/Line.hpp @@ -31,21 +31,21 @@ namespace corsika { : start_point_(pR0) , velocity_(pV0) {} - inline Point getPosition(TimeType const t) const; + Point getPosition(TimeType const t) const; - inline VelocityVector const& getVelocity(TimeType const) const; + VelocityVector const& getVelocity(TimeType const) const; - inline Point getPositionFromArclength(LengthType const l) const; + Point getPositionFromArclength(LengthType const l) const; - inline LengthType getArcLength(TimeType const t1, TimeType const t2) const; + LengthType getArcLength(TimeType const t1, TimeType const t2) const; - inline TimeType getTimeFromArclength(LengthType const t) const; + TimeType getTimeFromArclength(LengthType const t) const; - inline Point const& getStartPoint() const; + Point const& getStartPoint() const; - inline DirectionVector getDirection() const; + DirectionVector getDirection() const; - inline VelocityVector const& getVelocity() const; + VelocityVector const& getVelocity() const; private: Point start_point_; diff --git a/corsika/framework/geometry/Point.hpp b/corsika/framework/geometry/Point.hpp index b06a68bde..2c6844384 100644 --- a/corsika/framework/geometry/Point.hpp +++ b/corsika/framework/geometry/Point.hpp @@ -31,8 +31,8 @@ namespace corsika { /** \todo TODO: this should be private or protected, we don NOT want to expose numbers * without reference to outside: */ - inline QuantityVector<length_d> const& getCoordinates() const; - inline QuantityVector<length_d>& getCoordinates(); + QuantityVector<length_d> const& getCoordinates() const; + QuantityVector<length_d>& getCoordinates(); /** this always returns a QuantityVector as triple @@ -40,7 +40,7 @@ namespace corsika { \returns A value type QuantityVector, since it may have to create a temporary object to transform to pCS. **/ - inline QuantityVector<length_d> getCoordinates(CoordinateSystemPtr const& pCS) const; + QuantityVector<length_d> getCoordinates(CoordinateSystemPtr const& pCS) const; /** * this always returns a QuantityVector as triple @@ -49,7 +49,7 @@ namespace corsika { * is actually transformed to pCS, if needed. Thus, there may be an implicit call to * \ref rebase. **/ - inline QuantityVector<length_d>& getCoordinates(CoordinateSystemPtr const& pCS); + QuantityVector<length_d>& getCoordinates(CoordinateSystemPtr const& pCS); /** * \name access coordinate components @@ -60,23 +60,23 @@ namespace corsika { * created and destroyed each call. This can be avoided by using * \ref rebase first. **/ - inline LengthType getX(CoordinateSystemPtr const& pCS) const; - inline LengthType getY(CoordinateSystemPtr const& pCS) const; - inline LengthType getZ(CoordinateSystemPtr const& pCS) const; + LengthType getX(CoordinateSystemPtr const& pCS) const; + LengthType getY(CoordinateSystemPtr const& pCS) const; + LengthType getZ(CoordinateSystemPtr const& pCS) const; /** \} **/ /*! * transforms the Point into another CoordinateSystem by changing its * coordinates interally */ - inline void rebase(CoordinateSystemPtr const& pCS); + void rebase(CoordinateSystemPtr const& pCS); - inline Point operator+(Vector<length_d> const& pVec) const; + Point operator+(Vector<length_d> const& pVec) const; /*! * returns the distance Vector between two points */ - inline Vector<length_d> operator-(Point const& pB) const; + Vector<length_d> operator-(Point const& pB) const; }; } // namespace corsika diff --git a/corsika/framework/geometry/QuantityVector.hpp b/corsika/framework/geometry/QuantityVector.hpp index eb6c2f11e..d9199dc57 100644 --- a/corsika/framework/geometry/QuantityVector.hpp +++ b/corsika/framework/geometry/QuantityVector.hpp @@ -113,8 +113,8 @@ namespace corsika { **/ template <typename TDimension> - inline std::ostream& operator<<(std::ostream& os, - corsika::QuantityVector<TDimension> const& qv); + std::ostream& operator<<(std::ostream& os, + corsika::QuantityVector<TDimension> const& qv); } // namespace corsika diff --git a/corsika/framework/geometry/Vector.hpp b/corsika/framework/geometry/Vector.hpp index 0d37c66c7..fec720e4d 100644 --- a/corsika/framework/geometry/Vector.hpp +++ b/corsika/framework/geometry/Vector.hpp @@ -47,14 +47,14 @@ namespace corsika { * \todo this should best be protected, we don't want users to use * bare coordinates without reference frame */ - inline QuantityVector<TDimension> const& getComponents() const; - inline QuantityVector<TDimension>& getComponents(); + QuantityVector<TDimension> const& getComponents() const; + QuantityVector<TDimension>& getComponents(); /*! * returns a QuantityVector with the components given in an arbitrary * CoordinateSystem */ - inline QuantityVector<TDimension> getComponents(CoordinateSystemPtr const& pCS) const; + QuantityVector<TDimension> getComponents(CoordinateSystemPtr const& pCS) const; /** * this always returns a QuantityVector as triple @@ -63,7 +63,7 @@ namespace corsika { * is actually transformed to pCS, if needed. Thus, there may be an implicit call to * \ref rebase. **/ - inline QuantityVector<TDimension>& getComponents(CoordinateSystemPtr const& pCS); + QuantityVector<TDimension>& getComponents(CoordinateSystemPtr const& pCS); /** * \name Access coordinate components @@ -76,28 +76,28 @@ namespace corsika { * \{ **/ - inline quantity_type getX(CoordinateSystemPtr const& pCS) const; - inline quantity_type getY(CoordinateSystemPtr const& pCS) const; - inline quantity_type getZ(CoordinateSystemPtr const& pCS) const; + quantity_type getX(CoordinateSystemPtr const& pCS) const; + quantity_type getY(CoordinateSystemPtr const& pCS) const; + quantity_type getZ(CoordinateSystemPtr const& pCS) const; /** \} **/ /*! * transforms the Vector into another CoordinateSystem by changing * its components internally */ - inline void rebase(CoordinateSystemPtr const& pCS); + void rebase(CoordinateSystemPtr const& pCS); /*! * returns the norm/length of the Vector. Before using this method, * think about whether squaredNorm() might be cheaper for your computation. */ - inline quantity_type getNorm() const; + quantity_type getNorm() const; /*! * returns the squared norm of the Vector. Before using this method, * think about whether norm() might be cheaper for your computation. */ - inline quantity_square_type getSquaredNorm() const; + quantity_square_type getSquaredNorm() const; /*! * returns a Vector \f$ \vec{v}_{\parallel} \f$ which is the parallel projection diff --git a/corsika/framework/process/ProcessSequence.hpp b/corsika/framework/process/ProcessSequence.hpp index d909d0715..30c270bcb 100644 --- a/corsika/framework/process/ProcessSequence.hpp +++ b/corsika/framework/process/ProcessSequence.hpp @@ -118,11 +118,11 @@ namespace corsika { typename TParticle::node_type const& to); template <typename TParticle, typename TTrack> - inline ProcessReturn doContinuous(TParticle& particle, TTrack& vT, - ContinuousProcessIndex const limitID); + ProcessReturn doContinuous(TParticle& particle, TTrack& vT, + ContinuousProcessIndex const limitID); template <typename TSecondaries> - inline void doSecondaries(TSecondaries& vS); + void doSecondaries(TSecondaries& vS); /** The processes of type StackProcess do have an internal counter, @@ -132,53 +132,53 @@ namespace corsika { tested if either A_ or B_ are StackProcess and if they are due for execution. */ - inline bool checkStep(); + bool checkStep(); /** Execute the StackProcess-es in the ProcessSequence */ template <typename TStack> - inline void doStack(TStack& stack); + void doStack(TStack& stack); /** - * Determines the step-length limitation caused by ContinuousProcess-es in this - ProcessSequence. + * Calculate the maximum allowed length of the next tracking step, based on all + * ContinuousProcess-es * - * Returns a ContinuousProcessStepLength object, which contains both: the actual - * length (LengthType) as well as the index of the ContinuousProcess inside the - * ProcessSequence (for identification). - + * The maximum allowed step length is the minimum of the allowed track lenght over all + * ContinuousProcess-es in the ProcessSequence. + * + * \return: ContinuousProcessStepLength which contains the step length itself in + * LengthType, and a unique identifier of the related ContinuousProcess. **/ template <typename TParticle, typename TTrack> - inline ContinuousProcessStepLength getMaxStepLength(TParticle& particle, - TTrack& vTrack); + ContinuousProcessStepLength getMaxStepLength(TParticle& particle, TTrack& vTrack); template <typename TParticle> - inline GrammageType getInteractionLength(TParticle&& particle) { + GrammageType getInteractionLength(TParticle&& particle) { return 1. / getInverseInteractionLength(particle); } template <typename TParticle> - inline InverseGrammageType getInverseInteractionLength(TParticle&& particle); + InverseGrammageType getInverseInteractionLength(TParticle&& particle); template <typename TSecondaryView> - inline ProcessReturn selectInteraction( + ProcessReturn selectInteraction( TSecondaryView& view, [[maybe_unused]] InverseGrammageType lambda_inv_select, [[maybe_unused]] InverseGrammageType lambda_inv_sum = InverseGrammageType::zero()); template <typename TParticle> - inline TimeType getLifetime(TParticle& particle) { + TimeType getLifetime(TParticle& particle) { return 1. / getInverseLifetime(particle); } template <typename TParticle> - inline InverseTimeType getInverseLifetime(TParticle&& particle); + InverseTimeType getInverseLifetime(TParticle&& particle); // select decay process template <typename TSecondaryView> - inline ProcessReturn selectDecay( + ProcessReturn selectDecay( TSecondaryView& view, [[maybe_unused]] InverseTimeType decay_inv_select, [[maybe_unused]] InverseTimeType decay_inv_sum = InverseTimeType::zero()); @@ -219,7 +219,7 @@ namespace corsika { **/ template <typename... TProcesses, typename TProcess1> - inline typename std::enable_if_t< + typename std::enable_if_t< is_process_v<typename std::decay_t<TProcess1>>, ProcessSequence<TProcess1, decltype(make_sequence(std::declval<TProcesses>()...))>> make_sequence(TProcess1&& vA, TProcesses&&... vBs) { @@ -237,9 +237,9 @@ namespace corsika { * \param vB needs to derive BaseProcess or ProcessSequence **/ template <typename TProcess1, typename TProcess2> - inline typename std::enable_if_t<is_process_v<typename std::decay_t<TProcess1>> && - is_process_v<typename std::decay_t<TProcess2>>, - ProcessSequence<TProcess1, TProcess2>> + typename std::enable_if_t<is_process_v<typename std::decay_t<TProcess1>> && + is_process_v<typename std::decay_t<TProcess2>>, + ProcessSequence<TProcess1, TProcess2>> make_sequence(TProcess1&& vA, TProcess2&& vB) { return ProcessSequence<TProcess1, TProcess2>(vA, vB); } @@ -253,8 +253,8 @@ namespace corsika { * \param vA needs to derive from BaseProcess or ProcessSequence **/ template <typename TProcess> - inline typename std::enable_if_t<is_process_v<typename std::decay_t<TProcess>>, - ProcessSequence<TProcess, NullModel>> + typename std::enable_if_t<is_process_v<typename std::decay_t<TProcess>>, + ProcessSequence<TProcess, NullModel>> make_sequence(TProcess&& vA) { return ProcessSequence<TProcess, NullModel>(vA, NullModel()); } diff --git a/corsika/framework/process/SecondariesProcess.hpp b/corsika/framework/process/SecondariesProcess.hpp index 0d6db4783..daa45cc39 100644 --- a/corsika/framework/process/SecondariesProcess.hpp +++ b/corsika/framework/process/SecondariesProcess.hpp @@ -28,7 +28,7 @@ namespace corsika { /// here starts the interface-definition part // -> enforce TDerived to implement DoSecondaries... template <typename TSecondaries> - inline void doSecondaries(TSecondaries&); + void doSecondaries(TSecondaries&); }; } // namespace corsika diff --git a/corsika/framework/process/StackProcess.hpp b/corsika/framework/process/StackProcess.hpp index 77ca2a479..7bf23c82c 100644 --- a/corsika/framework/process/StackProcess.hpp +++ b/corsika/framework/process/StackProcess.hpp @@ -34,7 +34,7 @@ namespace corsika { /// here starts the interface-definition part // -> enforce TDerived to implement DoStack... template <typename TStack> - inline void doStack(TStack&); + void doStack(TStack&); int getStep() const { return iStep_; } bool checkStep() { return !((++iStep_) % nStep_); } diff --git a/corsika/framework/process/SwitchProcessSequence.hpp b/corsika/framework/process/SwitchProcessSequence.hpp index dcf4b214e..22da0facc 100644 --- a/corsika/framework/process/SwitchProcessSequence.hpp +++ b/corsika/framework/process/SwitchProcessSequence.hpp @@ -132,41 +132,40 @@ namespace corsika { TVTNType const& to); template <typename TParticle, typename TTrack> - inline ProcessReturn doContinuous(TParticle& particle, TTrack& vT, - ContinuousProcessIndex const limitId); + ProcessReturn doContinuous(TParticle& particle, TTrack& vT, + ContinuousProcessIndex const limitId); template <typename TSecondaries> - inline void doSecondaries(TSecondaries& vS); + void doSecondaries(TSecondaries& vS); template <typename TParticle, typename TTrack> - inline ContinuousProcessStepLength getMaxStepLength(TParticle& particle, - TTrack& vTrack); + ContinuousProcessStepLength getMaxStepLength(TParticle& particle, TTrack& vTrack); template <typename TParticle> - inline GrammageType getInteractionLength(TParticle&& particle) { + GrammageType getInteractionLength(TParticle&& particle) { return 1. / getInverseInteractionLength(particle); } template <typename TParticle> - inline InverseGrammageType getInverseInteractionLength(TParticle&& particle); + InverseGrammageType getInverseInteractionLength(TParticle&& particle); template <typename TSecondaryView> - inline ProcessReturn selectInteraction( + ProcessReturn selectInteraction( TSecondaryView& view, [[maybe_unused]] InverseGrammageType lambda_inv_select, [[maybe_unused]] InverseGrammageType lambda_inv_sum = InverseGrammageType::zero()); template <typename TParticle> - inline TimeType getLifetime(TParticle&& particle) { + TimeType getLifetime(TParticle&& particle) { return 1. / getInverseLifetime(particle); } template <typename TParticle> - inline InverseTimeType getInverseLifetime(TParticle&& particle); + InverseTimeType getInverseLifetime(TParticle&& particle); // select decay process template <typename TSecondaryView> - inline ProcessReturn selectDecay( + ProcessReturn selectDecay( TSecondaryView& view, [[maybe_unused]] InverseTimeType decay_inv_select, [[maybe_unused]] InverseTimeType decay_inv_sum = InverseTimeType::zero()); @@ -197,9 +196,9 @@ namespace corsika { **/ template <typename TProcess1, typename TProcess2, typename TSelect> - inline typename std::enable_if_t<is_process_v<typename std::decay_t<TProcess1>> && - is_process_v<typename std::decay_t<TProcess2>>, - SwitchProcessSequence<TProcess1, TProcess2, TSelect>> + typename std::enable_if_t<is_process_v<typename std::decay_t<TProcess1>> && + is_process_v<typename std::decay_t<TProcess2>>, + SwitchProcessSequence<TProcess1, TProcess2, TSelect>> make_select(TProcess1&& vA, TProcess2&& vB, TSelect selector) { return SwitchProcessSequence<TProcess1, TProcess2, TSelect>(vA, vB, selector); } diff --git a/corsika/framework/random/RNGManager.hpp b/corsika/framework/random/RNGManager.hpp index 2dd6160e9..0e687adf4 100644 --- a/corsika/framework/random/RNGManager.hpp +++ b/corsika/framework/random/RNGManager.hpp @@ -43,36 +43,35 @@ namespace corsika { * * \throws sth. when stream \a pModuleName is already registered */ - inline void registerRandomStream(string_type const& streamName); + void registerRandomStream(string_type const& streamName); /*! * returns the pre-stored stream of given name \a pStreamName if * available */ - inline prng_type& getRandomStream(string_type const& streamName); + prng_type& getRandomStream(string_type const& streamName); /*! * Check whether a stream has been registered. */ - inline bool isRegistered(string_type const& streamName) const; + bool isRegistered(string_type const& streamName) const; /*! * dumps the names and states of all registered random-number streams * into a std::stringstream. */ - inline std::stringstream dumpState() const; + std::stringstream dumpState() const; /** * Set explicit seeds for all currently registered streams. The actual seed values * are incremented from \a vSeed. */ - inline void seedAll(seed_type seed); + void seedAll(seed_type seed); /** * Set seeds for all currently registered streams. */ - inline void seedAll( - void); //!< seed all currently registered streams with "real" randomness + void seedAll(void); //!< seed all currently registered streams with "real" randomness /** * @fn const streams_type getRngs&()const @@ -82,7 +81,7 @@ namespace corsika { * @post * @return RNGManager::streams_type */ - inline const streams_type& getRngs() const { return rngs_; } + const streams_type& getRngs() const { return rngs_; } /** * @fn const seeds_type getSeeds&()const @@ -92,7 +91,7 @@ namespace corsika { * @post * @return RNGManager::seeds_type */ - inline const seeds_type& getSeeds() const { return seeds_; } + const seeds_type& getSeeds() const { return seeds_; } /** * @fn streams_type Rngs() @@ -102,7 +101,7 @@ namespace corsika { * @post * @return RNGManager::streams_type& */ - inline streams_type Rngs() { return rngs_; } + streams_type Rngs() { return rngs_; } /** * @fn seeds_type Seeds&() @@ -112,7 +111,7 @@ namespace corsika { * @post * @return RNGManager::seeds_type& */ - inline seeds_type& Seeds() { return seeds_; } + seeds_type& getSeeds() { return seeds_; } protected: RNGManager() = default; diff --git a/corsika/framework/random/UniformRealDistribution.hpp b/corsika/framework/random/UniformRealDistribution.hpp index 781a23717..76f147de5 100644 --- a/corsika/framework/random/UniformRealDistribution.hpp +++ b/corsika/framework/random/UniformRealDistribution.hpp @@ -36,7 +36,7 @@ namespace corsika { : min_(other.getMin()) , max_(other.getMax()) {} - inline UniformRealDistribution<value_type>& operator=( + UniformRealDistribution<value_type>& operator=( UniformRealDistribution<value_type> const& other) { if (this == &other) return *this; min_ = other.getMin(); @@ -52,7 +52,7 @@ namespace corsika { * @post * @return quantity_type */ - inline value_type getMax() const { return max_; } + value_type getMax() const { return max_; } /** * @fn void setMax(quantity_type) @@ -62,7 +62,7 @@ namespace corsika { * @post * @param vMax */ - inline void setMax(value_type const& pmax) { max_ = pmax; } + void setMax(value_type const& pmax) { max_ = pmax; } /** * @fn quantity_type getMin()const @@ -72,7 +72,7 @@ namespace corsika { * @post * @return */ - inline value_type getMin() const { return min_; } + value_type getMin() const { return min_; } /** * @fn void setMin(quantity_type) @@ -82,7 +82,7 @@ namespace corsika { * @post * @param vMin */ - inline void setMin(value_type const& pmin) { min_ = pmin; } + void setMin(value_type const& pmin) { min_ = pmin; } /** * @fn quantity_type operator ()(Generator&) @@ -95,7 +95,7 @@ namespace corsika { * @return quantity_type */ template <class Generator> - inline value_type operator()(Generator& g) { + value_type operator()(Generator& g) { return min_ + dist_(g) * (max_ - min_); } diff --git a/corsika/framework/stack/CombinedStack.hpp b/corsika/framework/stack/CombinedStack.hpp index d452d8f8b..e83e33a2f 100644 --- a/corsika/framework/stack/CombinedStack.hpp +++ b/corsika/framework/stack/CombinedStack.hpp @@ -67,21 +67,20 @@ namespace corsika { */ template <typename... TArgs1> - inline void setParticleData(std::tuple<TArgs1...> const vA); + void setParticleData(std::tuple<TArgs1...> const vA); template <typename... TArgs1, typename... TArgs2> - inline void setParticleData(std::tuple<TArgs1...> const vA, - std::tuple<TArgs2...> const vB); + void setParticleData(std::tuple<TArgs1...> const vA, std::tuple<TArgs2...> const vB); template <typename... TArgs1> - inline void setParticleData(pi_a_type& p, std::tuple<TArgs1...> const vA); + void setParticleData(pi_a_type& p, std::tuple<TArgs1...> const vA); template <typename... TArgs1, typename... TArgs2> - inline void setParticleData(pi_c_type& p, std::tuple<TArgs1...> const vA, - std::tuple<TArgs2...> const vB); + void setParticleData(pi_c_type& p, std::tuple<TArgs1...> const vA, + std::tuple<TArgs2...> const vB); ///@} - inline std::string asString() const; + std::string asString() const; protected: }; @@ -99,24 +98,24 @@ namespace corsika { struct CombinedStackImpl : public Stack1Impl, public Stack2Impl { public: - inline void clear(); + void clear(); - inline unsigned int getSize() const { return Stack1Impl::getSize(); } - inline unsigned int getCapacity() const { return Stack1Impl::getCapacity(); } + unsigned int getSize() const { return Stack1Impl::getSize(); } + unsigned int getCapacity() const { return Stack1Impl::getCapacity(); } /** * Function to copy particle at location i1 in stack to i2 */ - inline void copy(const unsigned int i1, const unsigned int i2); + void copy(const unsigned int i1, const unsigned int i2); /** * Function to copy particle at location i2 in stack to i1 */ - inline void swap(const unsigned int i1, const unsigned int i2); + void swap(const unsigned int i1, const unsigned int i2); - inline void incrementSize(); + void incrementSize(); - inline void decrementSize(); + void decrementSize(); }; // end class CombinedStackImpl diff --git a/corsika/framework/stack/ParticleBase.hpp b/corsika/framework/stack/ParticleBase.hpp index c7b086c5c..2c62285d5 100644 --- a/corsika/framework/stack/ParticleBase.hpp +++ b/corsika/framework/stack/ParticleBase.hpp @@ -58,13 +58,13 @@ namespace corsika { * Delete this particle on the stack. The corresponding iterator * will be invalidated by this operation */ - inline void erase() { this->getIterator().getStack().erase(this->getIterator()); } + void erase() { this->getIterator().getStack().erase(this->getIterator()); } /** * Method to retrieve the status of the Particle. Is it already deleted? Or not. */ - inline bool isErased() const { + bool isErased() const { return this->getIterator().getStack().isErased(this->getIterator()); } @@ -74,7 +74,7 @@ namespace corsika { * function description in the user defined ParticleInterface::AddSecondary(...) */ template <typename... TArgs> - inline stack_iterator_type addSecondary(const TArgs... args) { + stack_iterator_type addSecondary(const TArgs... args) { return this->getStack().addSecondary(this->getIterator(), args...); } @@ -84,11 +84,11 @@ namespace corsika { /** * return the corresponding StackIterator for this particle */ - inline stack_iterator_type& getIterator() { + stack_iterator_type& getIterator() { return static_cast<stack_iterator_type&>(*this); } - inline const stack_iterator_type& getIterator() const { + const stack_iterator_type& getIterator() const { return static_cast<const stack_iterator_type&>(*this); } @@ -99,21 +99,19 @@ namespace corsika { and getStackData to retrieve data @{ */ - inline auto& getStackData() { return this->getIterator().getStackData(); } + auto& getStackData() { return this->getIterator().getStackData(); } - inline const auto& getStackData() const { return this->getIterator().getStackData(); } + const auto& getStackData() const { return this->getIterator().getStackData(); } - inline auto& getStack() { return this->getIterator().getStack(); } + auto& getStack() { return this->getIterator().getStack(); } - inline const auto& getStack() const { return this->getIterator().getStack(); } + const auto& getStack() const { return this->getIterator().getStack(); } /** * return the index number of the underlying iterator object */ - inline std::size_t getIndex() const { - return this->getIterator().getIndexFromIterator(); - } + std::size_t getIndex() const { return this->getIterator().getIndexFromIterator(); } ///@} }; diff --git a/corsika/framework/stack/SecondaryView.hpp b/corsika/framework/stack/SecondaryView.hpp index e15179c7e..9e5f60324 100644 --- a/corsika/framework/stack/SecondaryView.hpp +++ b/corsika/framework/stack/SecondaryView.hpp @@ -167,7 +167,7 @@ namespace corsika { * SecondaryView is derived from. This projectile should not be * used to modify the Stack! */ - inline stack_value_iterator parent() + stack_value_iterator parent() const { // todo: check if this can't be Conststack_value_iterator return stack_value_iterator(inner_stack_, projectile_index_); } @@ -177,7 +177,7 @@ namespace corsika { * SecondaryView is derived from. This projectile should not be * used to modify the Stack! */ - inline stack_value_iterator asNewParent() const { + stack_value_iterator asNewParent() const { return stack_value_iterator(inner_stack_, projectile_index_); } @@ -185,7 +185,7 @@ namespace corsika { * This return a projectile of this SecondaryView, which can be * used to modify the SecondaryView */ - inline stack_view_iterator getProjectile() { + stack_view_iterator getProjectile() { // NOTE: 0 is special marker here for PROJECTILE, see getIndexFromIterator return stack_view_iterator(*this, 0); } @@ -194,7 +194,7 @@ namespace corsika { * This return a projectile of this SecondaryView, which can be * used to modify the SecondaryView */ - inline const_stack_view_iterator getProjectile() const { + const_stack_view_iterator getProjectile() const { // NOTE: 0 is special marker here for PROJECTILE, see getIndexFromIterator return const_stack_view_iterator(*this, 0); } @@ -203,18 +203,18 @@ namespace corsika { * Method to add a new secondary particle on this SecondaryView */ template <typename... Args> - inline stack_view_iterator addSecondary(const Args... v); + stack_view_iterator addSecondary(const Args... v); /** * overwrite Stack::getSize to return actual number of secondaries */ - inline unsigned int getSize() const { return indices_.size(); } + unsigned int getSize() const { return indices_.size(); } - inline unsigned int getEntries() const { + unsigned int getEntries() const { return getSize() - inner_stack_reference_type::getErased(); } - inline bool isEmpty() const { return getEntries() == 0; } + bool isEmpty() const { return getEntries() == 0; } /** * @name These are functions required by std containers and std loops @@ -224,48 +224,46 @@ namespace corsika { */ // NOTE: the "+1" is since "0" is special marker here for PROJECTILE, see // getIndexFromIterator - inline stack_view_iterator begin(); + stack_view_iterator begin(); - inline stack_view_iterator end() { return stack_view_iterator(*this, getSize() + 1); } + stack_view_iterator end() { return stack_view_iterator(*this, getSize() + 1); } - inline stack_view_iterator last(); + stack_view_iterator last(); - inline const_stack_view_iterator begin() const; + const_stack_view_iterator begin() const; - inline const_stack_view_iterator end() const { + const_stack_view_iterator end() const { return const_stack_view_iterator(*this, getSize() + 1); } - inline const_stack_view_iterator last() const; + const_stack_view_iterator last() const; - inline const_stack_view_iterator cbegin() const; + const_stack_view_iterator cbegin() const; - inline const_stack_view_iterator cend() const { + const_stack_view_iterator cend() const { return const_stack_view_iterator(*this, getSize()); } - inline const_stack_view_iterator clast() const; + const_stack_view_iterator clast() const; - inline stack_view_iterator at(unsigned int i) { - return stack_view_iterator(*this, i); - } + stack_view_iterator at(unsigned int i) { return stack_view_iterator(*this, i); } - inline const_stack_view_iterator at(unsigned int i) const { + const_stack_view_iterator at(unsigned int i) const { return const_stack_view_iterator(*this, i); } - inline stack_view_iterator first() { return stack_view_iterator{*this, 0}; } + stack_view_iterator first() { return stack_view_iterator{*this, 0}; } - inline const_stack_view_iterator cfirst() const { + const_stack_view_iterator cfirst() const { return const_stack_view_iterator{*this, 0}; } /// @} - inline void swap(stack_view_iterator a, stack_view_iterator b); + void swap(stack_view_iterator a, stack_view_iterator b); - inline void copy(stack_view_iterator a, stack_view_iterator b); + void copy(stack_view_iterator a, stack_view_iterator b); - inline void copy(const_stack_view_iterator a, stack_view_iterator b); + void copy(const_stack_view_iterator a, stack_view_iterator b); /** * need overwrite Stack::Delete, since we want to call @@ -279,13 +277,13 @@ namespace corsika { * remove the last particle. * */ - inline void erase(stack_view_iterator p); + void erase(stack_view_iterator p); /** * return next particle from stack, need to overwrtie Stack::getNextParticle to get * right reference */ - inline stack_view_iterator getNextParticle() { + stack_view_iterator getNextParticle() { while (purgeLastIfDeleted()) {} return last(); } @@ -296,21 +294,21 @@ namespace corsika { * need to re-implement for SecondaryView since stack_view_iterator types are a bit * different */ - inline bool isErased(const stack_view_iterator& p) const { + bool isErased(const stack_view_iterator& p) const { return isErased(p.getIndex() - 1); } - inline bool isErased(const const_stack_view_iterator& p) const { + bool isErased(const const_stack_view_iterator& p) const { return isErased(p.getIndex() - 1); } /** * delete this particle */ - inline bool isErased(const ParticleInterfaceType& p) const { + bool isErased(const ParticleInterfaceType& p) const { return isErased(p.getIterator()); } - inline bool isDeleted(const const_stack_view_iterator& p) const { + bool isDeleted(const const_stack_view_iterator& p) const { return isDeleted(p.getIndex() - 1); } /** @@ -318,7 +316,7 @@ namespace corsika { * if it was marked as deleted before. If this is not the case, * the function will just return false and do nothing. */ - inline bool purgeLastIfDeleted(); + bool purgeLastIfDeleted(); /** * Function to ultimatively remove all entries from the stack @@ -328,9 +326,9 @@ namespace corsika { * "gaps" in the stack are filled with entries from the back * (copied). */ - inline void purge(); + void purge(); - inline std::string asString() const; + std::string asString() const; protected: friend class StackIteratorInterface< @@ -353,11 +351,11 @@ namespace corsika { * stack_view_iterator::addSecondary via ParticleBase */ template <typename... Args> - inline stack_view_iterator addSecondary(stack_view_iterator& proj, const Args... v); + stack_view_iterator addSecondary(stack_view_iterator& proj, const Args... v); // forward to inner stack // this also checks the allowed bounds of 'i' - inline bool isErased(unsigned int i) const { + bool isErased(unsigned int i) const { if (i >= indices_.size()) return false; return inner_stack_.isErased(getIndexFromIterator(i + 1)); } @@ -367,7 +365,7 @@ namespace corsika { * function the conversion form iterator-index to stack-index is * performed. */ - inline unsigned int getIndexFromIterator(const unsigned int vI) const { + unsigned int getIndexFromIterator(const unsigned int vI) const { // this is too much: CORSIKA_LOG_TRACE("SecondaryView::getIndexFromIterator({})={}", // vI, (vI?indices_[vI-1]:projectile_index_)); if (vI == 0) return projectile_index_; @@ -399,7 +397,7 @@ namespace corsika { * is of course a reference into the SecondaryView itself. */ template <typename Particle> - inline void new_secondary(Particle&&) const { + void new_secondary(Particle&&) const { CORSIKA_LOG_TRACE("DefaultSecondaryProducer::new_secondary(Particle&&)"); } @@ -412,7 +410,7 @@ namespace corsika { * itself. */ template <typename Particle> - inline DefaultSecondaryProducer(Particle const&) { + DefaultSecondaryProducer(Particle const&) { CORSIKA_LOG_TRACE("DefaultSecondaryProducer::DefaultSecondaryProducer(Particle&)"); } diff --git a/corsika/framework/stack/Stack.hpp b/corsika/framework/stack/Stack.hpp index e72dc94db..2ff173fb3 100644 --- a/corsika/framework/stack/Stack.hpp +++ b/corsika/framework/stack/Stack.hpp @@ -152,89 +152,89 @@ namespace corsika { * @name Most generic proxy methods for StackData data_ * @{ */ - inline unsigned int getCapacity() const { return data_.getCapacity(); } + unsigned int getCapacity() const { return data_.getCapacity(); } - inline unsigned int getErased() const { return nDeleted_; } + unsigned int getErased() const { return nDeleted_; } - inline unsigned int getEntries() const { return getSize() - getErased(); } + unsigned int getEntries() const { return getSize() - getErased(); } template <typename... TArgs> - inline void clear(TArgs... args); + void clear(TArgs... args); ///@} /** * @name These are functions required by std containers and std loops * @{ */ - inline stack_iterator_type begin(); + stack_iterator_type begin(); - inline stack_iterator_type end(); + stack_iterator_type end(); - inline stack_iterator_type last(); + stack_iterator_type last(); - inline const_stack_iterator_type begin() const; + const_stack_iterator_type begin() const; - inline const_stack_iterator_type end() const; + const_stack_iterator_type end() const; - inline const_stack_iterator_type last() const; + const_stack_iterator_type last() const; - inline const_stack_iterator_type cbegin() const; + const_stack_iterator_type cbegin() const; - inline const_stack_iterator_type cend() const; + const_stack_iterator_type cend() const; - inline const_stack_iterator_type clast() const; + const_stack_iterator_type clast() const; - inline stack_iterator_type at(unsigned int i); + stack_iterator_type at(unsigned int i); - inline const_stack_iterator_type at(unsigned int i) const; + const_stack_iterator_type at(unsigned int i) const; - inline stack_iterator_type first(); + stack_iterator_type first(); - inline const_stack_iterator_type cfirst() const; + const_stack_iterator_type cfirst() const; - inline stack_iterator_type getNextParticle(); + stack_iterator_type getNextParticle(); /** * increase stack size, create new particle at end of stack */ template <typename... TArgs> - inline stack_iterator_type addParticle(const TArgs... v); + stack_iterator_type addParticle(const TArgs... v); - inline void swap(stack_iterator_type a, stack_iterator_type b); + void swap(stack_iterator_type a, stack_iterator_type b); - inline void copy(stack_iterator_type a, stack_iterator_type b); + void copy(stack_iterator_type a, stack_iterator_type b); - inline void copy(const_stack_iterator_type a, stack_iterator_type b); + void copy(const_stack_iterator_type a, stack_iterator_type b); - inline void erase(stack_iterator_type p); + void erase(stack_iterator_type p); /** * delete this particle */ - inline void erase(particle_interface_type p); + void erase(particle_interface_type p); /** * check if there are no further non-deleted particles on stack */ - - inline bool isEmpty(); + bool isEmpty(); /** * check if this particle was already deleted */ - inline bool isErased(const stack_iterator_type& p) const; + bool isErased(const stack_iterator_type& p) const; - inline bool isErased(const const_stack_iterator_type& p) const; + bool isErased(const const_stack_iterator_type& p) const; - inline bool isErased(const particle_interface_type& p) const; + bool isErased(const particle_interface_type& p) const; /** * Function to ultimatively remove the last entry from the stack, * if it was marked as deleted before. If this is not the case, * the function will just return false and do nothing. */ - inline bool purgeLastIfDeleted(); + bool purgeLastIfDeleted(); + /** * Function to ultimatively remove all entries from the stack * marked as deleted. @@ -243,11 +243,11 @@ namespace corsika { * "gaps" in the stack are filled with entries from the back * (copied). */ - inline void purge(); + void purge(); - inline unsigned int getSize() const; + unsigned int getSize() const; - inline std::string asString() const; + std::string asString() const; protected: /** @@ -258,22 +258,21 @@ namespace corsika { * StackIterator::AddSecondary via ParticleBase */ template <typename... TArgs> - inline stack_iterator_type addSecondary(stack_iterator_type& parent, - const TArgs... v); + stack_iterator_type addSecondary(stack_iterator_type& parent, const TArgs... v); - inline void swap(unsigned int const a, unsigned int const b); + void swap(unsigned int const a, unsigned int const b); - inline void copy(unsigned int const a, unsigned int const b); + void copy(unsigned int const a, unsigned int const b); - inline bool isErased(unsigned int const i) const; + bool isErased(unsigned int const i) const; - inline void erase(unsigned int const i); + void erase(unsigned int const i); /** * will remove from storage the element i. This is a helper * function for SecondaryView. */ - inline void purge(unsigned int i); + void purge(unsigned int i); /** * Function to perform eventual transformation from @@ -281,15 +280,15 @@ namespace corsika { * StackData data_. By default (and in almost all cases) this * should just be identiy. See class SecondaryView for an alternative implementation. */ - inline unsigned int getIndexFromIterator(const unsigned int vI) const; + unsigned int getIndexFromIterator(const unsigned int vI) const; /** * @name Return reference to StackData object data_ for data access * @{ */ - inline value_type& getStackData(); + value_type& getStackData(); - inline const value_type& getStackData() const; + const value_type& getStackData() const; friend class StackIteratorInterface<value_type, MParticleInterface, Stack>; friend class ConstStackIteratorInterface<value_type, MParticleInterface, Stack>; diff --git a/corsika/framework/stack/StackIteratorInterface.hpp b/corsika/framework/stack/StackIteratorInterface.hpp index f6240e878..76815746a 100644 --- a/corsika/framework/stack/StackIteratorInterface.hpp +++ b/corsika/framework/stack/StackIteratorInterface.hpp @@ -146,14 +146,14 @@ namespace corsika { /** @name Iterator interface @{ **/ - inline StackIteratorInterface& operator++() { + StackIteratorInterface& operator++() { do { ++index_; } while ( getStack().isErased(*this)); // this also check the allowed bounds of index_ return *this; } - inline StackIteratorInterface operator++(int) { + StackIteratorInterface operator++(int) { StackIteratorInterface tmp(*this); do { ++index_; @@ -161,19 +161,19 @@ namespace corsika { getStack().isErased(*this)); // this also check the allowed bounds of index_ return tmp; } - inline StackIteratorInterface operator+(int delta) const { + StackIteratorInterface operator+(int delta) const { return StackIteratorInterface(*data_, index_ + delta); } - inline bool operator==(StackIteratorInterface const& rhs) const { + bool operator==(StackIteratorInterface const& rhs) const { return index_ == rhs.index_; } - inline bool operator!=(StackIteratorInterface const& rhs) const { + bool operator!=(StackIteratorInterface const& rhs) const { return index_ != rhs.index_; } - inline bool operator==( + bool operator==( const ConstStackIteratorInterface<TStackData, TParticleInterface, TStackType>& rhs) const; // implemented below - inline bool operator!=( + bool operator!=( const ConstStackIteratorInterface<TStackData, TParticleInterface, TStackType>& rhs) const; // implemented below @@ -181,7 +181,7 @@ namespace corsika { * Convert iterator to value type, where value type is the user-provided particle * readout class **/ - inline particle_interface_type& operator*() { + particle_interface_type& operator*() { return static_cast<particle_interface_type&>(*this); } @@ -189,7 +189,7 @@ namespace corsika { * Convert iterator to const value type, where value type is the user-provided * particle readout class **/ - inline particle_interface_type const& operator*() const { + particle_interface_type const& operator*() const { return static_cast<particle_interface_type const&>(*this); } ///@} @@ -200,17 +200,17 @@ namespace corsika { * @{ **/ /// Get current particle index - inline unsigned int getIndex() const { return index_; } + unsigned int getIndex() const { return index_; } /// Get current particle Stack object - inline TStackType& getStack() { return *data_; } + TStackType& getStack() { return *data_; } /// Get current particle const Stack object - inline TStackType const& getStack() const { return *data_; } + TStackType const& getStack() const { return *data_; } /// Get current user particle TStackData object - inline TStackData& getStackData() { return data_->getStackData(); } + TStackData& getStackData() { return data_->getStackData(); } /// Get current const user particle TStackData object - inline TStackData const& getStackData() const { return data_->getStackData(); } + TStackData const& getStackData() const { return data_->getStackData(); } /// Get data index as mapped in Stack class - inline unsigned int getIndexFromIterator() const { + unsigned int getIndexFromIterator() const { return data_->getIndexFromIterator(index_); } ///@} @@ -326,11 +326,11 @@ namespace corsika { Only the const versions for read-only access @{ */ - inline unsigned int getIndex() const { return index_; } - inline TStackType const& getStack() const { return *data_; } - inline TStackData const& getStackData() const { return data_->getStackData(); } + unsigned int getIndex() const { return index_; } + TStackType const& getStack() const { return *data_; } + TStackData const& getStackData() const { return data_->getStackData(); } /// Get data index as mapped in Stack class - inline unsigned int getIndexFromIterator() const { + unsigned int getIndexFromIterator() const { return data_->getIndexFromIterator(index_); } ///@} diff --git a/corsika/framework/utility/COMBoost.hpp b/corsika/framework/utility/COMBoost.hpp index 63b8f0a44..befd30250 100644 --- a/corsika/framework/utility/COMBoost.hpp +++ b/corsika/framework/utility/COMBoost.hpp @@ -35,16 +35,16 @@ namespace corsika { //! transforms a 4-momentum from lab frame to the center-of-mass frame template <typename FourVector> - inline FourVector toCoM(FourVector const& p) const; + FourVector toCoM(FourVector const& p) const; //! transforms a 4-momentum from the center-of-mass frame back to lab frame template <typename FourVector> - inline FourVector fromCoM(FourVector const& p) const; + FourVector fromCoM(FourVector const& p) const; - inline CoordinateSystemPtr getRotatedCS() const; + CoordinateSystemPtr getRotatedCS() const; protected: - inline void setBoost(double coshEta, double sinhEta); + void setBoost(double coshEta, double sinhEta); private: Eigen::Matrix2d boost_; diff --git a/corsika/framework/utility/SaveBoostHistogram.hpp b/corsika/framework/utility/SaveBoostHistogram.hpp index 90a5621bd..14e037996 100644 --- a/corsika/framework/utility/SaveBoostHistogram.hpp +++ b/corsika/framework/utility/SaveBoostHistogram.hpp @@ -24,8 +24,8 @@ namespace corsika { * runtime_error */ template <class Axes, class Storage> - inline void save_hist(boost::histogram::histogram<Axes, Storage> const& h, - std::string const& filename, bool overwrite = true); + void save_hist(boost::histogram::histogram<Axes, Storage> const& h, + std::string const& filename, bool overwrite = true); } // namespace corsika #include <corsika/detail/framework/utility/SaveBoostHistogram.inl> diff --git a/corsika/framework/utility/Singleton.hpp b/corsika/framework/utility/Singleton.hpp index 78a7df97b..d67fca048 100644 --- a/corsika/framework/utility/Singleton.hpp +++ b/corsika/framework/utility/Singleton.hpp @@ -8,8 +8,6 @@ #pragma once -//#define OFFLINE_USE_GAMMA_SINGLETON - namespace corsika { /** * \class Singleton Singleton.h utl/Singleton.h diff --git a/corsika/media/NameModel.hpp b/corsika/media/NameModel.hpp index 8fe9698ed..f046809c3 100644 --- a/corsika/media/NameModel.hpp +++ b/corsika/media/NameModel.hpp @@ -9,7 +9,6 @@ #pragma once #include <string> -//#include <utility> namespace corsika { diff --git a/corsika/media/NuclearComposition.hpp b/corsika/media/NuclearComposition.hpp index f8f08704d..5341554cd 100644 --- a/corsika/media/NuclearComposition.hpp +++ b/corsika/media/NuclearComposition.hpp @@ -33,8 +33,8 @@ namespace corsika { * @param pFractions List of fractions how much each particle contributes. The sum * needs to add up to 1 **/ - inline NuclearComposition(std::vector<Code> const& pComponents, - std::vector<float> const& pFractions); + NuclearComposition(std::vector<Code> const& pComponents, + std::vector<float> const& pFractions); /** Sum all all relative composition weighted by func(element) * This function sums all relative compositions given during this classes @@ -46,29 +46,29 @@ namespace corsika { * @retval returns the weighted sum with the type defined by the return type of func **/ template <typename TFunction> - inline auto getWeightedSum(TFunction const& func) const; + auto getWeightedSum(TFunction const& func) const; /** Number of elements in the composition array * @retval returns the number of elements in the composition array **/ - inline size_t getSize() const; + size_t getSize() const; /// Returns a const reference to the fraction - inline std::vector<float> const& getFractions() const; + std::vector<float> const& getFractions() const; /// Returns a const reference to the fraction - inline std::vector<Code> const& getComponents() const; - inline double const getAverageMassNumber() const; + std::vector<Code> const& getComponents() const; + double const getAverageMassNumber() const; template <class TRNG> - inline Code sampleTarget(std::vector<CrossSectionType> const& sigma, - TRNG& randomStream) const; + Code sampleTarget(std::vector<CrossSectionType> const& sigma, + TRNG& randomStream) const; // Note: when this class ever modifies its internal data, the hash // must be updated, too! - inline size_t getHash() const; + size_t getHash() const; private: - inline void updateHash(); + void updateHash(); std::vector<float> const numberFractions_; //!< relative fractions of number density std::vector<Code> const components_; //!< particle codes of consitutents diff --git a/corsika/media/Universe.hpp b/corsika/media/Universe.hpp index cdd5c2bd2..e481052d9 100644 --- a/corsika/media/Universe.hpp +++ b/corsika/media/Universe.hpp @@ -14,8 +14,8 @@ namespace corsika { struct Universe : public corsika::Sphere { - inline Universe(corsika::CoordinateSystemPtr const& pCS); - inline bool contains(corsika::Point const&) const override; + Universe(corsika::CoordinateSystemPtr const& pCS); + bool contains(corsika::Point const&) const override; }; } // namespace corsika diff --git a/corsika/media/VolumeTreeNode.hpp b/corsika/media/VolumeTreeNode.hpp index fba07bc58..dd4b11c34 100644 --- a/corsika/media/VolumeTreeNode.hpp +++ b/corsika/media/VolumeTreeNode.hpp @@ -29,15 +29,14 @@ namespace corsika { : geoVolume_(std::move(pVolume)) {} //! convenience function equivalent to Volume::isInside - inline bool contains(Point const& p) const; + bool contains(Point const& p) const; - inline VolumeTreeNode<IModelProperties> const* excludes(Point const& p) const; + VolumeTreeNode<IModelProperties> const* excludes(Point const& p) const; /** returns a pointer to the sub-VolumeTreeNode which is "responsible" for the given * \class Point \p p, or nullptr iff \p p is not contained in this volume. */ - inline VolumeTreeNode<IModelProperties> const* getContainingNode( - Point const& p) const; + VolumeTreeNode<IModelProperties> const* getContainingNode(Point const& p) const; /** * Traverses the VolumeTree pre- or post-order and calls the functor \p func for each @@ -45,33 +44,33 @@ namespace corsika { * func is ignored. */ template <typename TCallable, bool preorder = true> - inline void walk(TCallable func); + void walk(TCallable func); - inline void addChild(VTNUPtr pChild); + void addChild(VTNUPtr pChild); - inline void excludeOverlapWith(VTNUPtr const& pNode); + void excludeOverlapWith(VTNUPtr const& pNode); - inline VTN_type const* getParent() const { return parentNode_; }; + VTN_type const* getParent() const { return parentNode_; }; - inline auto const& getChildNodes() const { return childNodes_; } + auto const& getChildNodes() const { return childNodes_; } - inline auto const& getExcludedNodes() const { return excludedNodes_; } + auto const& getExcludedNodes() const { return excludedNodes_; } - inline auto const& getVolume() const { return *geoVolume_; } + auto const& getVolume() const { return *geoVolume_; } - inline auto const& getModelProperties() const { return *modelProperties_; } + auto const& getModelProperties() const { return *modelProperties_; } - inline bool hasModelProperties() const { return modelProperties_.get() != nullptr; } + bool hasModelProperties() const { return modelProperties_.get() != nullptr; } template <typename ModelProperties, typename... Args> - inline auto setModelProperties(Args&&... args) { + auto setModelProperties(Args&&... args) { // static_assert(std::is_base_of_v<IModelProperties, ModelProperties>, // "unusable type provided"); modelProperties_ = std::make_shared<ModelProperties>(std::forward<Args>(args)...); return modelProperties_; } - inline void setModelProperties(IMPSharedPtr ptr) { modelProperties_ = ptr; } + void setModelProperties(IMPSharedPtr ptr) { modelProperties_ = ptr; } // template <class MediumType, typename... Args> // static auto createMedium(Args&&... args); diff --git a/corsika/modules/qgsjetII/Interaction.hpp b/corsika/modules/qgsjetII/Interaction.hpp index 004788f13..a45282f58 100644 --- a/corsika/modules/qgsjetII/Interaction.hpp +++ b/corsika/modules/qgsjetII/Interaction.hpp @@ -12,9 +12,6 @@ #include <corsika/framework/core/PhysicalUnits.hpp> #include <corsika/framework/random/RNGManager.hpp> #include <corsika/framework/process/InteractionProcess.hpp> - -#include <corsika/modules/qgsjetII/Random.hpp> - #include <corsika/modules/qgsjetII/ParticleConversion.hpp> #include <qgsjet-II-04.hpp> diff --git a/corsika/stack/DummyStack.hpp b/corsika/stack/DummyStack.hpp index bbbfff91a..9bbd51403 100644 --- a/corsika/stack/DummyStack.hpp +++ b/corsika/stack/DummyStack.hpp @@ -61,21 +61,21 @@ namespace corsika::dummy_stack { void init() { entries_ = 0; } - inline void clear() { entries_ = 0; } + void clear() { entries_ = 0; } - inline int getSize() const { return entries_; } - inline int getCapacity() const { return entries_; } + int getSize() const { return entries_; } + int getCapacity() const { return entries_; } /** * Function to copy particle at location i2 in stack to i1 */ - inline void copy(const int /*i1*/, const int /*i2*/) {} + void copy(const int /*i1*/, const int /*i2*/) {} - inline void incrementSize() { entries_++; } - inline void decrementSize() { entries_--; } + void incrementSize() { entries_++; } + void decrementSize() { entries_--; } - inline int getEntries() const { return entries_; } - inline void setEntries(int entries = 0) { entries_ = entries; } + int getEntries() const { return entries_; } + void setEntries(int entries = 0) { entries_ = entries; } private: int entries_ = 0; diff --git a/corsika/stack/GeometryNodeStackExtension.hpp b/corsika/stack/GeometryNodeStackExtension.hpp index b3a15854f..e7298bea4 100644 --- a/corsika/stack/GeometryNodeStackExtension.hpp +++ b/corsika/stack/GeometryNodeStackExtension.hpp @@ -38,28 +38,26 @@ namespace corsika::node { typedef typename TEnvType::BaseNodeType node_type; // default version for particle-creation from input data - inline void setParticleData(const std::tuple<node_type const*> v) { + void setParticleData(const std::tuple<node_type const*> v) { setNode(std::get<0>(v)); } - inline void setParticleData(GeometryDataInterface& parent, - const std::tuple<node_type const*>) { + void setParticleData(GeometryDataInterface& parent, + const std::tuple<node_type const*>) { setNode(parent.getNode()); // copy Node from parent particle! } - inline void setParticleData() { setNode(nullptr); } - inline void setParticleData(GeometryDataInterface& parent) { + void setParticleData() { setNode(nullptr); } + void setParticleData(GeometryDataInterface& parent) { setNode(parent.getNode()); // copy Node from parent particle! } - inline std::string asString() const { - return fmt::format("node={}", fmt::ptr(getNode())); - } + std::string asString() const { return fmt::format("node={}", fmt::ptr(getNode())); } - inline void setNode(node_type const* v) { + void setNode(node_type const* v) { super_type::getStackData().setNode(super_type::getIndex(), v); } - inline node_type const* getNode() const { + node_type const* getNode() const { return super_type::getStackData().getNode(super_type::getIndex()); } }; @@ -89,27 +87,27 @@ namespace corsika::node { GeometryData<TEnvType>& operator=(GeometryData<TEnvType>&&) = default; // these functions are needed for the Stack interface - inline void clear() { node_vector_.clear(); } + void clear() { node_vector_.clear(); } - inline unsigned int getSize() const { return node_vector_.size(); } + unsigned int getSize() const { return node_vector_.size(); } - inline unsigned int getCapacity() const { return node_vector_.size(); } + unsigned int getCapacity() const { return node_vector_.size(); } - inline void copy(const int i1, const int i2) { node_vector_[i2] = node_vector_[i1]; } + void copy(const int i1, const int i2) { node_vector_[i2] = node_vector_[i1]; } - inline void swap(const int i1, const int i2) { + void swap(const int i1, const int i2) { std::swap(node_vector_[i1], node_vector_[i2]); } // custom data access function - inline void setNode(const int i, node_type const* v) { node_vector_[i] = v; } + void setNode(const int i, node_type const* v) { node_vector_[i] = v; } - inline node_type const* getNode(const int i) const { return node_vector_[i]; } + node_type const* getNode(const int i) const { return node_vector_[i]; } // these functions are also needed by the Stack interface - inline void incrementSize() { node_vector_.push_back(nullptr); } + void incrementSize() { node_vector_.push_back(nullptr); } - inline void decrementSize() { + void decrementSize() { if (node_vector_.size() > 0) { node_vector_.pop_back(); } } diff --git a/corsika/stack/NuclearStackExtension.hpp b/corsika/stack/NuclearStackExtension.hpp index 5d8d573ed..34bd1377d 100644 --- a/corsika/stack/NuclearStackExtension.hpp +++ b/corsika/stack/NuclearStackExtension.hpp @@ -54,24 +54,24 @@ namespace corsika::nuclear_stack { unsigned short, unsigned short> altenative_particle_data_type; - inline void setParticleData(particle_data_type const& v); + void setParticleData(particle_data_type const& v); - inline void setParticleData(altenative_particle_data_type const& v); + void setParticleData(altenative_particle_data_type const& v); - inline void setParticleData(super_type& p, particle_data_type const& v); + void setParticleData(super_type& p, particle_data_type const& v); - inline void setParticleData(super_type& p, altenative_particle_data_type const& v); + void setParticleData(super_type& p, altenative_particle_data_type const& v); - inline std::string asString() const; + std::string asString() const; /** * @name individual setters * @{ */ - inline void setNuclearA(const unsigned short vA) { + void setNuclearA(const unsigned short vA) { super_type::getStackData().setNuclearA(super_type::getIndex(), vA); } - inline void setNuclearZ(const unsigned short vZ) { + void setNuclearZ(const unsigned short vZ) { super_type::getStackData().setNuclearZ(super_type::getIndex(), vZ); } /// @} @@ -80,10 +80,10 @@ namespace corsika::nuclear_stack { * @name individual getters * @{ */ - inline int getNuclearA() const { + int getNuclearA() const { return super_type::getStackData().getNuclearA(super_type::getIndex()); } - inline int getNuclearZ() const { + int getNuclearZ() const { return super_type::getStackData().getNuclearZ(super_type::getIndex()); } /// @} @@ -91,22 +91,22 @@ namespace corsika::nuclear_stack { /** * Overwrite normal getParticleMass function with nuclear version */ - inline HEPMassType getMass() const; + HEPMassType getMass() const; /** * Overwirte normal getChargeNumber function with nuclear version **/ - inline int16_t getChargeNumber() const; + int16_t getChargeNumber() const; - inline int getNucleusRef() const { + int getNucleusRef() const { return super_type::getStackData().getNucleusRef(super_type::getIndex()); } // LCOV_EXCL_LINE protected: - inline void setNucleusRef(const int vR) { + void setNucleusRef(const int vR) { super_type::getStackData().setNucleusRef(super_type::getIndex(), vR); } - inline bool isNucleus() const { + bool isNucleus() const { return super_type::getStackData().isNucleus(super_type::getIndex()); } }; @@ -149,49 +149,45 @@ namespace corsika::nuclear_stack { void dump() { super_type::dump(); } - inline void clear(); + void clear(); unsigned int getSize() const { return nucleusRef_.size(); } unsigned int getCapacity() const { return nucleusRef_.capacity(); } - inline void setNuclearA(const unsigned int i, const unsigned short vA) { + void setNuclearA(const unsigned int i, const unsigned short vA) { nuclearA_[getNucleusRef(i)] = vA; } - inline void setNuclearZ(const unsigned int i, const unsigned short vZ) { + void setNuclearZ(const unsigned int i, const unsigned short vZ) { nuclearZ_[getNucleusRef(i)] = vZ; } - inline void setNucleusRef(const unsigned int i, const int v) { nucleusRef_[i] = v; } + void setNucleusRef(const unsigned int i, const int v) { nucleusRef_[i] = v; } - inline int getNuclearA(const unsigned int i) const { - return nuclearA_[getNucleusRef(i)]; - } + int getNuclearA(const unsigned int i) const { return nuclearA_[getNucleusRef(i)]; } - inline int getNuclearZ(const unsigned int i) const { - return nuclearZ_[getNucleusRef(i)]; - } + int getNuclearZ(const unsigned int i) const { return nuclearZ_[getNucleusRef(i)]; } // this function will create new storage for Nuclear Properties, and return the // reference to it - inline int getNucleusNextRef(); + int getNucleusNextRef(); - inline int getNucleusRef(const unsigned int i) const; + int getNucleusRef(const unsigned int i) const; - inline bool isNucleus(const unsigned int i) const { return nucleusRef_[i] >= 0; } + bool isNucleus(const unsigned int i) const { return nucleusRef_[i] >= 0; } /** * Function to copy particle at location i1 in stack to i2 */ - inline void copy(const unsigned int i1, const unsigned int i2); + void copy(const unsigned int i1, const unsigned int i2); /** * Function to copy particle at location i2 in stack to i1 */ - inline void swap(const unsigned int i1, const unsigned int i2); + void swap(const unsigned int i1, const unsigned int i2); - inline void incrementSize(); + void incrementSize(); - inline void decrementSize(); + void decrementSize(); private: /// the actual memory to store particle data diff --git a/corsika/stack/VectorStack.hpp b/corsika/stack/VectorStack.hpp index 7877469ee..adaae996b 100644 --- a/corsika/stack/VectorStack.hpp +++ b/corsika/stack/VectorStack.hpp @@ -119,7 +119,7 @@ namespace corsika { void dump() const {} - inline void clear(); + void clear(); unsigned int getSize() const { return dataPID_.size(); } unsigned int getCapacity() const { return dataPID_.size(); } @@ -149,15 +149,15 @@ namespace corsika { /** * Function to copy particle at location i2 in stack to i1 */ - inline void copy(size_t i1, size_t i2); + void copy(size_t i1, size_t i2); /** * Function to copy particle at location i2 in stack to i1 */ - inline void swap(size_t i1, size_t i2); + void swap(size_t i1, size_t i2); - inline void incrementSize(); - inline void decrementSize(); + void incrementSize(); + void decrementSize(); private: /// the actual memory to store particle data diff --git a/examples/vertical_EAS.cpp b/examples/vertical_EAS.cpp index 04ddbb222..c04ae2c4c 100644 --- a/examples/vertical_EAS.cpp +++ b/examples/vertical_EAS.cpp @@ -47,6 +47,7 @@ #include <corsika/modules/Sibyll.hpp> #include <corsika/modules/UrQMD.hpp> #include <corsika/modules/PROPOSAL.hpp> +#include <corsika/modules/QGSJetII.hpp> #include <corsika/setup/SetupStack.hpp> #include <corsika/setup/SetupTrajectory.hpp> @@ -66,6 +67,7 @@ */ #include <corsika/modules/sibyll/Random.hpp> #include <corsika/modules/urqmd/Random.hpp> +#include <corsika/modules/qgsjetII/Random.hpp> using namespace corsika; using namespace std; @@ -190,6 +192,8 @@ int main(int argc, char** argv) { // setup processes, decays and interactions + corsika::qgsjetII::Interaction qgsjet; + corsika::sibyll::Interaction sibyll; InteractionCounter sibyllCounted(sibyll); diff --git a/tests/framework/testProcessSequence.cpp b/tests/framework/testProcessSequence.cpp index 3d60d2de1..efdaa2fc4 100644 --- a/tests/framework/testProcessSequence.cpp +++ b/tests/framework/testProcessSequence.cpp @@ -49,7 +49,7 @@ public: void setStep(LengthType const v) { step_ = v; } template <typename D, typename T> - inline ProcessReturn doContinuous(D& d, T&, bool const flag) const { + ProcessReturn doContinuous(D& d, T&, bool const flag) const { flag_ = flag; CORSIKA_LOG_TRACE("ContinuousProcess1::DoContinuous"); checkCont |= 1; @@ -58,7 +58,7 @@ public: } template <typename TParticle, typename TTrack> - inline LengthType getMaxStepLength(TParticle&, TTrack&) { + LengthType getMaxStepLength(TParticle&, TTrack&) { return step_; } @@ -86,7 +86,7 @@ public: void setStep(LengthType const v) { step_ = v; } template <typename D, typename T> - inline ProcessReturn doContinuous(D& d, T&, bool const flag) const { + ProcessReturn doContinuous(D& d, T&, bool const flag) const { flag_ = flag; CORSIKA_LOG_DEBUG("ContinuousProcess2::DoContinuous"); checkCont |= 2; @@ -95,7 +95,7 @@ public: } template <typename TParticle, typename TTrack> - inline LengthType getMaxStepLength(TParticle&, TTrack&) { + LengthType getMaxStepLength(TParticle&, TTrack&) { return step_; } @@ -123,7 +123,7 @@ public: void setStep(LengthType const v) { step_ = v; } template <typename D, typename T> - inline ProcessReturn doContinuous(D& d, T&, bool const flag) const { + ProcessReturn doContinuous(D& d, T&, bool const flag) const { flag_ = flag; CORSIKA_LOG_DEBUG("ContinuousProcess3::DoContinuous"); checkCont |= 4; @@ -132,7 +132,7 @@ public: } template <typename TParticle, typename TTrack> - inline LengthType getMaxStepLength(TParticle&, TTrack&) { + LengthType getMaxStepLength(TParticle&, TTrack&) { return step_; } @@ -158,7 +158,7 @@ public: } template <typename TView> - inline void doInteraction(TView& v) const { + void doInteraction(TView& v) const { checkInteract |= 1; for (int i = 0; i < nData; ++i) v.parent().data_[i] += 1 + i; } @@ -184,7 +184,7 @@ public: } template <typename TView> - inline void doInteraction(TView& v) const { + void doInteraction(TView& v) const { checkInteract |= 2; for (int i = 0; i < nData; ++i) v.parent().data_[i] /= 1.1; CORSIKA_LOG_DEBUG("Process2::doInteraction"); @@ -211,7 +211,7 @@ public: } template <typename TView> - inline void doInteraction(TView& v) const { + void doInteraction(TView& v) const { checkInteract |= 4; for (int i = 0; i < nData; ++i) v.parent().data_[i] *= 1.01; CORSIKA_LOG_DEBUG("Process3::doInteraction"); @@ -238,7 +238,7 @@ public: } template <typename D, typename T> - inline ProcessReturn doContinuous(D& d, T&, bool const) const { + ProcessReturn doContinuous(D& d, T&, bool const) const { CORSIKA_LOG_DEBUG("Base::doContinuous"); checkCont |= 8; for (int i = 0; i < nData; ++i) { d.data_[i] /= 1.2; } diff --git a/tests/modules/testQGSJetII.cpp b/tests/modules/testQGSJetII.cpp index 86bb8fce9..8b039f87c 100644 --- a/tests/modules/testQGSJetII.cpp +++ b/tests/modules/testQGSJetII.cpp @@ -20,6 +20,16 @@ #include <cstdlib> #include <experimental/filesystem> +/* + NOTE, WARNING, ATTENTION + + The sibyll/Random.hpp implements the hook of sibyll to the C8 random + number generator. It has to occur excatly ONCE per linked + executable. If you include the header below in multiple "tests" and + link them togehter, it will fail. + */ +#include <corsika/modules/qgsjetII/Random.hpp> + using namespace corsika; template <typename TStackView> -- GitLab