Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleChange.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// G4ParticleChange
27//
28// Class description:
29//
30// Concrete class for ParticleChange containing the results after
31// invocation of a physics process.
32// This includes final states of parent particle (momentum, energy,
33// etc) and secondary particles generated by the interaction.
34// The tracking assumes that all the values of energy and momentum
35// are in global reference system, therefore all the needed Lorentz
36// transformations must have been already computed when filling the
37// data-members of this class.
38//
39// IMPORTANT NOTE: Despite the name, what this class stores/returns
40// through its methods, are the "FINAL" values of the Position,
41// Momentum, etc.
42
43// Author: Hisaya Kurashige, 23 March 1998
44// --------------------------------------------------------------------
45#ifndef G4ParticleChange_hh
46#define G4ParticleChange_hh 1
47
48#include "globals.hh"
49#include "G4ios.hh"
50#include "G4ThreeVector.hh"
51#include "G4ThreeVector.hh"
52#include "G4VParticleChange.hh"
53
55
57{
58 public:
59
61 // Default constructor
62
63 virtual ~G4ParticleChange();
64 // Destructor
65
66 G4bool operator==(const G4ParticleChange& right) const;
67 G4bool operator!=(const G4ParticleChange& right) const;
68 // Equality operators
69
70 // --- the following methods are for updating G4Step -----
71 // Return the pointer to G4Step after updating the Step information
72 // by using final state of the track given by a physics process
73
74 virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
75 // A physics process gives the final state of the particle
76 // relative to the initial state at the beginning of the Step,
77 // i.e., based on information of G4Track (or equivalently
78 // the PreStepPoint).
79 // In this method, the differences (delta) between these two states
80 // are calculated, and are accumulated in PostStepPoint.
81 // Take note that the return type of GetMomentumChange() is a
82 // pointer to G4ParticleMomentum. Also it is a normalized
83 // momentum vector
84
85 virtual G4Step* UpdateStepForAtRest(G4Step* Step);
86 virtual G4Step* UpdateStepForPostStep(G4Step* Step);
87 // A physics process gives the final state of the particle
88 // based on information of G4Track (or equivalently the PreStepPoint)
89
90 virtual void Initialize(const G4Track&);
91 // Initialize all propoerties by using G4Track information
92
93 // --- methods to keep information of the final state ---
94 //
95 // The ProposeXXX methods store (and return in GetXXX methods)
96 // the "FINAL" values of the Position, Momentum, etc.
97
101 // Get/Propose the MomentumDirection vector: it is the final momentum
102 // direction
103
106 void ProposePolarization(const G4ThreeVector& finalPoralization);
107 // Get/Propose the final Polarization vector
108
110 void ProposeEnergy(G4double finalEnergy);
111 // Get/Propose the final kinetic energy of the current particle
112
114 void ProposeVelocity(G4double finalVelocity);
115 // Get/Propose the final velocity of the current particle
116
118 void ProposeProperTime(G4double finalProperTime);
119 // Get/Propose the final ProperTime
120
123 void ProposePosition(const G4ThreeVector& finalPosition);
124 // Get/Propose the final position of the current particle
125
128 // Get/Propose the final global/local Time.
129 // NOTE: DO NOT INVOKE both methods in a step
130 // Each method affects both local and global time
131
132 G4double GetGlobalTime(G4double timeDelay = 0.0) const;
133 G4double GetLocalTime(G4double timeDelay = 0.0) const;
134 // Convert the time delay to the glocbal/local time.
135 // Can get the final global/local time without argument
136
138 void ProposeMass(G4double finalMass);
139 // Get/Propose the final dynamical mass in G4DynamicParticle
140
142 void ProposeCharge(G4double finalCharge);
143 // Get/Propose the final dynamical charge in G4DynamicParticle
144
146 void ProposeMagneticMoment(G4double finalMagneticMoment);
147 // Get/Propose the final MagneticMoment in G4DynamicParticle
148
150 // Convert the position displacement to the global position
151
153 G4double mass) const;
154 // Calculate momentum by using Energy, Momentum Direction, and Mass
155
156 // --- methods for adding secondaries ---
157
158 void AddSecondary(G4Track* aSecondary);
159 // Add a secondary particle to theListOfSecondaries
160
161 void AddSecondary(G4DynamicParticle* aSecondary,
162 G4bool IsGoodForTracking = false);
163 // Add a secondary particle to theListOfSecondaries.
164 // Position and time are same as thePositionChange and theTimeChange
165
167 G4bool IsGoodForTracking = false);
168 // Add a secondary particle to theListOfSecondaries.
169 // Global time are same as theTimeChange and theTimeChange
170
171 void AddSecondary(G4DynamicParticle* aSecondary, G4double time,
172 G4bool IsGoodForTracking = false);
173 // Add a secondary particle to theListOfSecondaries.
174 // Position and are same as thePositionChange
175
176 // --- Dump and debug methods ---
177
178 virtual void DumpInfo() const;
179
180 virtual G4bool CheckIt(const G4Track&);
181
182 protected:
183
186 // Hidden copy constructor and assignment operator
187
189 // Update the G4Step specific attributes
190 // (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
191
193 // It is the vector containing the final momentum direction
194 // after the invoked process. The application of the change
195 // of the momentum direction of the particle is not done here.
196 // The responsibility to apply the change is up to the entity
197 // which invoked the process
198
200 // The changed (final) polarization of a given track
201
203 // The final kinetic energy of the current track
204
207 // The final velocity of the current track
208
210 // The changed (final) position of a given track
211
213 // The global time at Initial
215 // The local time at Initial
216
218 // The change of local time of a given particle
219
221 // The changed (final) proper time of a given track
222
224 // The Changed (final) mass of a given track
225
227 // The Changed (final) charge of a given track
228
230 // The Changed (final) MagneticMoment of a given track
231
232 const G4Track* theCurrentTrack = nullptr;
233};
234
235#include "G4ParticleChange.icc"
236
237#endif
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
virtual G4Step * UpdateStepForAtRest(G4Step *Step)
void AddSecondary(G4Track *aSecondary)
G4bool operator==(const G4ParticleChange &right) const
void ProposePolarization(G4double Px, G4double Py, G4double Pz)
void ProposeMomentumDirection(const G4ThreeVector &Pfinal)
G4double GetVelocity() const
G4double GetEnergy() const
void ProposePosition(G4double x, G4double y, G4double z)
G4ThreeVector CalcMomentum(G4double energy, G4ThreeVector direction, G4double mass) const
const G4ThreeVector * GetPolarization() const
virtual void DumpInfo() const
G4double GetProperTime() const
virtual ~G4ParticleChange()
G4ThreeVector thePositionChange
G4ThreeVector theMomentumDirectionChange
G4double GetMagneticMoment() const
G4Step * UpdateStepInfo(G4Step *Step)
void ProposeLocalTime(G4double t)
void ProposeMagneticMoment(G4double finalMagneticMoment)
const G4ThreeVector * GetMomentumDirection() const
void ProposeProperTime(G4double finalProperTime)
G4double theProperTimeChange
void ProposePosition(const G4ThreeVector &finalPosition)
void ProposeCharge(G4double finalCharge)
virtual G4Step * UpdateStepForPostStep(G4Step *Step)
virtual G4bool CheckIt(const G4Track &)
G4ThreeVector GetGlobalPosition(const G4ThreeVector &displacement) const
void ProposeVelocity(G4double finalVelocity)
G4ThreeVector thePolarizationChange
void ProposeEnergy(G4double finalEnergy)
virtual G4Step * UpdateStepForAlongStep(G4Step *Step)
G4double GetMass() const
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
void ProposePolarization(const G4ThreeVector &finalPoralization)
void ProposeGlobalTime(G4double t)
G4double theMagneticMomentChange
G4bool operator!=(const G4ParticleChange &right) const
const G4ThreeVector * GetPosition() const
virtual void Initialize(const G4Track &)
G4double GetCharge() const
const G4Track * theCurrentTrack
G4ParticleChange & operator=(const G4ParticleChange &right)
G4double GetGlobalTime(G4double timeDelay=0.0) const
void ProposeMass(G4double finalMass)
G4double GetLocalTime(G4double timeDelay=0.0) const
Definition: G4Step.hh:62