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 // G4ParticleChangeForGamma << 27 // 26 // 28 // Class description: << 27 // $Id: G4ParticleChangeForGamma.hh 68795 2013-04-05 13:24:46Z gcosmo $ 29 // 28 // 30 // Concrete class for ParticleChange for gamma << 29 // 31 << 30 // ------------------------------------------------------------ 32 // Author: Hisaya Kurashige, 23 March 1998 << 31 // GEANT 4 class header file 33 // Revision: Vladimir Ivantchenko, 15 April 20 << 32 // 34 // 24 August 2 << 33 // 35 // ------------------------------------------- << 34 // ------------------------------------------------------------ 36 #ifndef G4ParticleChangeForGamma_hh << 35 // 15 April 2005 V.Ivanchenko for gamma EM processes 37 #define G4ParticleChangeForGamma_hh 1 << 36 // >> 37 // Modified: >> 38 // 30.05.05 : add UpdateStepForAtRest (V.Ivanchenko) >> 39 // 04.12.05 : apply UpdateStepForPostStep in any case (mma) >> 40 // 26.08.06 : Add->Set polarization; >> 41 // add const method to access track; >> 42 // add weight modification (V.Ivanchenko) >> 43 // >> 44 // ------------------------------------------------------------ >> 45 // >> 46 // Class Description >> 47 // This class is a concrete class for ParticleChange for gamma processes >> 48 // >> 49 #ifndef G4ParticleChangeForGamma_h >> 50 #define G4ParticleChangeForGamma_h 1 38 51 39 #include "globals.hh" 52 #include "globals.hh" 40 #include "G4ios.hh" 53 #include "G4ios.hh" 41 #include "G4VParticleChange.hh" 54 #include "G4VParticleChange.hh" 42 55 43 class G4DynamicParticle; 56 class G4DynamicParticle; 44 57 45 class G4ParticleChangeForGamma final : public << 58 class G4ParticleChangeForGamma: public G4VParticleChange 46 { 59 { 47 public: 60 public: 48 << 61 // default constructor 49 G4ParticleChangeForGamma(); 62 G4ParticleChangeForGamma(); 50 63 51 ~G4ParticleChangeForGamma() override = defau << 64 // destructor 52 << 65 virtual ~G4ParticleChangeForGamma(); 53 G4ParticleChangeForGamma(const G4ParticleCha << 54 G4ParticleChangeForGamma& operator=(const G4 << 55 66 >> 67 // with description >> 68 // ---------------------------------------------------- 56 // --- the following methods are for updatin 69 // --- the following methods are for updating G4Step ----- 57 70 58 G4Step* UpdateStepForAtRest(G4Step* pStep) f << 71 G4Step* UpdateStepForAtRest(G4Step* pStep); 59 G4Step* UpdateStepForPostStep(G4Step* Step) << 72 G4Step* UpdateStepForPostStep(G4Step* Step); 60 // A physics process gives the final sta << 73 // A physics process gives the final state of the particle 61 // based on information of G4Track << 74 // based on information of G4Track 62 75 63 inline void InitializeForPostStep(const G4Tr 76 inline void InitializeForPostStep(const G4Track&); 64 // Initialize all properties by using G4 << 77 //Initialize all propoerties by using G4Track information 65 78 66 void AddSecondary(G4DynamicParticle* aPartic 79 void AddSecondary(G4DynamicParticle* aParticle); 67 // Add next secondary << 80 // Add next secondary 68 81 69 inline G4double GetProposedKineticEnergy() c 82 inline G4double GetProposedKineticEnergy() const; 70 inline void SetProposedKineticEnergy(G4doubl 83 inline void SetProposedKineticEnergy(G4double proposedKinEnergy); 71 // Get/Set the final kinetic energy of t << 84 // Get/Set the final kinetic energy of the current particle. 72 85 73 inline const G4ThreeVector& GetProposedMomen 86 inline const G4ThreeVector& GetProposedMomentumDirection() const; >> 87 inline void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz); 74 inline void ProposeMomentumDirection(const G 88 inline void ProposeMomentumDirection(const G4ThreeVector& Pfinal); 75 // Get/Set the final momentum direction << 89 // Get/Propose the MomentumDirection vector: it is the final momentum direction. 76 90 77 inline const G4ThreeVector& GetProposedPolar 91 inline const G4ThreeVector& GetProposedPolarization() const; 78 inline void ProposePolarization(const G4Thre 92 inline void ProposePolarization(const G4ThreeVector& dir); 79 inline void ProposePolarization(G4double Px, 93 inline void ProposePolarization(G4double Px, G4double Py, G4double Pz); 80 94 81 void DumpInfo() const override; << 95 inline const G4Track* GetCurrentTrack() const; >> 96 >> 97 virtual void DumpInfo() const; >> 98 >> 99 // for Debug >> 100 virtual G4bool CheckIt(const G4Track&); >> 101 >> 102 protected: >> 103 // hide copy constructor and assignment operaor as protected >> 104 G4ParticleChangeForGamma(const G4ParticleChangeForGamma &right); >> 105 G4ParticleChangeForGamma & operator=(const G4ParticleChangeForGamma &right); 82 106 83 private: 107 private: 84 108 85 G4double proposedKinEnergy = 0.0; << 109 const G4Track* currentTrack; 86 // The final kinetic energy of the curre << 110 // The pointer to G4Track >> 111 >> 112 G4double proposedKinEnergy; >> 113 // The final kinetic energy of the current particle. 87 114 88 G4ThreeVector proposedMomentumDirection; 115 G4ThreeVector proposedMomentumDirection; 89 // The final momentum direction of the c << 116 // The final momentum direction of the current particle. 90 117 91 G4ThreeVector proposedPolarization; 118 G4ThreeVector proposedPolarization; 92 // The final polarization of the current << 119 // The final polarization of the current particle. 93 }; 120 }; 94 121 95 // ---------------------- << 122 // ------------------------------------------------------------ 96 // Inline methods << 97 // ---------------------- << 98 123 99 inline << 124 inline G4double G4ParticleChangeForGamma::GetProposedKineticEnergy() const 100 G4double G4ParticleChangeForGamma::GetProposed << 101 { 125 { 102 return proposedKinEnergy; 126 return proposedKinEnergy; 103 } 127 } 104 128 105 inline << 129 inline void G4ParticleChangeForGamma::SetProposedKineticEnergy(G4double energy) 106 void G4ParticleChangeForGamma::SetProposedKine << 107 { 130 { 108 proposedKinEnergy = energy; 131 proposedKinEnergy = energy; 109 } 132 } 110 133 111 inline 134 inline 112 const G4ThreeVector& G4ParticleChangeForGamma: << 135 const G4ThreeVector& G4ParticleChangeForGamma::GetProposedMomentumDirection() const 113 GetProposedMomentumDirection() const << 114 { 136 { 115 return proposedMomentumDirection; 137 return proposedMomentumDirection; 116 } 138 } 117 139 118 inline 140 inline 119 void G4ParticleChangeForGamma:: << 141 void G4ParticleChangeForGamma::ProposeMomentumDirection(const G4ThreeVector& dir) 120 ProposeMomentumDirection(const G4ThreeVector& << 121 { 142 { 122 proposedMomentumDirection = dir; 143 proposedMomentumDirection = dir; 123 } 144 } 124 145 125 inline 146 inline 126 const G4ThreeVector& G4ParticleChangeForGamma: << 147 void G4ParticleChangeForGamma::ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz) >> 148 { >> 149 proposedMomentumDirection.setX(Px); >> 150 proposedMomentumDirection.setY(Py); >> 151 proposedMomentumDirection.setZ(Pz); >> 152 } >> 153 >> 154 inline const G4Track* G4ParticleChangeForGamma::GetCurrentTrack() const >> 155 { >> 156 return currentTrack; >> 157 } >> 158 >> 159 inline >> 160 const G4ThreeVector& G4ParticleChangeForGamma::GetProposedPolarization() const 127 { 161 { 128 return proposedPolarization; 162 return proposedPolarization; 129 } 163 } 130 164 131 inline 165 inline 132 void G4ParticleChangeForGamma::ProposePolariza << 166 void G4ParticleChangeForGamma::ProposePolarization(const G4ThreeVector& dir) 133 { 167 { 134 proposedPolarization = dir; 168 proposedPolarization = dir; 135 } 169 } 136 170 137 inline 171 inline 138 void G4ParticleChangeForGamma::ProposePolariza << 172 void G4ParticleChangeForGamma::ProposePolarization(G4double Px, G4double Py, G4double Pz) 139 << 140 << 141 { 173 { 142 proposedPolarization.setX(Px); 174 proposedPolarization.setX(Px); 143 proposedPolarization.setY(Py); 175 proposedPolarization.setY(Py); 144 proposedPolarization.setZ(Pz); 176 proposedPolarization.setZ(Pz); 145 } 177 } 146 178 147 inline << 179 inline void G4ParticleChangeForGamma::InitializeForPostStep(const G4Track& track) 148 void G4ParticleChangeForGamma::InitializeForPo << 149 { 180 { 150 InitializeSecondaries(); << 181 theStatusChange = track.GetTrackStatus(); 151 InitializeLocalEnergyDeposit(); << 182 theLocalEnergyDeposit = 0.0; 152 InitializeParentWeight(track); << 183 theNonIonizingEnergyDeposit = 0.0; 153 InitializeStatusChange(track); << 184 InitializeSecondaries(track); 154 proposedKinEnergy = track.GetKinetic << 185 theParentWeight = track.GetWeight(); >> 186 isParentWeightProposed = false; >> 187 proposedKinEnergy = track.GetKineticEnergy(); 155 proposedMomentumDirection = track.GetMomentu 188 proposedMomentumDirection = track.GetMomentumDirection(); 156 proposedPolarization = track.GetPolariz << 189 proposedPolarization = track.GetPolarization(); >> 190 currentTrack = &track; 157 } 191 } 158 192 159 #endif 193 #endif >> 194 160 195