IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 621d79ac authored by ralfulrich's avatar ralfulrich
Browse files

clang-format

parent 0d71c250
No related branches found
No related tags found
2 merge requests!91Resolve "define further classes of processes (MaintenanceProcess?)",!76Resolve "Handling of boundary crossings in geometry tree"
...@@ -35,7 +35,7 @@ namespace corsika::environment { ...@@ -35,7 +35,7 @@ namespace corsika::environment {
class Environment { class Environment {
public: public:
using BaseNodeType = VolumeTreeNode<IEnvironmentModel>; using BaseNodeType = VolumeTreeNode<IEnvironmentModel>;
Environment() Environment()
: fCoordinateSystem{corsika::geometry::RootCoordinateSystem::GetInstance() : fCoordinateSystem{corsika::geometry::RootCoordinateSystem::GetInstance()
.GetRootCoordinateSystem()} .GetRootCoordinateSystem()}
...@@ -65,8 +65,8 @@ namespace corsika::environment { ...@@ -65,8 +65,8 @@ namespace corsika::environment {
typename BaseNodeType::VTNUPtr fUniverse; typename BaseNodeType::VTNUPtr fUniverse;
}; };
//using SetupBaseNodeType = VolumeTreeNode<corsika::setup::IEnvironmentModel>; // using SetupBaseNodeType = VolumeTreeNode<corsika::setup::IEnvironmentModel>;
//using SetupEnvironment = Environment<corsika::setup::IEnvironmentModel>; // using SetupEnvironment = Environment<corsika::setup::IEnvironmentModel>;
} // namespace corsika::environment } // namespace corsika::environment
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
#ifndef _include_VolumeTreeNode_H #ifndef _include_VolumeTreeNode_H
#define _include_VolumeTreeNode_H #define _include_VolumeTreeNode_H
#include <corsika/geometry/Volume.h>
#include <corsika/environment/IMediumModel.h> #include <corsika/environment/IMediumModel.h>
#include <corsika/geometry/Volume.h>
#include <memory> #include <memory>
#include <vector> #include <vector>
......
...@@ -4,16 +4,19 @@ ...@@ -4,16 +4,19 @@
#include <corsika/environment/Environment.h> #include <corsika/environment/Environment.h>
#include <corsika/setup/SetupStack.h> #include <corsika/setup/SetupStack.h>
using TestEnvironmentType = corsika::environment::Environment<corsika::environment::IMediumModel>; using TestEnvironmentType =
corsika::environment::Environment<corsika::environment::IMediumModel>;
template <typename T> template <typename T>
using SetupGeometryDataInterface = GeometryDataInterface<T, TestEnvironmentType>; using SetupGeometryDataInterface = GeometryDataInterface<T, TestEnvironmentType>;
// combine particle data stack with geometry information for tracking // combine particle data stack with geometry information for tracking
template <typename StackIter> template <typename StackIter>
using StackWithGeometryInterface = using StackWithGeometryInterface = corsika::stack::CombinedParticleInterface<
corsika::stack::CombinedParticleInterface<corsika::setup::detail::ParticleDataStack::PIType, corsika::setup::detail::ParticleDataStack::PIType, SetupGeometryDataInterface,
SetupGeometryDataInterface, StackIter>; StackIter>;
using TestCascadeStack = corsika::stack::CombinedStack<typename corsika::setup::detail::ParticleDataStack::StackImpl, GeometryData<TestEnvironmentType>, StackWithGeometryInterface>; using TestCascadeStack = corsika::stack::CombinedStack<
typename corsika::setup::detail::ParticleDataStack::StackImpl,
GeometryData<TestEnvironmentType>, StackWithGeometryInterface>;
#endif #endif
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
#ifndef _include_TRAJECTORY_H #ifndef _include_TRAJECTORY_H
#define _include_TRAJECTORY_H #define _include_TRAJECTORY_H
#include <corsika/geometry/Point.h>
#include <corsika/geometry/Line.h> #include <corsika/geometry/Line.h>
#include <corsika/geometry/Point.h>
#include <corsika/units/PhysicalUnits.h> #include <corsika/units/PhysicalUnits.h>
namespace corsika::geometry { namespace corsika::geometry {
...@@ -47,10 +47,10 @@ namespace corsika::geometry { ...@@ -47,10 +47,10 @@ namespace corsika::geometry {
void LimitEndTo(corsika::units::si::LengthType limit) { void LimitEndTo(corsika::units::si::LengthType limit) {
fTimeLength = T::TimeFromArclength(limit); fTimeLength = T::TimeFromArclength(limit);
} }
auto NormalizedDirection() const { auto NormalizedDirection() const {
static_assert(std::is_same_v<T, corsika::geometry::Line>); static_assert(std::is_same_v<T, corsika::geometry::Line>);
return T::GetV0().normalized(); return T::GetV0().normalized();
} }
}; };
......
...@@ -25,8 +25,7 @@ namespace corsika::process { ...@@ -25,8 +25,7 @@ namespace corsika::process {
* \p from and \p to. * \p from and \p to.
*/ */
template <typename Particle, typename VTNType> template <typename Particle, typename VTNType>
EProcessReturn DoBoundaryCrossing(Particle&, VTNType const& from, EProcessReturn DoBoundaryCrossing(Particle&, VTNType const& from, VTNType const& to);
VTNType const& to);
}; };
template <class T> template <class T>
......
...@@ -45,12 +45,11 @@ namespace corsika::utl { ...@@ -45,12 +45,11 @@ namespace corsika::utl {
template <typename T> template <typename T>
class Singleton { class Singleton {
public: public:
static T& GetInstance() static T& GetInstance() {
{
static T instance; static T instance;
return instance; return instance;
} }
Singleton(const Singleton&) = delete; Singleton(const Singleton&) = delete;
Singleton& operator=(const Singleton&) = delete; Singleton& operator=(const Singleton&) = delete;
......
...@@ -51,9 +51,9 @@ namespace corsika::process::HadronicElasticModel { ...@@ -51,9 +51,9 @@ namespace corsika::process::HadronicElasticModel {
corsika::units::si::CrossSectionType CrossSection(SquaredHEPEnergyType s) const; corsika::units::si::CrossSectionType CrossSection(SquaredHEPEnergyType s) const;
public: public:
HadronicElasticInteraction(// x & y values taken from DL for pp collisions HadronicElasticInteraction( // x & y values taken from DL for pp collisions
units::si::CrossSectionType x = 0.0217 * units::si::barn, units::si::CrossSectionType x = 0.0217 * units::si::barn,
units::si::CrossSectionType y = 0.05608 * units::si::barn); units::si::CrossSectionType y = 0.05608 * units::si::barn);
void Init(); void Init();
template <typename Particle, typename Track> template <typename Particle, typename Track>
......
...@@ -11,24 +11,26 @@ ...@@ -11,24 +11,26 @@
#ifndef _include_process_trackinling_teststack_h_ #ifndef _include_process_trackinling_teststack_h_
#define _include_process_trackinling_teststack_h_ #define _include_process_trackinling_teststack_h_
#include <corsika/geometry/Point.h>
#include <corsika/environment/Environment.h> #include <corsika/environment/Environment.h>
#include <corsika/geometry/Point.h>
#include <corsika/geometry/Vector.h> #include <corsika/geometry/Vector.h>
#include <corsika/particles/ParticleProperties.h> #include <corsika/particles/ParticleProperties.h>
#include <corsika/units/PhysicalUnits.h>
#include <corsika/setup/SetupStack.h> #include <corsika/setup/SetupStack.h>
#include <corsika/units/PhysicalUnits.h>
using TestEnvironmentType = corsika::environment::Environment<corsika::environment::Empty>; using TestEnvironmentType =
corsika::environment::Environment<corsika::environment::Empty>;
template <typename T> template <typename T>
using SetupGeometryDataInterface = GeometryDataInterface<T, TestEnvironmentType>; using SetupGeometryDataInterface = GeometryDataInterface<T, TestEnvironmentType>;
// combine particle data stack with geometry information for tracking // combine particle data stack with geometry information for tracking
template <typename StackIter> template <typename StackIter>
using StackWithGeometryInterface = using StackWithGeometryInterface = corsika::stack::CombinedParticleInterface<
corsika::stack::CombinedParticleInterface<corsika::setup::detail::ParticleDataStack::PIType, corsika::setup::detail::ParticleDataStack::PIType, SetupGeometryDataInterface,
SetupGeometryDataInterface, StackIter>; StackIter>;
using TestTrackingLineStack = corsika::stack::CombinedStack<typename corsika::setup::detail::ParticleDataStack::StackImpl, GeometryData<TestEnvironmentType>, StackWithGeometryInterface>; using TestTrackingLineStack = corsika::stack::CombinedStack<
typename corsika::setup::detail::ParticleDataStack::StackImpl,
GeometryData<TestEnvironmentType>, StackWithGeometryInterface>;
#endif #endif
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
// extension with geometry information for tracking // extension with geometry information for tracking
#include <corsika/environment/Environment.h> #include <corsika/environment/Environment.h>
#include <corsika/stack/CombinedStack.h>
#include <corsika/setup/SetupEnvironment.h> #include <corsika/setup/SetupEnvironment.h>
#include <corsika/stack/CombinedStack.h>
#include <tuple> #include <tuple>
#include <utility> #include <utility>
...@@ -33,7 +33,7 @@ class GeometryData { ...@@ -33,7 +33,7 @@ class GeometryData {
public: public:
using BaseNodeType = typename TEnvType::BaseNodeType; using BaseNodeType = typename TEnvType::BaseNodeType;
// these functions are needed for the Stack interface // these functions are needed for the Stack interface
void Init() {} void Init() {}
void Clear() { fNode.clear(); } void Clear() { fNode.clear(); }
...@@ -44,9 +44,7 @@ public: ...@@ -44,9 +44,7 @@ public:
// custom data access function // custom data access function
void SetNode(const int i, BaseNodeType const* v) { fNode[i] = v; } void SetNode(const int i, BaseNodeType const* v) { fNode[i] = v; }
auto const* GetNode(const int i) const { auto const* GetNode(const int i) const { return fNode[i]; }
return fNode[i];
}
// these functions are also needed by the Stack interface // these functions are also needed by the Stack interface
void IncrementSize() { fNode.push_back(nullptr); } void IncrementSize() { fNode.push_back(nullptr); }
...@@ -74,19 +72,16 @@ public: ...@@ -74,19 +72,16 @@ public:
void SetParticleData(const std::tuple<BaseNodeType const*> v) { void SetParticleData(const std::tuple<BaseNodeType const*> v) {
SetNode(std::get<0>(v)); SetNode(std::get<0>(v));
} }
void SetParticleData(GeometryDataInterface& parent, const std::tuple<BaseNodeType const*>) { void SetParticleData(GeometryDataInterface& parent,
const std::tuple<BaseNodeType const*>) {
SetNode(parent.GetNode()); // copy Node from parent particle! SetNode(parent.GetNode()); // copy Node from parent particle!
} }
void SetParticleData() { SetNode(nullptr); } void SetParticleData() { SetNode(nullptr); }
void SetParticleData(GeometryDataInterface& parent) { void SetParticleData(GeometryDataInterface& parent) {
SetNode(parent.GetNode()); // copy Node from parent particle! SetNode(parent.GetNode()); // copy Node from parent particle!
} }
void SetNode(BaseNodeType const* v) { void SetNode(BaseNodeType const* v) { GetStackData().SetNode(GetIndex(), v); }
GetStackData().SetNode(GetIndex(), v); auto const* GetNode() const { return GetStackData().GetNode(GetIndex()); }
}
auto const* GetNode() const {
return GetStackData().GetNode(GetIndex());
}
}; };
namespace corsika::setup { namespace corsika::setup {
...@@ -116,7 +111,8 @@ namespace corsika::setup { ...@@ -116,7 +111,8 @@ namespace corsika::setup {
SetupGeometryDataInterface, StackIter>; SetupGeometryDataInterface, StackIter>;
using StackWithGeometry = using StackWithGeometry =
corsika::stack::CombinedStack<typename ParticleDataStack::StackImpl, GeometryData<setup::SetupEnvironment>, corsika::stack::CombinedStack<typename ParticleDataStack::StackImpl,
GeometryData<setup::SetupEnvironment>,
StackWithGeometryInterface>; StackWithGeometryInterface>;
} // namespace detail } // namespace detail
......
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment