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[ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

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