00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #ifndef G4FieldTrack_HH
00049 #define G4FieldTrack_HH
00050
00051 #include "G4ThreeVector.hh"
00052
00053 class G4FieldTrack
00054 {
00055 public:
00056
00057 G4FieldTrack( const G4ThreeVector& pPosition,
00058 G4double LaboratoryTimeOfFlight,
00059 const G4ThreeVector& pMomentumDirection,
00060 G4double kineticEnergy,
00061 G4double restMass_c2,
00062 G4double charge,
00063 const G4ThreeVector& pSpin,
00064 G4double magnetic_dipole_moment= 0.0,
00065 G4double curve_length= 0.0
00066 );
00067 G4FieldTrack( const G4FieldTrack& pFieldTrack );
00068 G4FieldTrack( char );
00069
00070 ~G4FieldTrack();
00071
00072
00073 inline void
00074 UpdateState( const G4ThreeVector& pPosition,
00075 G4double LaboratoryTimeOfFlight,
00076 const G4ThreeVector& pMomentumDirection,
00077 G4double kineticEnergy);
00078
00079
00080 inline
00081 void UpdateFourMomentum( G4double kineticEnergy,
00082 const G4ThreeVector& momentumDirection );
00083
00084
00085 void SetChargeAndMoments(G4double charge,
00086 G4double magnetic_dipole_moment= DBL_MAX,
00087 G4double electric_dipole_moment= DBL_MAX,
00088 G4double magnetic_charge=DBL_MAX );
00089
00090
00091 G4FieldTrack( const G4ThreeVector& pPosition,
00092 const G4ThreeVector& pMomentumDirection,
00093 G4double curve_length,
00094 G4double kineticEnergy,
00095 const G4double restMass_c2,
00096 G4double velocity,
00097 G4double LaboratoryTimeOfFlight=0.0,
00098 G4double ProperTimeOfFlight=0.0,
00099 const G4ThreeVector* pSpin=0);
00100
00101
00102
00103 inline G4FieldTrack& operator = ( const G4FieldTrack & rStVec );
00104
00105
00106 inline G4ThreeVector GetMomentum() const;
00107 inline G4ThreeVector GetPosition() const;
00108 inline const G4ThreeVector& GetMomentumDir() const;
00109 inline G4ThreeVector GetMomentumDirection() const;
00110 inline G4double GetCurveLength() const;
00111
00112
00113 inline G4ThreeVector GetSpin() const;
00114 inline G4double GetLabTimeOfFlight() const;
00115 inline G4double GetProperTimeOfFlight() const;
00116 inline G4double GetKineticEnergy() const;
00117 inline G4double GetCharge() const;
00118
00119
00120 inline void SetPosition(G4ThreeVector nPos);
00121 inline void SetMomentum(G4ThreeVector nMomDir);
00122
00123
00124 inline void SetMomentumDir(G4ThreeVector nMomDir);
00125
00126
00127 inline void SetRestMass(G4double Mass_c2) { fRestMass_c2= Mass_c2; }
00128
00129 inline void SetCurveLength(G4double nCurve_s);
00130
00131 inline void SetKineticEnergy(G4double nEnergy);
00132
00133
00134 inline void SetSpin(G4ThreeVector nSpin);
00135 inline void SetLabTimeOfFlight(G4double nTOF);
00136 inline void SetProperTimeOfFlight(G4double nTOF);
00137
00138
00139 public:
00140 inline void InitialiseSpin( const G4ThreeVector& Spin );
00141
00142
00143 enum { ncompSVEC = 12 };
00144
00145
00146 inline void DumpToArray(G4double valArr[ncompSVEC]) const;
00147 inline void LoadFromArray(const G4double valArr[ncompSVEC],
00148 G4int noVarsIntegrated);
00149 friend std::ostream&
00150 operator<<( std::ostream& os, const G4FieldTrack& SixVec);
00151
00152 private:
00153 inline G4FieldTrack& SetCurvePnt(const G4ThreeVector& pPosition,
00154 const G4ThreeVector& pMomentum,
00155 G4double s_curve );
00156 private:
00157 G4double SixVector[6];
00158 G4double fDistanceAlongCurve;
00159 G4double fKineticEnergy;
00160 G4double fRestMass_c2;
00161 G4double fLabTimeOfFlight;
00162 G4double fProperTimeOfFlight;
00163 G4ThreeVector fSpin;
00164 G4ThreeVector fMomentumDir;
00165
00166
00167
00168 private:
00169
00170 class G4ChargeState
00171 {
00172 public:
00173
00174 inline G4ChargeState(G4double charge,
00175 G4double magnetic_dipole_moment= 0.0,
00176 G4double electric_dipole_moment= 0.0,
00177 G4double magnetic_charge= 0.0);
00178 inline G4ChargeState( const G4ChargeState& right );
00179 inline G4ChargeState& operator = ( const G4ChargeState& right );
00180
00181 inline void SetCharge(G4double charge){ fCharge= charge; }
00182
00183
00184
00185
00186 void SetChargeAndMoments(G4double charge,
00187 G4double magnetic_dipole_moment= DBL_MAX,
00188 G4double electric_dipole_moment= DBL_MAX,
00189 G4double magnetic_charge=DBL_MAX );
00190
00191
00192 G4double GetCharge() const { return fCharge; }
00193 G4double GetMagneticDipoleMoment() const { return fMagn_dipole; }
00194 G4double ElectricDipoleMoment() const { return fElec_dipole; }
00195 G4double MagneticCharge() const { return fMagneticCharge; }
00196
00197 private:
00198
00199 G4double fCharge;
00200 G4double fMagn_dipole;
00201 G4double fElec_dipole;
00202 G4double fMagneticCharge;
00203 };
00204
00205 G4ChargeState fChargeState;
00206
00207 public:
00208
00209 const G4ChargeState* GetChargeState() const { return &fChargeState; }
00210 };
00211
00212 #include "G4FieldTrack.icc"
00213
00214 #endif