CORSIKA  @c8_version@
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 
46 
47  public:
48  LeapFrogTrajectory() = delete;
49  LeapFrogTrajectory(LeapFrogTrajectory const&) = default;
51  LeapFrogTrajectory& operator=(LeapFrogTrajectory const&) = delete;
52 
53  LeapFrogTrajectory(Point const& pos, VelocityVector const& initialVelocity,
54  MagneticFieldVector const& Bfield,
55  decltype(1 / (tesla * second)) const k,
56  TimeType const timeStep) // leap-from total length
57  : initialPosition_(pos)
58  , initialVelocity_(initialVelocity)
59  , initialDirection_(initialVelocity.normalized())
60  , magneticfield_(Bfield)
61  , k_(k)
62  , timeStep_(timeStep) {}
63 
64  Line getLine() const;
65 
66  Point getPosition(double const u) const;
67 
68  VelocityVector getVelocity(double const u) const;
69 
70  DirectionVector getDirection(double const u) const;
71 
73  TimeType getDuration(double const u = 1) const;
74 
76  template <typename Particle>
77  TimeType getTime(Particle const& particle, double const u) const;
78 
80  LengthType getLength(double const u = 1) const;
81 
83  void setLength(LengthType const limit);
84 
86  // Scale other properties by "limit/timeLength_"
87  void setDuration(TimeType const limit);
88 
89  private:
90  Point initialPosition_;
91  VelocityVector initialVelocity_;
92  DirectionVector initialDirection_;
93  MagneticFieldVector magneticfield_;
94  decltype(1 / (tesla * second)) k_;
95  TimeType timeStep_;
96  };
97 
98 } // namespace corsika
99 
100 #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
`, since they are used everywhere as integral part of the framework.
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...
TimeType getTime(Particle const &particle, double const u) const
! time at the start (u=0) or at the end (u=1) of the track of a particle