IAP GITLAB
Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
C
corsika
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
123
Issues
123
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Air Shower Physics
corsika
Commits
be76ac6b
Commit
be76ac6b
authored
Feb 06, 2021
by
Ralf Ulrich
☄
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'curved_tracking' into 'master'
Curved tracking See merge request
!316
parents
e845cfd7
8bf837b8
Pipeline
#3515
passed with stages
in 18 minutes and 38 seconds
Changes
109
Pipelines
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
109 changed files
with
1086 additions
and
1014 deletions
+1086
-1014
corsika/detail/framework/analytics/ClassTimer.inl
corsika/detail/framework/analytics/ClassTimer.inl
+13
-9
corsika/detail/framework/analytics/FunctionTimer.inl
corsika/detail/framework/analytics/FunctionTimer.inl
+2
-2
corsika/detail/framework/core/Cascade.inl
corsika/detail/framework/core/Cascade.inl
+8
-11
corsika/detail/framework/core/ParticleProperties.inl
corsika/detail/framework/core/ParticleProperties.inl
+18
-16
corsika/detail/framework/geometry/BaseVector.inl
corsika/detail/framework/geometry/BaseVector.inl
+4
-3
corsika/detail/framework/geometry/CoordinateSystem.inl
corsika/detail/framework/geometry/CoordinateSystem.inl
+4
-2
corsika/detail/framework/geometry/FourVector.inl
corsika/detail/framework/geometry/FourVector.inl
+20
-20
corsika/detail/framework/geometry/Helix.inl
corsika/detail/framework/geometry/Helix.inl
+5
-5
corsika/detail/framework/geometry/Plane.inl
corsika/detail/framework/geometry/Plane.inl
+1
-1
corsika/detail/framework/geometry/Point.inl
corsika/detail/framework/geometry/Point.inl
+8
-7
corsika/detail/framework/geometry/Vector.inl
corsika/detail/framework/geometry/Vector.inl
+18
-16
corsika/detail/framework/process/InteractionCounter.inl
corsika/detail/framework/process/InteractionCounter.inl
+1
-1
corsika/detail/framework/process/InteractionHistogram.inl
corsika/detail/framework/process/InteractionHistogram.inl
+6
-5
corsika/detail/framework/process/ProcessSequence.inl
corsika/detail/framework/process/ProcessSequence.inl
+10
-20
corsika/detail/framework/process/SwitchProcessSequence.inl
corsika/detail/framework/process/SwitchProcessSequence.inl
+1
-1
corsika/detail/framework/stack/CombinedStack.inl
corsika/detail/framework/stack/CombinedStack.inl
+0
-1
corsika/detail/framework/stack/SecondaryView.inl
corsika/detail/framework/stack/SecondaryView.inl
+27
-32
corsika/detail/framework/stack/Stack.inl
corsika/detail/framework/stack/Stack.inl
+63
-79
corsika/detail/framework/utility/COMBoost.inl
corsika/detail/framework/utility/COMBoost.inl
+1
-1
corsika/detail/framework/utility/CorsikaData.inl
corsika/detail/framework/utility/CorsikaData.inl
+1
-1
corsika/detail/framework/utility/CorsikaFenvOSX.inl
corsika/detail/framework/utility/CorsikaFenvOSX.inl
+2
-2
corsika/detail/media/BaseExponential.inl
corsika/detail/media/BaseExponential.inl
+6
-5
corsika/detail/media/Environment.inl
corsika/detail/media/Environment.inl
+8
-7
corsika/detail/media/FlatExponential.inl
corsika/detail/media/FlatExponential.inl
+10
-10
corsika/detail/media/HomogeneousMedium.inl
corsika/detail/media/HomogeneousMedium.inl
+9
-8
corsika/detail/media/InhomogeneousMedium.inl
corsika/detail/media/InhomogeneousMedium.inl
+5
-5
corsika/detail/media/LayeredSphericalAtmosphereBuilder.inl
corsika/detail/media/LayeredSphericalAtmosphereBuilder.inl
+8
-7
corsika/detail/media/LinearApproximationIntegrator.inl
corsika/detail/media/LinearApproximationIntegrator.inl
+4
-4
corsika/detail/media/MediumPropertyModel.inl
corsika/detail/media/MediumPropertyModel.inl
+3
-3
corsika/detail/media/NuclearComposition.inl
corsika/detail/media/NuclearComposition.inl
+2
-2
corsika/detail/media/ShowerAxis.inl
corsika/detail/media/ShowerAxis.inl
+10
-10
corsika/detail/media/SlidingPlanarExponential.inl
corsika/detail/media/SlidingPlanarExponential.inl
+7
-5
corsika/detail/media/UniformRefractiveIndex.inl
corsika/detail/media/UniformRefractiveIndex.inl
+3
-3
corsika/detail/media/Universe.inl
corsika/detail/media/Universe.inl
+2
-2
corsika/detail/media/VolumeTreeNode.inl
corsika/detail/media/VolumeTreeNode.inl
+5
-15
corsika/detail/media/WeightProvider.inl
corsika/detail/media/WeightProvider.inl
+6
-6
corsika/detail/modules/HadronicElasticModel.inl
corsika/detail/modules/HadronicElasticModel.inl
+7
-6
corsika/detail/modules/LongitudinalProfile.inl
corsika/detail/modules/LongitudinalProfile.inl
+7
-5
corsika/detail/modules/ObservationPlane.inl
corsika/detail/modules/ObservationPlane.inl
+9
-12
corsika/detail/modules/OnShellCheck.inl
corsika/detail/modules/OnShellCheck.inl
+4
-4
corsika/detail/modules/ParticleCut.inl
corsika/detail/modules/ParticleCut.inl
+20
-16
corsika/detail/modules/StackInspector.inl
corsika/detail/modules/StackInspector.inl
+4
-4
corsika/detail/modules/TrackWriter.inl
corsika/detail/modules/TrackWriter.inl
+4
-4
corsika/detail/modules/TrackingLine.inl
corsika/detail/modules/TrackingLine.inl
+2
-2
corsika/detail/modules/conex/CONEXhybrid.inl
corsika/detail/modules/conex/CONEXhybrid.inl
+8
-8
corsika/detail/modules/energy_loss/BetheBlochPDG.inl
corsika/detail/modules/energy_loss/BetheBlochPDG.inl
+21
-19
corsika/detail/modules/proposal/ContinuousProcess.inl
corsika/detail/modules/proposal/ContinuousProcess.inl
+13
-11
corsika/detail/modules/proposal/Interaction.inl
corsika/detail/modules/proposal/Interaction.inl
+4
-4
corsika/detail/modules/proposal/ProposalProcessBase.inl
corsika/detail/modules/proposal/ProposalProcessBase.inl
+4
-3
corsika/detail/modules/pythia8/Decay.inl
corsika/detail/modules/pythia8/Decay.inl
+17
-17
corsika/detail/modules/pythia8/Interaction.inl
corsika/detail/modules/pythia8/Interaction.inl
+14
-11
corsika/detail/modules/pythia8/Random.inl
corsika/detail/modules/pythia8/Random.inl
+1
-1
corsika/detail/modules/qgsjetII/Interaction.inl
corsika/detail/modules/qgsjetII/Interaction.inl
+9
-8
corsika/detail/modules/qgsjetII/QGSJetIIStack.inl
corsika/detail/modules/qgsjetII/QGSJetIIStack.inl
+28
-23
corsika/detail/modules/qgsjetII/qgsjet-II-04.inl
corsika/detail/modules/qgsjetII/qgsjet-II-04.inl
+5
-5
corsika/detail/modules/sibyll/NuclearInteraction.inl
corsika/detail/modules/sibyll/NuclearInteraction.inl
+10
-11
corsika/detail/modules/tracking/Intersect.inl
corsika/detail/modules/tracking/Intersect.inl
+8
-8
corsika/detail/modules/tracking/TrackingLeapFrogCurved.inl
corsika/detail/modules/tracking/TrackingLeapFrogCurved.inl
+100
-29
corsika/detail/modules/tracking/TrackingLeapFrogStraight.inl
corsika/detail/modules/tracking/TrackingLeapFrogStraight.inl
+16
-18
corsika/detail/modules/tracking/TrackingStraight.inl
corsika/detail/modules/tracking/TrackingStraight.inl
+9
-15
corsika/detail/modules/urqmd/UrQMD.inl
corsika/detail/modules/urqmd/UrQMD.inl
+11
-11
corsika/detail/stack/VectorStack.inl
corsika/detail/stack/VectorStack.inl
+2
-2
corsika/detail/stack/history/HistoryObservationPlane.inl
corsika/detail/stack/history/HistoryObservationPlane.inl
+7
-7
corsika/framework/analytics/Timer.hpp
corsika/framework/analytics/Timer.hpp
+5
-5
corsika/framework/core/ParticleProperties.hpp
corsika/framework/core/ParticleProperties.hpp
+3
-3
corsika/framework/core/PhysicalGeometry.hpp
corsika/framework/core/PhysicalGeometry.hpp
+15
-0
corsika/framework/geometry/CoordinateSystem.hpp
corsika/framework/geometry/CoordinateSystem.hpp
+14
-15
corsika/framework/geometry/FourVector.hpp
corsika/framework/geometry/FourVector.hpp
+2
-2
corsika/framework/geometry/Helix.hpp
corsika/framework/geometry/Helix.hpp
+13
-14
corsika/framework/geometry/Line.hpp
corsika/framework/geometry/Line.hpp
+8
-8
corsika/framework/geometry/Plane.hpp
corsika/framework/geometry/Plane.hpp
+5
-7
corsika/framework/geometry/Point.hpp
corsika/framework/geometry/Point.hpp
+10
-10
corsika/framework/geometry/QuantityVector.hpp
corsika/framework/geometry/QuantityVector.hpp
+2
-2
corsika/framework/geometry/Vector.hpp
corsika/framework/geometry/Vector.hpp
+10
-10
corsika/framework/process/ProcessSequence.hpp
corsika/framework/process/ProcessSequence.hpp
+25
-25
corsika/framework/process/SecondariesProcess.hpp
corsika/framework/process/SecondariesProcess.hpp
+1
-1
corsika/framework/process/StackProcess.hpp
corsika/framework/process/StackProcess.hpp
+1
-1
corsika/framework/process/SwitchProcessSequence.hpp
corsika/framework/process/SwitchProcessSequence.hpp
+13
-14
corsika/framework/random/RNGManager.hpp
corsika/framework/random/RNGManager.hpp
+10
-11
corsika/framework/random/UniformRealDistribution.hpp
corsika/framework/random/UniformRealDistribution.hpp
+6
-6
corsika/framework/stack/CombinedStack.hpp
corsika/framework/stack/CombinedStack.hpp
+13
-14
corsika/framework/stack/ParticleBase.hpp
corsika/framework/stack/ParticleBase.hpp
+10
-12
corsika/framework/stack/SecondaryView.hpp
corsika/framework/stack/SecondaryView.hpp
+47
-39
corsika/framework/stack/Stack.hpp
corsika/framework/stack/Stack.hpp
+42
-43
corsika/framework/stack/StackIteratorInterface.hpp
corsika/framework/stack/StackIteratorInterface.hpp
+19
-19
corsika/framework/utility/COMBoost.hpp
corsika/framework/utility/COMBoost.hpp
+4
-4
corsika/framework/utility/SaveBoostHistogram.hpp
corsika/framework/utility/SaveBoostHistogram.hpp
+2
-2
corsika/framework/utility/Singleton.hpp
corsika/framework/utility/Singleton.hpp
+0
-2
corsika/media/NameModel.hpp
corsika/media/NameModel.hpp
+0
-1
corsika/media/NuclearComposition.hpp
corsika/media/NuclearComposition.hpp
+11
-11
corsika/media/Universe.hpp
corsika/media/Universe.hpp
+2
-2
corsika/media/VolumeTreeNode.hpp
corsika/media/VolumeTreeNode.hpp
+14
-15
corsika/modules/qgsjetII/Interaction.hpp
corsika/modules/qgsjetII/Interaction.hpp
+0
-3
corsika/modules/tracking/TrackingLeapFrogCurved.hpp
corsika/modules/tracking/TrackingLeapFrogCurved.hpp
+10
-5
corsika/modules/tracking/TrackingStraight.hpp
corsika/modules/tracking/TrackingStraight.hpp
+6
-9
corsika/setup/SetupTrajectory.hpp
corsika/setup/SetupTrajectory.hpp
+5
-5
corsika/stack/DummyStack.hpp
corsika/stack/DummyStack.hpp
+8
-8
corsika/stack/GeometryNodeStackExtension.hpp
corsika/stack/GeometryNodeStackExtension.hpp
+17
-19
corsika/stack/NuclearStackExtension.hpp
corsika/stack/NuclearStackExtension.hpp
+27
-31
corsika/stack/VectorStack.hpp
corsika/stack/VectorStack.hpp
+5
-5
do-clang-format.py
do-clang-format.py
+1
-0
examples/vertical_EAS.cpp
examples/vertical_EAS.cpp
+4
-0
src/framework/core/ParticleData.xml
src/framework/core/ParticleData.xml
+2
-2
src/modules/qgsjetII/code_generator.py
src/modules/qgsjetII/code_generator.py
+2
-2
tests/common/SetupTestTrajectory.hpp
tests/common/SetupTestTrajectory.hpp
+19
-18
tests/framework/testCascade.cpp
tests/framework/testCascade.cpp
+6
-7
tests/framework/testProcessSequence.cpp
tests/framework/testProcessSequence.cpp
+10
-10
tests/media/testMedium.cpp
tests/media/testMedium.cpp
+2
-1
tests/modules/testQGSJetII.cpp
tests/modules/testQGSJetII.cpp
+10
-0
No files found.
corsika/detail/framework/analytics/ClassTimer.inl
View file @
be76ac6b
...
...
@@ -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
corsika/detail/framework/analytics/FunctionTimer.inl
View file @
be76ac6b
...
...
@@ -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)...);
...
...
corsika/detail/framework/core/Cascade.inl
View file @
be76ac6b
...
...
@@ -18,9 +18,6 @@
#include <corsika/framework/stack/SecondaryView.hpp>
#include <corsika/media/Environment.hpp>
#include <corsika/setup/SetupStack.hpp>
#include <corsika/setup/SetupTrajectory.hpp>
#include <cassert>
#include <cmath>
#include <iostream>
...
...
@@ -31,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()) {
...
...
@@ -58,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();
...
...
@@ -70,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 =
...
...
@@ -139,7 +137,6 @@ namespace corsika {
distance_interact / 1_m, continuous_max_dist / 1_m);
// here the particle is actually moved along the trajectory to new position:
// std::visit(setup::ParticleUpdate<particle_type>{vParticle}, step);
step.setLength(min_distance);
vParticle.setPosition(step.getPosition(1));
// assumption: tracking does not change absolute momentum:
...
...
@@ -240,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());
...
...
@@ -258,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");
...
...
@@ -278,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());
...
...
@@ -288,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); }
...
...
corsika/detail/framework/core/ParticleProperties.inl
View file @
be76ac6b
...
...
@@ -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) {
in
line in
t16_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) {
in
line in
t 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) {
in
line in
t 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;
}
...
...
corsika/detail/framework/geometry/BaseVector.inl
View file @
be76ac6b
...
...
@@ -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_;
}
...
...
corsika/detail/framework/geometry/CoordinateSystem.inl
View file @
be76ac6b
...
...
@@ -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();
...
...
corsika/detail/framework/geometry/FourVector.inl
View file @
be76ac6b
...
...
@@ -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)
...
...
corsika/detail/framework/geometry/Helix.inl
View file @
be76ac6b
...
...
@@ -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();
}
...
...
corsika/detail/framework/geometry/Plane.inl
View file @
be76ac6b
...
...
@@ -26,7 +26,7 @@ namespace corsika {
inline Point const& Plane::getCenter() const { return center_; }
inline
Plane::DimLessVec
const& Plane::getNormal() const { return normal_; }
inline
DirectionVector
const& Plane::getNormal() const { return normal_; }
inline std::string Plane::asString() const {
std::ostringstream txt;
...
...
corsika/detail/framework/geometry/Point.inl
View file @
be76ac6b
...
...
@@ -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));
}
...
...
corsika/detail/framework/geometry/Vector.inl
View file @
be76ac6b
...
...
@@ -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());
}