Warning, file /include/Geant4/G4FieldUtils.hh was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef G4FIELD_UTILS_HH
0036 #define G4FIELD_UTILS_HH
0037
0038 #include "G4FieldTrack.hh"
0039 #include "G4Types.hh"
0040 #include "G4ThreeVector.hh"
0041
0042 namespace field_utils
0043 {
0044
0045 using State = G4double[G4FieldTrack::ncompSVEC];
0046
0047 template <unsigned int N>
0048 using ShortState = G4double[N];
0049
0050 enum class Value3D
0051 {
0052 Position = 0,
0053 Momentum = 3,
0054 Spin = 9
0055 };
0056
0057 enum class Value1D
0058 {
0059 KineticEnergy = 6,
0060 LabTime = 7,
0061 ProperTime = 8
0062 };
0063
0064 template <typename ArrayType>
0065 G4double getValue(const ArrayType& array, Value1D value);
0066
0067 template <typename ArrayType>
0068 G4double getValue2(const ArrayType& array, Value1D value);
0069
0070 template <typename ArrayType>
0071 G4double getValue(const ArrayType& array, Value3D value);
0072
0073 template <typename ArrayType>
0074 G4double getValue2(const ArrayType& array, Value3D value);
0075
0076 template <typename ArrayType>
0077 G4ThreeVector makeVector(const ArrayType& array, Value3D value);
0078
0079 G4double absoluteError(
0080 const G4double y[],
0081 const G4double yerr[],
0082 G4double hstep);
0083
0084 G4double relativeError2(
0085 const G4double y[],
0086 const G4double yerr[],
0087 G4double hstep,
0088 G4double errorTolerance);
0089
0090 G4double relativeError(
0091 const G4double y[],
0092 const G4double yerr[],
0093 G4double hstep,
0094 G4double errorTolerance);
0095
0096 template <typename SourceArray, typename TargetArray>
0097 void setValue(const SourceArray& src, Value1D value, TargetArray& trg);
0098
0099 template <typename SourceArray, typename TargetArray, typename ...TargetArrays>
0100 void setValue(const SourceArray& src, Value1D value,
0101 TargetArray& trg, TargetArrays&... trgs);
0102
0103 void copy(G4double dst[], const G4double src[],
0104 std::size_t size = G4FieldTrack::ncompSVEC);
0105
0106 G4double inverseCurvatureRadius(G4double particleCharge,
0107 G4double momentum, G4double BField);
0108
0109 template <typename T>
0110 T clamp(T value, T lo, T hi);
0111
0112 }
0113
0114 #include "G4FieldUtils.icc"
0115
0116 #endif