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.5 2004/01/20 15:29:41 vnivanch Exp $ >> 25 // GEANT4 tag $Name: geant4-06-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 // Modified: >> 36 // 16.01.04 V.Ivanchenko update for model variant of energy loss >> 37 // >> 38 // ------------------------------------------------------------ >> 39 // >> 40 // Class Description >> 41 // This class is a concrete class for ParticleChange for EnergyLoss >> 42 // >> 43 #ifndef G4ParticleChangeForLoss_h >> 44 #define G4ParticleChangeForLoss_h 1 38 45 >> 46 #include "globals.hh" >> 47 #include "G4ios.hh" 39 #include "G4VParticleChange.hh" 48 #include "G4VParticleChange.hh" 40 #include "G4DynamicParticle.hh" << 41 49 42 class G4ParticleChangeForLoss final : public G << 50 class G4DynamicParticle; >> 51 >> 52 class G4ParticleChangeForLoss: public G4VParticleChange 43 { 53 { 44 public: 54 public: 45 << 55 // default constructor 46 G4ParticleChangeForLoss(); 56 G4ParticleChangeForLoss(); 47 57 48 ~G4ParticleChangeForLoss() override = defaul << 58 // destructor 49 << 59 virtual ~G4ParticleChangeForLoss(); 50 G4ParticleChangeForLoss(const G4ParticleChan << 51 G4ParticleChangeForLoss& operator=(const G4P << 52 60 >> 61 // with description >> 62 // ---------------------------------------------------- 53 // --- the following methods are for updatin 63 // --- the following methods are for updating G4Step ----- 54 64 55 G4Step* UpdateStepForAlongStep(G4Step* step) << 65 virtual G4Step* UpdateStepForAlongStep(G4Step* Step); 56 G4Step* UpdateStepForPostStep(G4Step* step) << 66 virtual G4Step* UpdateStepForPostStep(G4Step* Step); 57 << 67 // A physics process gives the final state of the particle 58 // Initialize all used properties << 68 // based on information of G4Track 59 inline void InitializeForAlongStep(const G4T << 69 60 inline void InitializeForPostStep(const G4Tr << 70 void InitializeForAlongStep(const G4Track&); 61 << 71 void InitializeForPostStep(const G4Track&); 62 // Get/Set dynamic charge << 72 //Initialize all propoerties by using G4Track information 63 inline G4double GetProposedCharge() const; << 73 64 inline void SetProposedCharge(G4double theCh << 74 void AddSecondary(G4DynamicParticle* aParticle); 65 << 75 // Add next secondary 66 // Get/Set the final kinetic energy of the c << 76 67 inline G4double GetProposedKineticEnergy() c << 77 G4double GetProposedCharge() const; 68 inline void SetProposedKineticEnergy(G4doubl << 78 void SetProposedCharge(G4double theCharge); 69 << 79 // Get/Set theCharge 70 // Get/Propose the MomentumDirection vector: << 80 71 // direction << 81 G4double GetProposedKineticEnergy() const; 72 inline const G4ThreeVector& GetProposedMomen << 82 void SetProposedKineticEnergy(G4double kinEnergy); 73 inline void SetProposedMomentumDirection(con << 83 // Get/Set the final kinetic energy of the current particle. 74 inline void ProposeMomentumDirection(const G << 84 75 << 85 const G4ThreeVector& GetProposedMomentumDirection() const; 76 inline const G4ThreeVector& GetProposedPolar << 86 void SetProposedMomentumDirection(const G4ThreeVector& dir); 77 inline void ProposePolarization(const G4Thre << 87 78 inline void ProposePolarization(G4double Px, << 88 virtual void DumpInfo() const; 79 << 89 80 void DumpInfo() const final; << 90 // for Debug >> 91 virtual G4bool CheckIt(const G4Track&); >> 92 >> 93 protected: >> 94 // hide copy constructor and assignment operaor as protected >> 95 G4ParticleChangeForLoss(const G4ParticleChangeForLoss &right); >> 96 G4ParticleChangeForLoss & operator=(const G4ParticleChangeForLoss &right); 81 97 82 private: 98 private: 83 99 84 G4double proposedKinEnergy = 0.0; << 100 const G4Track* currentTrack; 85 // The final kinetic energy of the current p << 101 // The pointer to G4Track 86 << 102 G4double kinEnergy; 87 G4double currentCharge = 0.0; << 103 // The final kinetic energy of the current particle. 88 // The final charge of the current parti << 104 G4double currentCharge; 89 << 105 // The final charge of the current particle. 90 G4ThreeVector proposedMomentumDirection; 106 G4ThreeVector proposedMomentumDirection; 91 // The final momentum direction of the curre << 107 // The final momentum direction of the current particle. 92 << 93 G4ThreeVector proposedPolarization; << 94 // The final polarization of the current par << 95 }; 108 }; 96 109 97 // ---------------------- << 110 inline G4double G4ParticleChangeForLoss::GetProposedKineticEnergy() const 98 // Inline methods << 99 // ---------------------- << 100 << 101 inline << 102 G4double G4ParticleChangeForLoss::GetProposedK << 103 { 111 { 104 return proposedKinEnergy; << 112 return kinEnergy; 105 } 113 } 106 114 107 inline << 115 inline void G4ParticleChangeForLoss::SetProposedKineticEnergy(G4double energy) 108 void G4ParticleChangeForLoss::SetProposedKinet << 109 { 116 { 110 proposedKinEnergy = energy; << 117 kinEnergy = energy; 111 } 118 } 112 119 113 inline G4double G4ParticleChangeForLoss::GetPr 120 inline G4double G4ParticleChangeForLoss::GetProposedCharge() const 114 { 121 { 115 return currentCharge; 122 return currentCharge; 116 } 123 } 117 124 118 inline << 125 inline void G4ParticleChangeForLoss::SetProposedCharge(G4double theCharge) 119 void G4ParticleChangeForLoss::SetProposedCharg << 120 { 126 { 121 currentCharge = theCharge; 127 currentCharge = theCharge; 122 } 128 } 123 129 124 inline 130 inline 125 const G4ThreeVector& << 131 const G4ThreeVector& G4ParticleChangeForLoss::GetProposedMomentumDirection() const 126 G4ParticleChangeForLoss::GetProposedMomentumDi << 127 { 132 { 128 return proposedMomentumDirection; 133 return proposedMomentumDirection; 129 } 134 } 130 135 131 inline 136 inline 132 void G4ParticleChangeForLoss::ProposeMomentumD << 137 void G4ParticleChangeForLoss::SetProposedMomentumDirection(const G4ThreeVector& dir) 133 { 138 { 134 proposedMomentumDirection = dir; 139 proposedMomentumDirection = dir; 135 } 140 } 136 141 137 inline << 142 inline void G4ParticleChangeForLoss::InitializeForAlongStep(const G4Track& track) 138 void << 139 G4ParticleChangeForLoss::SetProposedMomentumDi << 140 { 143 { 141 proposedMomentumDirection = dir; << 144 theStatusChange = track.GetTrackStatus(); >> 145 theLocalEnergyDeposit = 0.0; >> 146 InitializeSecondaries(track); >> 147 kinEnergy = track.GetKineticEnergy(); >> 148 currentCharge = track.GetDynamicParticle()->GetCharge(); 142 } 149 } 143 150 144 inline << 151 inline void G4ParticleChangeForLoss::InitializeForPostStep(const G4Track& track) 145 const G4ThreeVector& G4ParticleChangeForLoss:: << 146 { 152 { 147 return proposedPolarization; << 153 theStatusChange = track.GetTrackStatus(); >> 154 theLocalEnergyDeposit = 0.0; >> 155 InitializeSecondaries(track); >> 156 kinEnergy = track.GetKineticEnergy(); >> 157 currentCharge = track.GetDynamicParticle()->GetCharge(); >> 158 proposedMomentumDirection = track.GetMomentumDirection(); >> 159 currentTrack = &track; 148 } 160 } 149 161 150 inline << 162 inline void G4ParticleChangeForLoss::AddSecondary(G4DynamicParticle* aParticle) 151 void G4ParticleChangeForLoss::ProposePolarizat << 152 { 163 { 153 proposedPolarization = dir; << 164 // create track 154 } << 165 G4Track* aTrack = new G4Track(aParticle, currentTrack->GetGlobalTime(), >> 166 currentTrack->GetPosition()); 155 167 156 inline void G4ParticleChangeForLoss::ProposePo << 168 // Touchable handle is copied to keep the pointer 157 << 169 aTrack->SetTouchableHandle(currentTrack->GetTouchableHandle()); 158 << 159 { << 160 proposedPolarization.set(Px, Py, Pz); << 161 } << 162 170 163 inline << 171 // add a secondary 164 void G4ParticleChangeForLoss::InitializeForAlo << 172 G4VParticleChange::AddSecondary(aTrack); 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 } 173 } 181 174 182 #endif 175 #endif >> 176 183 177