IAP GITLAB

Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • AirShowerPhysics/corsika
  • rulrich/corsika
  • AAAlvesJr/corsika
  • Andre/corsika
  • arrabito/corsika
  • Nikos/corsika
  • olheiser73/corsika
  • AirShowerPhysics/papers/corsika
  • pranav/corsika
9 results
Show changes
Showing
with 142 additions and 84 deletions
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
#include <corsika/framework/core/PhysicalUnits.hpp>
......@@ -6,24 +13,21 @@
#include <corsika/framework/geometry/IVolume.hpp>
namespace corsika {
/**
* Describes a box in space
*
* The center point and the orintation of the Box is set by
* a CoordinateSystemPtr at construction and the sides extend
* by x, y, z in both directions.
**/
class Box : public IVolume {
public:
// a CoordinateSystemPtr to specify the orintation of coordinate
Box(Point const& center, CoordinateSystemPtr cs, LengthType const x,
LengthType const y, LengthType const z)
: center_(center)
, cs_(make_translation(cs, center.getCoordinates(cs)))
, x_(x)
, y_(y)
, z_(z) {}
Box(Point const& center, CoordinateSystemPtr cs, LengthType const side)
: center_(center)
, cs_(make_translation(cs, center.getCoordinates(cs)))
, x_(side / 2)
, y_(side / 2)
, z_(side / 2) {}
Box(CoordinateSystemPtr cs, LengthType const x, LengthType const y,
LengthType const z);
Box(CoordinateSystemPtr cs, LengthType const side);
//! returns true if the Point p is within the sphere
bool contains(Point const& p) const override;
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......@@ -35,7 +34,7 @@ namespace corsika {
using CoordinateSystemPtr = std::shared_ptr<CoordinateSystem const>;
/// this is the only way to create ONE unique root CS
static CoordinateSystemPtr& get_root_CoordinateSystem();
CoordinateSystemPtr const& get_root_CoordinateSystem();
/**
* Creates new CoordinateSystemPtr by translation along \a vector
......@@ -109,8 +108,8 @@ namespace corsika {
public:
// default resource allocation
CoordinateSystem(CoordinateSystem const&) = default;
CoordinateSystem(CoordinateSystem&&) = default;
CoordinateSystem(CoordinateSystem const&) = delete;
CoordinateSystem(CoordinateSystem&&) = delete;
CoordinateSystem& operator=(CoordinateSystem const& pCS) =
delete; // avoid making copies
~CoordinateSystem() = default;
......@@ -128,15 +127,13 @@ namespace corsika {
bool operator!=(CoordinateSystem const&) const;
protected:
static CoordinateSystem createCS() { return CoordinateSystem(); }
/**
* \name Friends
* Manipulation and creation functions.
* \{
**/
friend CoordinateSystemPtr& get_root_CoordinateSystem();
friend CoordinateSystemPtr const& get_root_CoordinateSystem();
friend CoordinateSystemPtr make_translation(CoordinateSystemPtr const& cs,
QuantityVector<length_d> const& vector);
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......
/*
* (c) Copyright 2018 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......@@ -72,6 +71,10 @@ namespace corsika {
///! duration along potentially bend trajectory
TimeType getDuration(double const u = 1) const;
///! time at the start (u=0) or at the end (u=1) of the track of a particle
template <typename Particle>
TimeType getTime(Particle const& particle, double const u) const;
///! total length along potentially bend trajectory
LengthType getLength(double const u = 1) const;
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
#include <deque>
#include <corsika/framework/core/PhysicalUnits.hpp>
#include <corsika/framework/geometry/Point.hpp>
namespace corsika {
......@@ -18,8 +19,14 @@ namespace corsika {
* points using N >= 1 straight-line segments.
*/
class Path {
protected:
std::deque<Point> points_; ///< The points that make up this path.
LengthType length_ = LengthType::zero(); ///< The length of the path.
using iterator = std::deque<Point>::iterator;
using const_iterator = std::deque<Point>::const_iterator;
public:
/**
* Create a Path with a given starting Point.
......@@ -49,27 +56,37 @@ namespace corsika {
/**
* Get the starting point of the path.
*/
inline Point getStart() const;
inline Point const& getStart() const;
/**
* Get the end point of the path.
*/
inline Point getEnd() const;
inline Point const& getEnd() const;
/**
* Get a specific point of the path.
*/
inline Point getPoint(std::size_t const index) const;
inline Point const& getPoint(std::size_t const index) const;
/**
* Return an iterator to the start of the Path.
*/
inline const_iterator begin() const;
/**
* Return an iterator to the end of the Path.
*/
inline const_iterator end() const;
/**
* Return an iterator to the start of the Path.
*/
inline auto begin();
inline iterator begin();
/**
* Return an iterator to the end of the Path.
*/
inline auto end();
inline iterator end();
/**
* Get the number of steps in the path.
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......@@ -72,6 +71,7 @@ namespace corsika {
inline void rebase(CoordinateSystemPtr const& pCS);
inline Point operator+(Vector<length_d> const& pVec) const;
inline Point operator-(Vector<length_d> const& pVec) const;
/*!
* returns the distance Vector between two points
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......@@ -27,8 +26,8 @@ namespace corsika {
* RootCoordinateSystem
*/
static inline CoordinateSystemPtr& get_root_CoordinateSystem() {
static CoordinateSystemPtr rootCS(new CoordinateSystem); // THIS IS IT
inline CoordinateSystemPtr const& get_root_CoordinateSystem() {
static CoordinateSystemPtr const rootCS(new CoordinateSystem); // THIS IS IT
return rootCS;
}
......
/*
* (c) Copyright 2023 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
#include <corsika/framework/geometry/Plane.hpp>
#include <corsika/framework/geometry/Point.hpp>
#include <corsika/framework/geometry/IVolume.hpp>
namespace corsika {
/**
* Describes which exists on one side of a plane
*
* The separation line is given by a plane where the unit
* vector of the plane points outside of the volume
**/
class SeparationPlane : public IVolume {
public:
SeparationPlane(Plane const& plane);
~SeparationPlane() {}
Plane getPlane() const { return plane_; }
//! returns true if the Point p is below the plane
bool contains(Point const& p) const override;
std::string asString() const;
protected:
Plane const plane_;
};
} // namespace corsika
#include <corsika/detail/framework/geometry/SeparationPlane.inl>
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......@@ -38,6 +37,10 @@ namespace corsika {
void setRadius(LengthType const);
CoordinateSystemPtr const getCoordinateSystem() const;
std::string asString() const;
private:
Point center_;
LengthType radius_;
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......@@ -84,6 +83,10 @@ namespace corsika {
///! duration along potentially bend trajectory
TimeType getDuration(double const u = 1) const;
///! time at the start (u=0) or at the end (u=1) of the track of a particle
template <typename Particle>
TimeType getTime(Particle const& particle, double const u) const;
///! total length along potentially bend trajectory
LengthType getLength(double const u = 1) const;
......
/*
* (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
* This software is distributed under the terms of the 3-clause BSD license.
* See file LICENSE for a full version of the license.
*/
#pragma once
......@@ -36,8 +35,9 @@ namespace corsika {
Vector(CoordinateSystemPtr const& pCS, QuantityVector<TDimension> const& pQVector)
: BaseVector<TDimension>(pCS, pQVector) {}
Vector(CoordinateSystemPtr const& cs, quantity_type const x, quantity_type const y,
quantity_type const z)
Vector(CoordinateSystemPtr const& cs, quantity_type const x = quantity_type::zero(),
quantity_type const y = quantity_type::zero(),
quantity_type const z = quantity_type::zero())
: BaseVector<TDimension>(cs, QuantityVector<TDimension>(x, y, z)) {}
/*!
......