Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleChangeForLoss.hh
Go to the documentation of this file.
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
43{
44public:
45
47
48 ~G4ParticleChangeForLoss() override = default;
49
52
53 // --- the following methods are for updating G4Step -----
54
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
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
82private:
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
101inline
103{
104 return proposedKinEnergy;
105}
106
107inline
109{
110 proposedKinEnergy = energy;
111}
112
114{
115 return currentCharge;
116}
117
118inline
120{
121 currentCharge = theCharge;
122}
123
124inline
125const G4ThreeVector&
127{
128 return proposedMomentumDirection;
129}
130
131inline
133{
134 proposedMomentumDirection = dir;
135}
136
137inline
138void
140{
141 proposedMomentumDirection = dir;
142}
143
144inline
146{
147 return proposedPolarization;
148}
149
150inline
152{
153 proposedPolarization = dir;
154}
155
157 G4double Py,
158 G4double Pz)
159{
160 proposedPolarization.set(Px, Py, Pz);
161}
162
163inline
165{
170 proposedKinEnergy = track.GetKineticEnergy();
171 currentCharge = track.GetDynamicParticle()->GetCharge();
172}
173
174inline
176{
178 proposedMomentumDirection = track.GetMomentumDirection();
179 proposedPolarization = track.GetPolarization();
180}
181
182#endif
double G4double
Definition G4Types.hh:83
void set(double x, double y, double z)
G4double GetCharge() const
void InitializeForPostStep(const G4Track &)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
~G4ParticleChangeForLoss() override=default
void InitializeForAlongStep(const G4Track &)
G4Step * UpdateStepForAlongStep(G4Step *step) final
G4ParticleChangeForLoss(const G4ParticleChangeForLoss &right)=delete
void SetProposedKineticEnergy(G4double proposedKinEnergy)
G4ParticleChangeForLoss & operator=(const G4ParticleChangeForLoss &right)=delete
const G4ThreeVector & GetProposedMomentumDirection() const
G4Step * UpdateStepForPostStep(G4Step *step) final
void SetProposedCharge(G4double theCharge)
void ProposePolarization(const G4ThreeVector &dir)
void SetProposedMomentumDirection(const G4ThreeVector &dir)
const G4ThreeVector & GetProposedPolarization() const
const G4DynamicParticle * GetDynamicParticle() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
const G4ThreeVector & GetPolarization() const
void InitializeLocalEnergyDeposit()
void InitializeStatusChange(const G4Track &)
void InitializeSecondaries()
void InitializeParentWeight(const G4Track &)
#define inline
Definition internal.h:104