Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4FieldTrackUpdator Class Reference

#include <G4FieldTrackUpdator.hh>

Static Public Member Functions

static G4FieldTrackCreateFieldTrack (const G4Track *)
 
static void Update (G4FieldTrack *, const G4Track *)
 

Detailed Description

Definition at line 43 of file G4FieldTrackUpdator.hh.

Member Function Documentation

G4FieldTrack * G4FieldTrackUpdator::CreateFieldTrack ( const G4Track trk)
static

Definition at line 45 of file G4FieldTrackUpdator.cc.

46 {
47  G4FieldTrack* ftrk = new G4FieldTrack(
48  trk->GetPosition(),
49  trk->GetGlobalTime(),
50  trk->GetMomentumDirection(),
51  trk->GetKineticEnergy(),
52  trk->GetDynamicParticle()->GetMass(),
53  trk->GetDynamicParticle()->GetCharge(),
55  0.0 // magnetic dipole moment to be implemented
56  );
57  return ftrk;
58 }
const G4DynamicParticle * GetDynamicParticle() const
const G4ThreeVector & GetPosition() const
G4double GetKineticEnergy() const
G4double GetMass() const
G4double GetCharge() const
G4double GetGlobalTime() const
const G4ThreeVector & GetMomentumDirection() const
const G4ThreeVector & GetPolarization() const

Here is the call graph for this function:

void G4FieldTrackUpdator::Update ( G4FieldTrack ftrk,
const G4Track trk 
)
static

Definition at line 60 of file G4FieldTrackUpdator.cc.

61 {
62  const G4DynamicParticle* ptDynamicParticle= trk->GetDynamicParticle();
63 
64  // The following properties must be updated 1) for each new track, and
65  ftrk->SetRestMass(ptDynamicParticle->GetMass());
66  // 2) Since ion can lose/gain electrons, this must be done at every step
67 
68  ftrk->UpdateState(
69  trk->GetPosition(),
70  trk->GetGlobalTime(),
71  trk->GetMomentumDirection(),
72  trk->GetKineticEnergy()
73  );
74 
75 #ifdef G4CHECK
76  if( ( trk->GetMomentum() - ftrk->GetMomentum()).mag2() > 1.e-16 * trk->GetMomentum().mag2() ){
77  G4cerr << "ERROR> G4FieldTrackUpdator sees *Disagreement* in momentum " << G4endl;
78  G4cout << " FTupdator: Tracking Momentum= " << trk->GetMomentum() << G4endl;
79  G4cout << " FTupdator: FldTrack Momentum= " << ftrk->GetMomentum() << G4endl;
80  G4cout << " FTupdator: FldTrack-Tracking= " << ftrk->GetMomentum() - trk->GetMomentum() << G4endl;
81  }
82 #endif
83 
85 
86  ftrk->SetChargeAndMoments( ptDynamicParticle->GetCharge(),
87  ptDynamicParticle->GetMagneticMoment());
88  ftrk->SetPDGSpin( ptDynamicParticle->GetParticleDefinition()->GetPDGSpin() );
89  // The charge can change during tracking
90  ftrk->SetSpin( ptDynamicParticle->GetPolarization() );
91 }
G4double GetProperTime() const
const G4DynamicParticle * GetDynamicParticle() const
const G4ThreeVector & GetPosition() const
void SetRestMass(G4double Mass_c2)
void SetSpin(G4ThreeVector vSpin)
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
G4double GetMass() const
G4double GetCharge() const
const G4ParticleDefinition * GetParticleDefinition() const
G4double GetGlobalTime() const
G4ThreeVector GetMomentum() const
const G4ThreeVector & GetMomentumDirection() const
const G4ThreeVector & GetPolarization() const
double mag2() const
G4double GetPDGSpin() const
#define G4endl
Definition: G4ios.hh:61
G4ThreeVector GetMomentum() const
void SetPDGSpin(G4double pdgSpin)
Definition: G4FieldTrack.hh:93
void SetChargeAndMoments(G4double charge, G4double magnetic_dipole_moment=DBL_MAX, G4double electric_dipole_moment=DBL_MAX, G4double magnetic_charge=DBL_MAX)
G4double GetMagneticMoment() const
G4GLOB_DLL std::ostream G4cerr
void UpdateState(const G4ThreeVector &pPosition, G4double LaboratoryTimeOfFlight, const G4ThreeVector &pMomentumDirection, G4double kineticEnergy)
void SetProperTimeOfFlight(G4double tofProper)

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: