File indexing completed on 2025-01-18 09:58:17
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
0036
0037
0038 #ifndef G4FIELDTRACK_HH
0039 #define G4FIELDTRACK_HH
0040
0041 #include "G4ThreeVector.hh"
0042 #include "G4ChargeState.hh"
0043
0044 class G4FieldTrack
0045 {
0046 public:
0047
0048 G4FieldTrack( const G4ThreeVector& pPosition,
0049 G4double LaboratoryTimeOfFlight,
0050 const G4ThreeVector& pMomentumDirection,
0051 G4double kineticEnergy,
0052 G4double restMass_c2,
0053 G4double charge,
0054 const G4ThreeVector& polarization,
0055 G4double magnetic_dipole_moment = 0.0,
0056 G4double curve_length = 0.0,
0057 G4double PDGspin = -1.0 );
0058
0059 G4FieldTrack( char );
0060
0061
0062 G4FieldTrack( const G4ThreeVector& pPosition,
0063 const G4ThreeVector& pMomentumDirection,
0064 G4double curve_length,
0065 G4double kineticEnergy,
0066 const G4double restMass_c2,
0067 G4double velocity,
0068 G4double LaboratoryTimeOfFlight = 0.0,
0069 G4double ProperTimeOfFlight = 0.0,
0070 const G4ThreeVector* pPolarization = nullptr,
0071 G4double PDGspin = -1.0 );
0072
0073
0074
0075 ~G4FieldTrack();
0076
0077
0078 inline G4FieldTrack( const G4FieldTrack& pFieldTrack );
0079 inline G4FieldTrack& operator= ( const G4FieldTrack& rStVec );
0080
0081
0082 inline G4FieldTrack(G4FieldTrack&& from) noexcept ;
0083 inline G4FieldTrack& operator=(G4FieldTrack&& from) noexcept ;
0084
0085
0086 inline void UpdateState( const G4ThreeVector& pPosition,
0087 G4double LaboratoryTimeOfFlight,
0088 const G4ThreeVector& pMomentumDirection,
0089 G4double kineticEnergy);
0090
0091
0092
0093 inline void UpdateFourMomentum( G4double kineticEnergy,
0094 const G4ThreeVector& momentumDirection );
0095
0096
0097 void SetChargeAndMoments(G4double charge,
0098 G4double magnetic_dipole_moment = DBL_MAX,
0099 G4double electric_dipole_moment = DBL_MAX,
0100 G4double magnetic_charge = DBL_MAX );
0101
0102
0103 inline void SetPDGSpin(G4double pdgSpin);
0104 inline G4double GetPDGSpin();
0105
0106 inline G4ThreeVector GetMomentum() const;
0107 inline G4ThreeVector GetPosition() const;
0108 inline const G4ThreeVector& GetMomentumDir() const;
0109 inline G4ThreeVector GetMomentumDirection() const;
0110 inline G4double GetCurveLength() const;
0111
0112
0113 inline G4ThreeVector GetPolarization() const;
0114 inline void SetPolarization( const G4ThreeVector& vecPol );
0115
0116 inline const G4ChargeState* GetChargeState() const;
0117 inline G4double GetLabTimeOfFlight() const;
0118 inline G4double GetProperTimeOfFlight() const;
0119 inline G4double GetKineticEnergy() const;
0120 inline G4double GetCharge() const;
0121 inline G4double GetRestMass() const;
0122
0123
0124 inline void SetPosition(const G4ThreeVector& nPos);
0125 inline void SetMomentum(const G4ThreeVector& nMomDir);
0126
0127
0128 inline void SetMomentumDir(const G4ThreeVector& nMomDir);
0129
0130
0131 inline void SetRestMass(G4double Mass_c2);
0132
0133 inline void SetCurveLength(G4double nCurve_s);
0134
0135 inline void SetKineticEnergy(G4double nEnergy);
0136
0137
0138 inline void SetLabTimeOfFlight(G4double tofLab);
0139 inline void SetProperTimeOfFlight(G4double tofProper);
0140
0141
0142 public:
0143
0144 enum { ncompSVEC = 12 };
0145
0146
0147 inline void DumpToArray(G4double valArr[ncompSVEC]) const;
0148 void LoadFromArray(const G4double valArr[ncompSVEC],
0149 G4int noVarsIntegrated);
0150 friend std::ostream&
0151 operator<<( std::ostream& os, const G4FieldTrack& SixVec);
0152
0153 public:
0154
0155 inline void InitialiseSpin( const G4ThreeVector& vecPolarization );
0156 inline G4ThreeVector GetSpin() const;
0157 inline void SetSpin(const G4ThreeVector& vSpin);
0158
0159 private:
0160
0161 inline G4FieldTrack& SetCurvePnt(const G4ThreeVector& pPosition,
0162 const G4ThreeVector& pMomentum,
0163 G4double s_curve );
0164 private:
0165
0166 G4double SixVector[6];
0167 G4double fDistanceAlongCurve;
0168 G4double fKineticEnergy;
0169 G4double fRestMass_c2;
0170 G4double fLabTimeOfFlight;
0171 G4double fProperTimeOfFlight;
0172 G4ThreeVector fPolarization;
0173 G4ThreeVector fMomentumDir;
0174
0175
0176
0177 G4ChargeState fChargeState;
0178 };
0179
0180 #include "G4FieldTrack.icc"
0181
0182 #endif