#include <G4FieldTrack.hh>
Public Types | |
ncompSVEC = 12 | |
enum | { ncompSVEC = 12 } |
Public Member Functions | |
G4FieldTrack (const G4ThreeVector &pPosition, G4double LaboratoryTimeOfFlight, const G4ThreeVector &pMomentumDirection, G4double kineticEnergy, G4double restMass_c2, G4double charge, const G4ThreeVector &pSpin, G4double magnetic_dipole_moment=0.0, G4double curve_length=0.0) | |
G4FieldTrack (const G4FieldTrack &pFieldTrack) | |
G4FieldTrack (char) | |
~G4FieldTrack () | |
void | UpdateState (const G4ThreeVector &pPosition, G4double LaboratoryTimeOfFlight, const G4ThreeVector &pMomentumDirection, G4double kineticEnergy) |
void | UpdateFourMomentum (G4double kineticEnergy, const G4ThreeVector &momentumDirection) |
void | SetChargeAndMoments (G4double charge, G4double magnetic_dipole_moment=DBL_MAX, G4double electric_dipole_moment=DBL_MAX, G4double magnetic_charge=DBL_MAX) |
G4FieldTrack (const G4ThreeVector &pPosition, const G4ThreeVector &pMomentumDirection, G4double curve_length, G4double kineticEnergy, const G4double restMass_c2, G4double velocity, G4double LaboratoryTimeOfFlight=0.0, G4double ProperTimeOfFlight=0.0, const G4ThreeVector *pSpin=0) | |
G4FieldTrack & | operator= (const G4FieldTrack &rStVec) |
G4ThreeVector | GetMomentum () const |
G4ThreeVector | GetPosition () const |
const G4ThreeVector & | GetMomentumDir () const |
G4ThreeVector | GetMomentumDirection () const |
G4double | GetCurveLength () const |
G4ThreeVector | GetSpin () const |
G4double | GetLabTimeOfFlight () const |
G4double | GetProperTimeOfFlight () const |
G4double | GetKineticEnergy () const |
G4double | GetCharge () const |
void | SetPosition (G4ThreeVector nPos) |
void | SetMomentum (G4ThreeVector nMomDir) |
void | SetMomentumDir (G4ThreeVector nMomDir) |
void | SetRestMass (G4double Mass_c2) |
void | SetCurveLength (G4double nCurve_s) |
void | SetKineticEnergy (G4double nEnergy) |
void | SetSpin (G4ThreeVector nSpin) |
void | SetLabTimeOfFlight (G4double nTOF) |
void | SetProperTimeOfFlight (G4double nTOF) |
void | InitialiseSpin (const G4ThreeVector &Spin) |
void | DumpToArray (G4double valArr[ncompSVEC]) const |
void | LoadFromArray (const G4double valArr[ncompSVEC], G4int noVarsIntegrated) |
const G4ChargeState * | GetChargeState () const |
Friends | |
std::ostream & | operator<< (std::ostream &os, const G4FieldTrack &SixVec) |
Data Structures | |
class | G4ChargeState |
Definition at line 53 of file G4FieldTrack.hh.
anonymous enum |
G4FieldTrack::G4FieldTrack | ( | const G4ThreeVector & | pPosition, | |
G4double | LaboratoryTimeOfFlight, | |||
const G4ThreeVector & | pMomentumDirection, | |||
G4double | kineticEnergy, | |||
G4double | restMass_c2, | |||
G4double | charge, | |||
const G4ThreeVector & | pSpin, | |||
G4double | magnetic_dipole_moment = 0.0 , |
|||
G4double | curve_length = 0.0 | |||
) |
Definition at line 49 of file G4FieldTrack.cc.
References InitialiseSpin(), SetPosition(), and UpdateFourMomentum().
00058 : fDistanceAlongCurve(curve_length), 00059 fKineticEnergy(kineticEnergy), 00060 fRestMass_c2(restMass_c2), 00061 fLabTimeOfFlight(LaboratoryTimeOfFlight), 00062 fProperTimeOfFlight(0.), 00063 // fMomentumDir(pMomentumDirection), 00064 fChargeState( charge, magnetic_dipole_moment ) 00065 { 00066 UpdateFourMomentum( kineticEnergy, pMomentumDirection ); 00067 // Sets momentum direction as well. 00068 00069 SetPosition( pPosition ); 00070 00071 InitialiseSpin( Spin ); 00072 }
G4FieldTrack::G4FieldTrack | ( | const G4FieldTrack & | pFieldTrack | ) | [inline] |
Definition at line 93 of file G4FieldTrack.icc.
References SixVector.
00094 : fDistanceAlongCurve( rStVec.fDistanceAlongCurve), 00095 fKineticEnergy( rStVec.fKineticEnergy ), 00096 fRestMass_c2( rStVec.fRestMass_c2), 00097 fLabTimeOfFlight( rStVec.fLabTimeOfFlight ), 00098 fProperTimeOfFlight( rStVec.fProperTimeOfFlight ), 00099 // fMomentumModulus( rStVec.fMomentumModulus ), 00100 fSpin( rStVec.fSpin ), 00101 fMomentumDir( rStVec.fMomentumDir ), 00102 fChargeState( rStVec.fChargeState ) 00103 { 00104 SixVector[0]= rStVec.SixVector[0]; 00105 SixVector[1]= rStVec.SixVector[1]; 00106 SixVector[2]= rStVec.SixVector[2]; 00107 SixVector[3]= rStVec.SixVector[3]; 00108 SixVector[4]= rStVec.SixVector[4]; 00109 SixVector[5]= rStVec.SixVector[5]; 00110 00111 // fpChargeState= new G4ChargeState( *rStVec.fpChargeState ); 00112 // Can share charge state only when using handles etc 00113 // fpChargeState = rStVec.fpChargeState; 00114 }
G4FieldTrack::G4FieldTrack | ( | char | ) |
Definition at line 101 of file G4FieldTrack.cc.
References InitialiseSpin().
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 // fInitialMomentumMag= 0.00; // Invalid 00109 // fLastMomentumMag= 0.0; 00110 }
G4FieldTrack::~G4FieldTrack | ( | ) | [inline] |
G4FieldTrack::G4FieldTrack | ( | const G4ThreeVector & | pPosition, | |
const G4ThreeVector & | pMomentumDirection, | |||
G4double | curve_length, | |||
G4double | kineticEnergy, | |||
const G4double | restMass_c2, | |||
G4double | velocity, | |||
G4double | LaboratoryTimeOfFlight = 0.0 , |
|||
G4double | ProperTimeOfFlight = 0.0 , |
|||
const G4ThreeVector * | pSpin = 0 | |||
) |
Definition at line 74 of file G4FieldTrack.cc.
References InitialiseSpin(), SetPosition(), and UpdateFourMomentum().
00083 : fDistanceAlongCurve(curve_length), 00084 fKineticEnergy(kineticEnergy), 00085 fRestMass_c2(restMass_c2), 00086 fLabTimeOfFlight(pLaboratoryTimeOfFlight), 00087 fProperTimeOfFlight(pProperTimeOfFlight), 00088 // fMomentumDir(pMomentumDirection), 00089 fChargeState( DBL_MAX ) // charge not set 00090 { 00091 UpdateFourMomentum( kineticEnergy, pMomentumDirection ); 00092 // Sets momentum direction as well. 00093 00094 SetPosition( pPosition ); 00095 00096 G4ThreeVector Spin(0.0, 0.0, 0.0); 00097 if( pSpin ) Spin= *pSpin; 00098 InitialiseSpin( Spin ); 00099 }
void G4FieldTrack::DumpToArray | ( | G4double | valArr[ncompSVEC] | ) | const [inline] |
Definition at line 264 of file G4FieldTrack.icc.
Referenced by G4MagInt_Driver::AccurateAdvance(), G4MagInt_Driver::GetDerivatives(), and G4MagInt_Driver::QuickAdvance().
00265 { 00266 valArr[0]=SixVector[0]; 00267 valArr[1]=SixVector[1]; 00268 valArr[2]=SixVector[2]; 00269 valArr[3]=SixVector[3]; 00270 valArr[4]=SixVector[4]; 00271 valArr[5]=SixVector[5]; 00272 00273 G4ThreeVector Momentum(valArr[3],valArr[4],valArr[5]); 00274 00275 // G4double mass_in_Kg; 00276 // mass_in_Kg = fEnergy / velocity_mag_sq * (1-velocity_mag_sq/c_squared); 00277 // valArr[6]= mass_in_Kg; 00278 00279 // The following components may or may not be integrated. 00280 valArr[6]= fKineticEnergy; 00281 00282 // valArr[6]=fEnergy; // When it is integrated over, do this ... 00283 valArr[7]=fLabTimeOfFlight; 00284 valArr[8]=fProperTimeOfFlight; 00285 valArr[9]=fSpin.x(); 00286 valArr[10]=fSpin.y(); 00287 valArr[11]=fSpin.z(); 00288 // valArr[13]=fMomentumDir.x(); 00289 // valArr[14]=fMomentumDir.y(); 00290 // valArr[15]=fMomentumDir.z(); 00291 // valArr[]=fDistanceAlongCurve; 00292 }
G4double G4FieldTrack::GetCharge | ( | ) | const [inline] |
const G4ChargeState* G4FieldTrack::GetChargeState | ( | ) | const [inline] |
G4double G4FieldTrack::GetCurveLength | ( | ) | const [inline] |
Definition at line 172 of file G4FieldTrack.icc.
Referenced by G4MagInt_Driver::AccurateAdvance(), G4ChordFinder::AdvanceChordLimited(), G4ChordFinder::ApproxCurvePointS(), G4ChordFinder::ApproxCurvePointV(), G4PropagatorInField::ComputeStep(), G4SimpleLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), G4BrentLocator::EstimateIntersectionPoint(), operator<<(), operator=(), G4MagInt_Driver::PrintStat_Aux(), G4VIntersectionLocator::printStatus(), G4PropagatorInField::printStatus(), G4MagInt_Driver::PrintStatus(), G4MagInt_Driver::QuickAdvance(), and G4VIntersectionLocator::ReEstimateEndpoint().
G4double G4FieldTrack::GetKineticEnergy | ( | ) | const [inline] |
Definition at line 184 of file G4FieldTrack.icc.
Referenced by G4Transportation::AlongStepGetPhysicalInteractionLength(), G4CoupledTransportation::AlongStepGetPhysicalInteractionLength(), and G4MagInt_Driver::PrintStat_Aux().
G4double G4FieldTrack::GetLabTimeOfFlight | ( | ) | const [inline] |
Definition at line 208 of file G4FieldTrack.icc.
Referenced by G4Transportation::AlongStepGetPhysicalInteractionLength(), G4CoupledTransportation::AlongStepGetPhysicalInteractionLength(), and operator=().
G4ThreeVector G4FieldTrack::GetMomentum | ( | ) | const [inline] |
Definition at line 238 of file G4FieldTrack.icc.
Referenced by G4VIntersectionLocator::printStatus(), and G4PropagatorInField::printStatus().
00239 { 00240 return G4ThreeVector( SixVector[3], SixVector[4], SixVector[5] ); 00241 }
const G4ThreeVector & G4FieldTrack::GetMomentumDir | ( | ) | const [inline] |
Definition at line 158 of file G4FieldTrack.icc.
Referenced by G4Transportation::AlongStepGetPhysicalInteractionLength(), G4CoupledTransportation::AlongStepGetPhysicalInteractionLength(), G4PropagatorInField::ComputeStep(), G4PropagatorInField::EndMomentumDir(), G4SimpleLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), G4BrentLocator::EstimateIntersectionPoint(), G4MagInt_Driver::PrintStat_Aux(), G4VIntersectionLocator::printStatus(), G4PropagatorInField::printStatus(), and G4MagInt_Driver::PrintStatus().
00159 { 00160 // G4ThreeVector myMomentum( SixVector[3], SixVector[4], SixVector[5] ); 00161 // return myVelocity; 00162 return fMomentumDir; 00163 }
G4ThreeVector G4FieldTrack::GetMomentumDirection | ( | ) | const [inline] |
Definition at line 166 of file G4FieldTrack.icc.
Referenced by G4PathFinder::ComputeStep(), G4PathFinder::DoNextLinearStep(), G4SimpleLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), and G4BrentLocator::EstimateIntersectionPoint().
G4ThreeVector G4FieldTrack::GetPosition | ( | ) | const [inline] |
Definition at line 143 of file G4FieldTrack.icc.
Referenced by G4Transportation::AlongStepGetPhysicalInteractionLength(), G4CoupledTransportation::AlongStepGetPhysicalInteractionLength(), G4ChordFinder::ApproxCurvePointS(), G4ChordFinder::ApproxCurvePointV(), G4PropagatorInField::ComputeStep(), G4PathFinder::ComputeStep(), G4PathFinder::DoNextCurvedStep(), G4PathFinder::DoNextLinearStep(), G4PropagatorInField::EndPosition(), G4SimpleLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), G4BrentLocator::EstimateIntersectionPoint(), G4ChordFinderSaf::FindNextChord(), G4PathFinder::Locate(), G4MagInt_Driver::PrintStat_Aux(), G4VIntersectionLocator::printStatus(), G4PropagatorInField::printStatus(), G4MagInt_Driver::PrintStatus(), G4MagInt_Driver::QuickAdvance(), G4VIntersectionLocator::ReEstimateEndpoint(), and G4PathFinder::ReLocate().
00144 { 00145 G4ThreeVector myPosition( SixVector[0], SixVector[1], SixVector[2] ); 00146 return myPosition; 00147 }
G4double G4FieldTrack::GetProperTimeOfFlight | ( | ) | const [inline] |
G4ThreeVector G4FieldTrack::GetSpin | ( | ) | const [inline] |
Definition at line 196 of file G4FieldTrack.icc.
Referenced by G4Transportation::AlongStepGetPhysicalInteractionLength(), G4CoupledTransportation::AlongStepGetPhysicalInteractionLength(), and operator=().
void G4FieldTrack::InitialiseSpin | ( | const G4ThreeVector & | Spin | ) | [inline] |
Definition at line 69 of file G4FieldTrack.icc.
Referenced by G4FieldTrack().
00070 { 00071 // static G4ThreeVector ZeroVec(0.0, 0.0, 0.0); 00072 00073 fSpin = Spin; 00074 // New Member ?? G4bool fHasSpin; 00075 // fHasSpin = (fSpin != ZeroVec); 00076 }
void G4FieldTrack::LoadFromArray | ( | const G4double | valArr[ncompSVEC], | |
G4int | noVarsIntegrated | |||
) | [inline] |
Definition at line 299 of file G4FieldTrack.icc.
Referenced by G4MagInt_Driver::AccurateAdvance(), G4MagInt_Driver::PrintStatus(), and G4MagInt_Driver::QuickAdvance().
00300 { 00301 G4int i; 00302 00303 // Fill the variables not integrated with zero -- so it's clear !! 00304 static G4double valArr[ncompSVEC]; 00305 for( i=0; i<noVarsIntegrated; i++){ 00306 valArr[i]= valArrIn[i]; 00307 } 00308 for( i=noVarsIntegrated; i<ncompSVEC; i++) { 00309 valArr[i]= 0.0; 00310 } 00311 00312 SixVector[0]=valArr[0]; 00313 SixVector[1]=valArr[1]; 00314 SixVector[2]=valArr[2]; 00315 SixVector[3]=valArr[3]; 00316 SixVector[4]=valArr[4]; 00317 SixVector[5]=valArr[5]; 00318 00319 G4ThreeVector Momentum(valArr[3],valArr[4],valArr[5]); 00320 00321 G4double momentum_square= Momentum.mag2(); 00322 fMomentumDir= Momentum.unit(); 00323 00324 fKineticEnergy = momentum_square / 00325 (std::sqrt(momentum_square+fRestMass_c2*fRestMass_c2) 00326 + fRestMass_c2 ); 00327 // The above equation is stable for small and large momenta 00328 00329 // The following components may or may not be 00330 // integrated over -- integration is optional 00331 // fKineticEnergy= valArr[6]; 00332 00333 fLabTimeOfFlight=valArr[7]; 00334 fProperTimeOfFlight=valArr[8]; 00335 fSpin=G4ThreeVector(valArr[9],valArr[10],valArr[11]); 00336 // fMomentumDir=G4ThreeVector(valArr[13],valArr[14],valArr[15]); 00337 // fDistanceAlongCurve= valArr[]; 00338 }
G4FieldTrack & G4FieldTrack::operator= | ( | const G4FieldTrack & | rStVec | ) | [inline] |
Definition at line 341 of file G4FieldTrack.icc.
References fChargeState, fKineticEnergy, fMomentumDir, GetCurveLength(), GetLabTimeOfFlight(), GetProperTimeOfFlight(), GetSpin(), SetCurveLength(), SetLabTimeOfFlight(), SetProperTimeOfFlight(), SetSpin(), and SixVector.
00342 { 00343 if (&rStVec == this) return *this; 00344 00345 SixVector[0]= rStVec.SixVector[0]; 00346 SixVector[1]= rStVec.SixVector[1]; 00347 SixVector[2]= rStVec.SixVector[2]; 00348 SixVector[3]= rStVec.SixVector[3]; 00349 SixVector[4]= rStVec.SixVector[4]; 00350 SixVector[5]= rStVec.SixVector[5]; 00351 SetCurveLength( rStVec.GetCurveLength() ); 00352 00353 fKineticEnergy= rStVec.fKineticEnergy; 00354 SetLabTimeOfFlight( rStVec.GetLabTimeOfFlight() ); 00355 SetProperTimeOfFlight( rStVec.GetProperTimeOfFlight() ); 00356 SetSpin( rStVec.GetSpin() ); 00357 fMomentumDir= rStVec.fMomentumDir; 00358 00359 fChargeState= rStVec.fChargeState; 00360 // (*fpChargeState)= *(rStVec.fpChargeState); 00361 // fpChargeState= rStVec.fpChargeState; // Handles!! 00362 return *this; 00363 }
void G4FieldTrack::SetChargeAndMoments | ( | G4double | charge, | |
G4double | magnetic_dipole_moment = DBL_MAX , |
|||
G4double | electric_dipole_moment = DBL_MAX , |
|||
G4double | magnetic_charge = DBL_MAX | |||
) |
Definition at line 113 of file G4FieldTrack.cc.
Referenced by G4CoupledTransportation::AlongStepGetPhysicalInteractionLength(), and G4FieldTrackUpdator::Update().
00117 { 00118 fChargeState.SetChargeAndMoments( charge, magnetic_dipole_moment, 00119 electric_dipole_moment, magnetic_charge ); 00120 00121 // fpChargeState->SetChargeAndMoments( charge, magnetic_dipole_moment, 00122 // electric_dipole_moment, magnetic_charge ); 00123 00124 // TO-DO: Improve the implementation using handles 00125 // -- and handle to the old one (which can be shared by other copies) and 00126 // must not be left to hang loose 00127 // 00128 // fpChargeState= new G4ChargeState( charge, magnetic_dipole_moment, 00129 // electric_dipole_moment, magnetic_charge ); 00130 }
void G4FieldTrack::SetCurveLength | ( | G4double | nCurve_s | ) | [inline] |
Definition at line 178 of file G4FieldTrack.icc.
Referenced by G4MagInt_Driver::AccurateAdvance(), operator=(), G4MagInt_Driver::PrintStatus(), and G4MagInt_Driver::QuickAdvance().
void G4FieldTrack::SetKineticEnergy | ( | G4double | nEnergy | ) | [inline] |
void G4FieldTrack::SetLabTimeOfFlight | ( | G4double | nTOF | ) | [inline] |
void G4FieldTrack::SetMomentum | ( | G4ThreeVector | nMomDir | ) | [inline] |
Definition at line 244 of file G4FieldTrack.icc.
00245 { 00246 SixVector[3] = pMomentum.x(); 00247 SixVector[4] = pMomentum.y(); 00248 SixVector[5] = pMomentum.z(); 00249 00250 fMomentumDir = pMomentum.unit(); 00251 }
void G4FieldTrack::SetMomentumDir | ( | G4ThreeVector | nMomDir | ) | [inline] |
void G4FieldTrack::SetPosition | ( | G4ThreeVector | nPos | ) | [inline] |
Definition at line 150 of file G4FieldTrack.icc.
Referenced by G4PathFinder::DoNextLinearStep(), G4SimpleLocator::EstimateIntersectionPoint(), G4MultiLevelLocator::EstimateIntersectionPoint(), G4BrentLocator::EstimateIntersectionPoint(), G4FieldTrack(), and UpdateState().
00151 { 00152 SixVector[0] = pPosition.x(); 00153 SixVector[1] = pPosition.y(); 00154 SixVector[2] = pPosition.z(); 00155 }
void G4FieldTrack::SetProperTimeOfFlight | ( | G4double | nTOF | ) | [inline] |
Definition at line 226 of file G4FieldTrack.icc.
Referenced by G4PathFinder::DoNextLinearStep(), and operator=().
void G4FieldTrack::SetRestMass | ( | G4double | Mass_c2 | ) | [inline] |
void G4FieldTrack::SetSpin | ( | G4ThreeVector | nSpin | ) | [inline] |
Definition at line 202 of file G4FieldTrack.icc.
Referenced by operator=(), and G4FieldTrackUpdator::Update().
void G4FieldTrack::UpdateFourMomentum | ( | G4double | kineticEnergy, | |
const G4ThreeVector & | momentumDirection | |||
) | [inline] |
Definition at line 366 of file G4FieldTrack.icc.
Referenced by G4FieldTrack(), and UpdateState().
00368 { 00369 G4double momentum_mag = std::sqrt(kineticEnergy*kineticEnergy 00370 +2.0*fRestMass_c2*kineticEnergy); 00371 G4ThreeVector momentumVector= momentum_mag * momentumDirection; 00372 00373 // SetMomentum( momentumVector ); // Set direction (from unit): used sqrt, div 00374 SixVector[3] = momentumVector.x(); 00375 SixVector[4] = momentumVector.y(); 00376 SixVector[5] = momentumVector.z(); 00377 00378 fMomentumDir= momentumDirection; // Set directly to avoid inaccuracy. 00379 fKineticEnergy= kineticEnergy; 00380 }
void G4FieldTrack::UpdateState | ( | const G4ThreeVector & | pPosition, | |
G4double | LaboratoryTimeOfFlight, | |||
const G4ThreeVector & | pMomentumDirection, | |||
G4double | kineticEnergy | |||
) | [inline] |
Definition at line 382 of file G4FieldTrack.icc.
References SetPosition(), and UpdateFourMomentum().
Referenced by G4FieldTrackUpdator::Update().
00387 { 00388 // SetCurvePnt( position, momentumVector, s_curve=0.0); 00389 SetPosition( position); 00390 fLabTimeOfFlight= laboratoryTimeOfFlight; 00391 fDistanceAlongCurve= 0.0; 00392 00393 UpdateFourMomentum( kineticEnergy, momentumDirection); 00394 }
std::ostream& operator<< | ( | std::ostream & | os, | |
const G4FieldTrack & | SixVec | |||
) | [friend] |
Definition at line 33 of file G4FieldTrack.cc.
00034 { 00035 const G4double *SixV = SixVec.SixVector; 00036 os << " ( "; 00037 os << " X= " << SixV[0] << " " << SixV[1] << " " 00038 << SixV[2] << " "; // Position 00039 os << " V= " << SixV[3] << " " << SixV[4] << " " 00040 << SixV[5] << " "; // Momentum 00041 os << " v2= " 00042 << G4ThreeVector(SixV[3], SixV[4], SixV[5]).mag(); // mom magnitude 00043 os << " mdm= " << SixVec.fMomentumDir.mag(); 00044 os << " l= " << SixVec.GetCurveLength(); 00045 os << " ) "; 00046 return os; 00047 }