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 #include "G4FieldTrack.hh"
00032
00033 std::ostream& operator<<( std::ostream& os, const G4FieldTrack& SixVec)
00034 {
00035 const G4double *SixV = SixVec.SixVector;
00036 os << " ( ";
00037 os << " X= " << SixV[0] << " " << SixV[1] << " "
00038 << SixV[2] << " ";
00039 os << " V= " << SixV[3] << " " << SixV[4] << " "
00040 << SixV[5] << " ";
00041 os << " v2= "
00042 << G4ThreeVector(SixV[3], SixV[4], SixV[5]).mag();
00043 os << " mdm= " << SixVec.fMomentumDir.mag();
00044 os << " l= " << SixVec.GetCurveLength();
00045 os << " ) ";
00046 return os;
00047 }
00048
00049 G4FieldTrack::G4FieldTrack( const G4ThreeVector& pPosition,
00050 G4double LaboratoryTimeOfFlight,
00051 const G4ThreeVector& pMomentumDirection,
00052 G4double kineticEnergy,
00053 G4double restMass_c2,
00054 G4double charge,
00055 const G4ThreeVector& Spin,
00056 G4double magnetic_dipole_moment,
00057 G4double curve_length )
00058 : fDistanceAlongCurve(curve_length),
00059 fKineticEnergy(kineticEnergy),
00060 fRestMass_c2(restMass_c2),
00061 fLabTimeOfFlight(LaboratoryTimeOfFlight),
00062 fProperTimeOfFlight(0.),
00063
00064 fChargeState( charge, magnetic_dipole_moment )
00065 {
00066 UpdateFourMomentum( kineticEnergy, pMomentumDirection );
00067
00068
00069 SetPosition( pPosition );
00070
00071 InitialiseSpin( Spin );
00072 }
00073
00074 G4FieldTrack::G4FieldTrack( const G4ThreeVector& pPosition,
00075 const G4ThreeVector& pMomentumDirection,
00076 G4double curve_length,
00077 G4double kineticEnergy,
00078 const G4double restMass_c2,
00079 G4double,
00080 G4double pLaboratoryTimeOfFlight,
00081 G4double pProperTimeOfFlight,
00082 const G4ThreeVector* pSpin)
00083 : fDistanceAlongCurve(curve_length),
00084 fKineticEnergy(kineticEnergy),
00085 fRestMass_c2(restMass_c2),
00086 fLabTimeOfFlight(pLaboratoryTimeOfFlight),
00087 fProperTimeOfFlight(pProperTimeOfFlight),
00088
00089 fChargeState( DBL_MAX )
00090 {
00091 UpdateFourMomentum( kineticEnergy, pMomentumDirection );
00092
00093
00094 SetPosition( pPosition );
00095
00096 G4ThreeVector Spin(0.0, 0.0, 0.0);
00097 if( pSpin ) Spin= *pSpin;
00098 InitialiseSpin( Spin );
00099 }
00100
00101 G4FieldTrack::G4FieldTrack( char )
00102 : fKineticEnergy(0.), fRestMass_c2(0.), fLabTimeOfFlight(0.),
00103 fProperTimeOfFlight(0.), fChargeState( DBL_MAX )
00104 {
00105 G4ThreeVector Zero(0.0, 0.0, 0.0);
00106 SetCurvePnt( Zero, Zero, 0.0 );
00107 InitialiseSpin( Zero );
00108
00109
00110 }
00111
00112 void G4FieldTrack::
00113 SetChargeAndMoments(G4double charge,
00114 G4double magnetic_dipole_moment,
00115 G4double electric_dipole_moment,
00116 G4double magnetic_charge )
00117 {
00118 fChargeState.SetChargeAndMoments( charge, magnetic_dipole_moment,
00119 electric_dipole_moment, magnetic_charge );
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130 }