|
CORSIKA
@c8_version@
The framework to simulate particle cascades for astroparticle physics
|
Description of physical four-vectors. More...
#include <FourVector.hpp>
Public Member Functions | |
| FourVector (FourVector &&)=default | |
| FourVector (FourVector const &)=default | |
| FourVector & | operator= (const FourVector &)=default |
| FourVector (TTimeType const &eT, TSpaceVecType const &eS) | |
| TTimeType | getTimeLikeComponent () const |
| TSpaceVecType & | getSpaceLikeComponents () |
| TSpaceVecType const & | getSpaceLikeComponents () const |
| norm_square_type | getNormSqr () const |
| norm_type | getNorm () const |
| bool | isTimelike () const |
| bool | isSpacelike () const |
Math operators (class members) | |
| FourVector & | operator+= (FourVector const &) |
| FourVector & | operator-= (FourVector const &) |
| FourVector & | operator*= (double const) |
| FourVector & | operator/= (double const) |
| FourVector & | operator/ (double const) |
| norm_type | operator* (FourVector const &b) |
| Scalar product of two FourVectors. More... | |
Protected Attributes | |
| TTimeType | timeLike_ |
| TSpaceVecType | spaceLike_ |
Friends | |
Free math operators | |
We need to define them inline here since we do not want to implement them as template functions. They are valid only for the specific types as defined right here. Note, these are "free function" (even if they don't look as such). Thus, even if the input object uses internal references for storage, the free math operators, of course, must provide value-copies. | |
| FourVector< time_type, space_vec_type > | operator+ (FourVector const &a, FourVector const &b) |
| FourVector< time_type, space_vec_type > | operator- (FourVector const &a, FourVector const &b) |
| FourVector< time_type, space_vec_type > | operator* (FourVector const &a, double const b) |
| FourVector< time_type, space_vec_type > | operator/ (FourVector const &a, double const b) |
Description of physical four-vectors.
FourVector fully supports units, e.g. E in [GeV/c] and p in [GeV], or also t in [s] and r in [m], etc.
However, for HEP applications it is also possible to use E and p both in [GeV].
Thus, the input units of time-like and space-like coordinates must either be idential (e.g. GeV) or scaled by "c" as in [E/c]=[p].
The FourVector can return its squared-norm getNormSqr and its norm getNorm, whereas norm is sqrt(abs(norm-squared)). The physical units are always calculated and returned properly.
FourVector can also return if it is TimeLike, SpaceLike or PhotonLike.
When a FourVector is initialized with a lvalue references, e.g. as FourVector<TimeType&, Vector<length_d>&>, references are also used as internal data types, which should lead to complete disappearance of the FourVector class during optimization.
Definition at line 51 of file FourVector.hpp.
| norm_type corsika::FourVector< TTimeType, TSpaceVecType >::getNorm | ( | ) | const |
| norm_square_type corsika::FourVector< TTimeType, TSpaceVecType >::getNormSqr | ( | ) | const |
| TSpaceVecType& corsika::FourVector< TTimeType, TSpaceVecType >::getSpaceLikeComponents | ( | ) |
| TSpaceVecType const& corsika::FourVector< TTimeType, TSpaceVecType >::getSpaceLikeComponents | ( | ) | const |
| TTimeType corsika::FourVector< TTimeType, TSpaceVecType >::getTimeLikeComponent | ( | ) | const |
| bool corsika::FourVector< TTimeType, TSpaceVecType >::isSpacelike | ( | ) | const |
| bool corsika::FourVector< TTimeType, TSpaceVecType >::isTimelike | ( | ) | const |
| norm_type corsika::FourVector< TTimeType, TSpaceVecType >::operator* | ( | FourVector< TTimeType, TSpaceVecType > const & | b | ) |
Scalar product of two FourVectors.
Note that the product between two 4-vectors assumes that you use the same "c" convention for both. Only the LHS vector is checked for this. You cannot mix different conventions due to unit-checking.