| 51 | #include "G4UnitsTable.hh" |
| 52 | |
| 53 | void G4FastStep::Initialize(const G4FastTrack& fastTrack) |
| 54 | { |
| 55 | // keeps the fastTrack reference |
| 56 | fFastTrack = &fastTrack; |
| 57 | |
| 58 | // currentTrack will be used to Initialize the other data members |
| 59 | const G4Track& currentTrack = *(fFastTrack->GetPrimaryTrack()); |
| 60 | |
| 61 | // use base class's method at first |
| 62 | G4VParticleChange::Initialize(currentTrack); |
| 63 | |
| 64 | // set Energy/Momentum etc. equal to those of the parent particle |
| 65 | const G4DynamicParticle* pParticle = currentTrack.GetDynamicParticle(); |
| 66 | theEnergyChange = pParticle->GetKineticEnergy(); |
| 67 | theMomentumChange = pParticle->GetMomentumDirection(); |
| 68 | thePolarizationChange = pParticle->GetPolarization(); |
| 69 | theProperTimeChange = pParticle->GetProperTime(); |
| 70 | |
| 71 | // set Position/Time etc. equal to those of the parent track |
| 72 | thePositionChange = currentTrack.GetPosition(); |
| 73 | theTimeChange = currentTrack.GetGlobalTime(); |
| 74 | |
| 75 | // switch off stepping hit invokation by default: |
| 76 | theSteppingControlFlag = AvoidHitInvocation; |
| 77 | |
| 78 | // event biasing weigth: |
| 79 | theWeightChange = currentTrack.GetWeight(); |
| 80 | } |
| 81 | |
| 82 | //---------------------------------------- |
| 83 | // -- Set the StopAndKilled signal |