Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // G4ParticleChangeForLoss 27 // 28 // Class description: 29 // 30 // Concrete class for ParticleChange for Energ 31 32 // Author: Hisaya Kurashige, 23 March 1998 33 // Revision: Vladimir Ivantchenko, 16 January 34 // 24 August 2 35 // ------------------------------------------- 36 #ifndef G4ParticleChangeForLoss_hh 37 #define G4ParticleChangeForLoss_hh 1 38 39 #include "G4VParticleChange.hh" 40 #include "G4DynamicParticle.hh" 41 42 class G4ParticleChangeForLoss final : public G 43 { 44 public: 45 46 G4ParticleChangeForLoss(); 47 48 ~G4ParticleChangeForLoss() override = defaul 49 50 G4ParticleChangeForLoss(const G4ParticleChan 51 G4ParticleChangeForLoss& operator=(const G4P 52 53 // --- the following methods are for updatin 54 55 G4Step* UpdateStepForAlongStep(G4Step* step) 56 G4Step* UpdateStepForPostStep(G4Step* step) 57 58 // Initialize all used properties 59 inline void InitializeForAlongStep(const G4T 60 inline void InitializeForPostStep(const G4Tr 61 62 // Get/Set dynamic charge 63 inline G4double GetProposedCharge() const; 64 inline void SetProposedCharge(G4double theCh 65 66 // Get/Set the final kinetic energy of the c 67 inline G4double GetProposedKineticEnergy() c 68 inline void SetProposedKineticEnergy(G4doubl 69 70 // Get/Propose the MomentumDirection vector: 71 // direction 72 inline const G4ThreeVector& GetProposedMomen 73 inline void SetProposedMomentumDirection(con 74 inline void ProposeMomentumDirection(const G 75 76 inline const G4ThreeVector& GetProposedPolar 77 inline void ProposePolarization(const G4Thre 78 inline void ProposePolarization(G4double Px, 79 80 void DumpInfo() const final; 81 82 private: 83 84 G4double proposedKinEnergy = 0.0; 85 // The final kinetic energy of the current p 86 87 G4double currentCharge = 0.0; 88 // The final charge of the current parti 89 90 G4ThreeVector proposedMomentumDirection; 91 // The final momentum direction of the curre 92 93 G4ThreeVector proposedPolarization; 94 // The final polarization of the current par 95 }; 96 97 // ---------------------- 98 // Inline methods 99 // ---------------------- 100 101 inline 102 G4double G4ParticleChangeForLoss::GetProposedK 103 { 104 return proposedKinEnergy; 105 } 106 107 inline 108 void G4ParticleChangeForLoss::SetProposedKinet 109 { 110 proposedKinEnergy = energy; 111 } 112 113 inline G4double G4ParticleChangeForLoss::GetPr 114 { 115 return currentCharge; 116 } 117 118 inline 119 void G4ParticleChangeForLoss::SetProposedCharg 120 { 121 currentCharge = theCharge; 122 } 123 124 inline 125 const G4ThreeVector& 126 G4ParticleChangeForLoss::GetProposedMomentumDi 127 { 128 return proposedMomentumDirection; 129 } 130 131 inline 132 void G4ParticleChangeForLoss::ProposeMomentumD 133 { 134 proposedMomentumDirection = dir; 135 } 136 137 inline 138 void 139 G4ParticleChangeForLoss::SetProposedMomentumDi 140 { 141 proposedMomentumDirection = dir; 142 } 143 144 inline 145 const G4ThreeVector& G4ParticleChangeForLoss:: 146 { 147 return proposedPolarization; 148 } 149 150 inline 151 void G4ParticleChangeForLoss::ProposePolarizat 152 { 153 proposedPolarization = dir; 154 } 155 156 inline void G4ParticleChangeForLoss::ProposePo 157 158 159 { 160 proposedPolarization.set(Px, Py, Pz); 161 } 162 163 inline 164 void G4ParticleChangeForLoss::InitializeForAlo 165 { 166 InitializeSecondaries(); 167 InitializeLocalEnergyDeposit(); 168 InitializeParentWeight(track); 169 InitializeStatusChange(track); 170 proposedKinEnergy = track.GetKineticEnergy() 171 currentCharge = track.GetDynamicParticle()-> 172 } 173 174 inline 175 void G4ParticleChangeForLoss::InitializeForPos 176 { 177 InitializeForAlongStep(track); 178 proposedMomentumDirection = track.GetMomentu 179 proposedPolarization = track.GetPolarization 180 } 181 182 #endif 183