12 #include <corsika/framework/core/PhysicalGeometry.hpp> 13 #include <corsika/framework/geometry/Vector.hpp> 14 #include <corsika/framework/geometry/Point.hpp> 15 #include <corsika/framework/geometry/StraightTrajectory.hpp> 26 , delta_direction_{du} {}
34 template <
typename TParticle>
37 template <
typename TTrajectory>
38 Step(TParticle
const& particle, TTrajectory
const& track)
39 : particlePreStep_{particle}
41 track.getPosition(1) - particle.getPosition(),
42 track.getDirection(1) - particle.getDirection()}
47 diff_.delta_Ekin_ += dEkin;
48 return diff_.delta_Ekin_;
52 diff_.delta_time_ += dt;
53 return diff_.delta_time_;
57 diff_.displacement_ += dis;
58 return diff_.displacement_;
62 diff_.delta_direction_ += du;
63 return diff_.delta_direction_;
68 HEPEnergyType getDiffEkin()
const {
return diff_.delta_Ekin_; }
70 TimeType getDiffT()
const {
return diff_.delta_time_; };
72 DirectionVector const& getDiffDirection()
const {
return diff_.delta_direction_; }
74 LengthVector const& getDisplacement()
const {
return diff_.displacement_; }
80 TParticle
const& getParticlePre()
const {
return particlePreStep_; }
82 HEPEnergyType getEkinPre()
const {
return getParticlePre().getKineticEnergy(); }
84 HEPEnergyType getEkinPost()
const {
return getEkinPre() + getDiffEkin(); }
86 TimeType getTimePre()
const {
return getParticlePre().getTime(); }
88 TimeType getTimePost()
const {
return getTimePre() + getDiffT(); }
91 return getParticlePre().getDirection();
94 VelocityVector getVelocityVector()
const {
return getDisplacement() / getDiffT(); }
97 Line const line(getPositionPre(), getVelocityVector());
103 return (getDirectionPre() + getDiffDirection()).normalized();
106 Point const& getPositionPre()
const {
return getParticlePre().getPosition(); }
108 Point getPositionPost()
const {
return getPositionPre() + getDisplacement(); }
111 TParticle
const& particlePreStep_;
Import and extend the phys::units package.
A Line describes a movement in three dimensional space.
LengthVector const & getDiffPosition() const
alias for getDisplacement()
`, since they are used everywhere as integral part of the framework.
static constexpr quantity zero()
We need a "zero" of each type – for comparisons, to initialize running totals, etc.
This implements a straight trajectory between two points.