Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // G4ParticleChangeForLoss << 27 // 23 // 28 // Class description: << 24 // $Id: G4ParticleChangeForLoss.hh,v 1.4 2001/07/11 10:08:35 gunter Exp $ >> 25 // GEANT4 tag $Name: geant4-05-01-patch-01 $ 29 // 26 // 30 // Concrete class for ParticleChange for Energ << 27 // 31 << 28 // ------------------------------------------------------------ 32 // Author: Hisaya Kurashige, 23 March 1998 << 29 // GEANT 4 class header file 33 // Revision: Vladimir Ivantchenko, 16 January << 30 // 34 // 24 August 2 << 31 // 35 // ------------------------------------------- << 32 // ------------------------------------------------------------ 36 #ifndef G4ParticleChangeForLoss_hh << 33 // Implemented for the new scheme 23 Mar. 1998 H.Kurahige 37 #define G4ParticleChangeForLoss_hh 1 << 34 // >> 35 // Class Description >> 36 // This class is a concrete class for ParticleChange for EnergyLoss >> 37 // >> 38 #ifndef G4ParticleChangeForLoss_h >> 39 #define G4ParticleChangeForLoss_h 1 38 40 >> 41 #include "globals.hh" >> 42 #include "G4ios.hh" >> 43 class G4DynamicParticle; 39 #include "G4VParticleChange.hh" 44 #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 45 76 inline const G4ThreeVector& GetProposedPolar << 46 class G4ParticleChangeForLoss: public G4VParticleChange 77 inline void ProposePolarization(const G4Thre << 47 { 78 inline void ProposePolarization(G4double Px, << 48 public: 79 << 49 // default constructor 80 void DumpInfo() const final; << 50 G4ParticleChangeForLoss(); 81 << 51 82 private: << 52 // destructor 83 << 53 virtual ~G4ParticleChangeForLoss(); 84 G4double proposedKinEnergy = 0.0; << 54 85 // The final kinetic energy of the current p << 55 protected: 86 << 56 // hide copy constructor and assignment operaor as protected 87 G4double currentCharge = 0.0; << 57 G4ParticleChangeForLoss(const G4ParticleChangeForLoss &right); 88 // The final charge of the current parti << 58 G4ParticleChangeForLoss & operator=(const G4ParticleChangeForLoss &right); 89 << 59 90 G4ThreeVector proposedMomentumDirection; << 60 public: 91 // The final momentum direction of the curre << 61 // equal/unequal operator 92 << 62 G4bool operator==(const G4ParticleChangeForLoss &right) const; 93 G4ThreeVector proposedPolarization; << 63 G4bool operator!=(const G4ParticleChangeForLoss &right) const; 94 // The final polarization of the current par << 64 >> 65 >> 66 public: // with description >> 67 // ---------------------------------------------------- >> 68 // --- the following methods are for updating G4Step ----- >> 69 virtual G4Step* UpdateStepForAlongStep(G4Step* Step); >> 70 >> 71 virtual void Initialize(const G4Track&); >> 72 // Initialize all propoerties by using G4Track information >> 73 >> 74 G4double GetEnergyChange() const; >> 75 void SetEnergyChange(G4double theEnergyChange); >> 76 // Get/Set the final kinetic energy of the current particle. >> 77 >> 78 >> 79 public: >> 80 virtual void DumpInfo() const; >> 81 >> 82 protected: >> 83 G4double theEnergyChange; >> 84 // The final kinetic energy of the current particle. >> 85 >> 86 public: >> 87 // for Debug >> 88 virtual G4bool CheckIt(const G4Track&); 95 }; 89 }; 96 90 97 // ---------------------- << 98 // Inline methods << 99 // ---------------------- << 100 << 101 inline 91 inline 102 G4double G4ParticleChangeForLoss::GetProposedK << 92 G4double G4ParticleChangeForLoss::GetEnergyChange() const 103 { 93 { 104 return proposedKinEnergy; << 94 return theEnergyChange; 105 } 95 } 106 96 107 inline 97 inline 108 void G4ParticleChangeForLoss::SetProposedKinet << 98 void G4ParticleChangeForLoss::SetEnergyChange(G4double Energy) 109 { 99 { 110 proposedKinEnergy = energy; << 100 theEnergyChange = Energy; 111 } 101 } 112 102 113 inline G4double G4ParticleChangeForLoss::GetPr << 103 #endif 114 { << 104 115 return currentCharge; << 105 116 } << 106 >> 107 >> 108 >> 109 117 110 118 inline << 119 void G4ParticleChangeForLoss::SetProposedCharg << 120 { << 121 currentCharge = theCharge; << 122 } << 123 111 124 inline << 125 const G4ThreeVector& << 126 G4ParticleChangeForLoss::GetProposedMomentumDi << 127 { << 128 return proposedMomentumDirection; << 129 } << 130 112 131 inline << 132 void G4ParticleChangeForLoss::ProposeMomentumD << 133 { << 134 proposedMomentumDirection = dir; << 135 } << 136 113 137 inline << 138 void << 139 G4ParticleChangeForLoss::SetProposedMomentumDi << 140 { << 141 proposedMomentumDirection = dir; << 142 } << 143 114 144 inline << 145 const G4ThreeVector& G4ParticleChangeForLoss:: << 146 { << 147 return proposedPolarization; << 148 } << 149 115 150 inline << 151 void G4ParticleChangeForLoss::ProposePolarizat << 152 { << 153 proposedPolarization = dir; << 154 } << 155 116 156 inline void G4ParticleChangeForLoss::ProposePo << 157 << 158 << 159 { << 160 proposedPolarization.set(Px, Py, Pz); << 161 } << 162 117 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 118 174 inline << 175 void G4ParticleChangeForLoss::InitializeForPos << 176 { << 177 InitializeForAlongStep(track); << 178 proposedMomentumDirection = track.GetMomentu << 179 proposedPolarization = track.GetPolarization << 180 } << 181 119 182 #endif << 183 120