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