CORSIKA8  0.0.0
The framework to simulate particle cascades for astroparticle physics
LeapFrogTrajectory.hpp
1 /*
2  * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 
9 #pragma once
10 
12 #include <corsika/framework/geometry/Line.hpp>
13 #include <corsika/framework/geometry/Point.hpp>
14 #include <corsika/framework/geometry/PhysicalGeometry.hpp>
15 #include <corsika/framework/geometry/BaseTrajectory.hpp>
16 
17 namespace corsika {
18 
45 
46  public:
47  LeapFrogTrajectory() = delete;
48  LeapFrogTrajectory(LeapFrogTrajectory const&) = default;
50  LeapFrogTrajectory& operator=(LeapFrogTrajectory const&) = delete;
51 
52  LeapFrogTrajectory(Point const& pos, VelocityVector const& initialVelocity,
53  MagneticFieldVector const& Bfield,
54  decltype(1 / (tesla * second)) const k,
55  TimeType const timeStep) // leap-from total length
56  : initialPosition_(pos)
57  , initialVelocity_(initialVelocity)
58  , initialDirection_(initialVelocity.normalized())
59  , magneticfield_(Bfield)
60  , k_(k)
61  , timeStep_(timeStep) {}
62 
63  Line getLine() const;
64 
65  Point getPosition(double const u) const;
66 
67  VelocityVector getVelocity(double const u) const;
68 
69  DirectionVector getDirection(double const u) const;
70 
72  TimeType getDuration(double const u = 1) const;
73 
75  LengthType getLength(double const u = 1) const;
76 
78  void setLength(LengthType const limit);
79 
81  // Scale other properties by "limit/timeLength_"
82  void setDuration(TimeType const limit);
83 
84  private:
85  Point initialPosition_;
86  VelocityVector initialVelocity_;
87  DirectionVector initialDirection_;
88  MagneticFieldVector magneticfield_;
89  decltype(1 / (tesla * second)) k_;
90  TimeType timeStep_;
91  };
92 
93 } // namespace corsika
94 
95 #include <corsika/detail/framework/geometry/LeapFrogTrajectory.inl>
The LeapFrogTrajectory stores information on one leap-frog step.
Import and extend the phys::units package.
void setLength(LengthType const limit)
! set new duration along potentially bend trajectory.
A Line describes a movement in three dimensional space.
Definition: Line.hpp:27
TimeType getDuration(double const u=1) const
! duration along potentially bend trajectory
LengthType getLength(double const u=1) const
! total length along potentially bend trajectory
The cascade namespace assembles all objects needed to simulate full particles cascades.
void setDuration(TimeType const limit)
! set new duration along potentially bend trajectory.
A Trajectory is a description of a momvement of an object in three-dimensional space that describes t...