Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VParticleChange.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// G4VParticleChange
27//
28// Class description:
29//
30// Abstract class for "Particle Change".
31//
32// The ParticleChange class contains the results after invocation
33// of a physics process. This includes final states of parent particle
34// (momentum, energy, etc) and secondary particles generated by the
35// interaction.
36// The tracking assumes that all the values of energy and momentum are
37// in global reference system, therefore all the needed Lorentz
38// transformations must have been already computed when filling the
39// data-members of this class.
40//
41// This abstract class has following four virtual methods:
42// virtual G4Step* UpdateStepForAtRest(G4Step* Step);
43// virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
44// virtual G4Step* UpdateStepForPostStep(G4Step* Step);
45// virtual void Initialize(const G4Track&);
46// The UpdateStep methods return the pointer to the G4Step after updating
47// the given Step information by using final state information of the track
48// given by a physics process.
49// User must add methods to keep the final state information in the derived
50// class as well as implement UpdateStep() methods wished to use.
51//
52// The Initialize() methods are provided to refresh the final state
53// information and should be called by each process at the beginning of DoIt().
54
55// Author: Hisaya Kurashige, 23 March 1998
56// --------------------------------------------------------------------
57#ifndef G4VParticleChange_hh
58#define G4VParticleChange_hh 1
59
60#include "globals.hh"
61#include "G4ios.hh"
62#include <cmath>
63
64#include "G4TrackFastVector.hh"
65#include "G4TrackStatus.hh"
66#include "G4SteppingControl.hh"
67#include "G4Step.hh"
68#include "G4Track.hh"
69
71{
72 public:
73
75 // Default constructor
76
77 virtual ~G4VParticleChange();
78 // Destructor
79
80 G4bool operator==(const G4VParticleChange& right) const;
81 G4bool operator!=(const G4VParticleChange& right) const;
82 // Equality operators; pointer comparison
83
84 // --- the following methods are for updating G4Step ---
85
86 virtual G4Step* UpdateStepForAtRest(G4Step* Step);
87 virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
88 virtual G4Step* UpdateStepForPostStep(G4Step* Step);
89 // Return the pointer to the G4Step after updating the Step information
90 // by using final state information of the track given by a physics
91 // process
92
93 virtual void Initialize(const G4Track&);
94 // This methods will be called by each process at the beginning
95 // of DoIt() if necessary
96
97 // --- the following methods are for TruePathLength ---
98
100 void ProposeTrueStepLength(G4double truePathLength);
101 // Get/Propose theTrueStepLength
102
103 // --- the following methods are for LocalEnergyDeposit ---
104
107 // Get/Propose the locally deposited energy
108
109 // --- the following methods are for nonIonizingEnergyDeposit ---
110
113 // Get/Propose the non-ionizing deposited energy
114
115 // --- the following methods are for TrackStatus ---
116
119 // Get/Propose the final TrackStatus of the current particle
120
121 // --- the following methods are for management of SteppingControl ---
122
125 // Set/Propose a flag to control stepping manager behaviour
126
127 // --- the following methods are for management of initial/last step
128
133
134 // --- the following methods are for management of secondaries ---
135
136 void Clear();
137 // Clear the contents of this objects
138 // This method should be called after the Tracking(Stepping)
139 // manager removes all secondaries in theListOfSecondaries
140
141 void SetNumberOfSecondaries(G4int totSecondaries);
142 // SetNumberOfSecondaries must be called just before AddSecondary()
143 // in order to secure memory space for theListOfSecondaries
144 // This method resets theNumberOfSecondaries to zero
145 // (that will be incremented at every AddSecondary() call)
146
148 // Returns the number of secondaries current stored in G4TrackFastVector
149
150 G4Track* GetSecondary(G4int anIndex) const;
151 // Returns the pointer to the generated secondary particle
152 // which is specified by an Index
153
154 void AddSecondary(G4Track* aSecondary);
155 // Adds a secondary particle to theListOfSecondaries
156
157 // --- the following methods are for management of weights ---
158
161 // Get weight of the parent (i.e. current) track
162
163 void ProposeWeight(G4double finalWeight);
164 void ProposeParentWeight(G4double finalWeight);
165 // Propose new weight of the parent (i.e. current) track
166 // As for AlongStepDoIt, the parent weight will be set
167 // in accumulated manner, i.e. - If two processes propose
168 // weight of W1 and W2 respectively for the track with initial
169 // weight of W0 the final weight is set to: (W1/W0) * (W2/W0) * W0
170
173 // In default (fSecondaryWeightByProcess flag is false),
174 // the weight of secondary tracks will be set to the parent weight
175 // If fSecondaryWeightByProcess flag is true, the weight of secondary
176 // tracks will not be changed by the ParticleChange (i.e. the process
177 // determine the secondary weight)
178 // NOTE:
179 // Make sure that only one process in AlongStepDoIt() proposes the
180 // parent weight; if several processes in AlongStepDoIt() propose
181 // the parent weight and add secondaties with fSecondaryWeightByProcess
182 // is set to false, secondary weights may be wrong
183
186 // Obsolete
187
188 // --- Dump and debug methods ---
189
190 virtual void DumpInfo() const;
191 // Print out information
192
193 void SetVerboseLevel(G4int vLevel);
195
196 virtual G4bool CheckIt(const G4Track&);
197 // CheckIt method is provided for debug
198
202 // CheckIt method is activated if debug flag is set
203 // and 'G4VERBOSE' is defined
204
205 protected:
206
209 // Hidden copy constructor and assignment operator
210
212 // Update the G4Step specific attributes
213 // (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
214
223
225 // CheckSecondary method is provided for debug
226
229
230 protected:
231
234 // accuracy levels
235
237 // The vector of secondaries
238
240 // The changed (final) track status of a given particle
241
243 // A flag to control stepping manager behavior
244
246 // It represents the part of the energy lost for discrete
247 // or semi-continuous processes which is due to secondaries
248 // not generated because they would have been below their cut
249 // threshold.
250 // The sum of the locally deposited energy + the delta-energy
251 // coming from the continuous processes gives the
252 // total energy loss localized in the current Step
253
255 // Non-ionizing energu deposit is defined as a part of local
256 // energy deposit, which does not cause ionization of atoms
257
259 // The value of "True" Step Length
260
262 // Weight ofparent track
263
265 // Global time of the parent.
266 // This is used only for checking
267
269 // The total number of secondaries produced by each process.
270
272 // TheSizeOftheListOfSecondaries;
273
275 // The Verbose level
276
279 // Flag for initial/last step
280
282 // Flag for Weight of parent track
284 // Flag for setting weight of secondaries
285
287};
288
289#include "G4VParticleChange.icc"
290
291#endif
G4SteppingControl
@ NormalCondition
G4TrackStatus
@ fAlive
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
Definition: G4Step.hh:62
void InitializeTrueStepLength(const G4Track &)
G4bool GetFirstStepInVolume() const
void InitializeSteppingControl(const G4Track &)
G4double GetNonIonizingEnergyDeposit() const
G4double GetParentWeight() const
virtual G4bool CheckIt(const G4Track &)
static const G4double accuracyForException
void InitializeParentGlobalTime(const G4Track &)
void InitializeStatusChange(const G4Track &)
void ProposeTrackStatus(G4TrackStatus status)
G4TrackStatus theStatusChange
G4TrackFastVector * theListOfSecondaries
G4SteppingControl theSteppingControlFlag
void SetSecondaryWeightByProcess(G4bool)
static const G4double accuracyForWarning
G4bool IsParentWeightSetByProcess() const
void ProposeLastStepInVolume(G4bool flag)
void ProposeNonIonizingEnergyDeposit(G4double anEnergyPart)
G4SteppingControl GetSteppingControl() const
virtual G4Step * UpdateStepForAlongStep(G4Step *Step)
void ProposeWeight(G4double finalWeight)
void InitializeStepInVolumeFlags(const G4Track &)
virtual G4Step * UpdateStepForAtRest(G4Step *Step)
virtual void Initialize(const G4Track &)
G4double GetLocalEnergyDeposit() const
G4bool GetLastStepInVolume() const
void SetVerboseLevel(G4int vLevel)
G4double theNonIonizingEnergyDeposit
virtual G4Step * UpdateStepForPostStep(G4Step *Step)
G4double GetAccuracyForException() const
G4int GetNumberOfSecondaries() const
void AddSecondary(G4Track *aSecondary)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)
void SetNumberOfSecondaries(G4int totSecondaries)
G4bool GetDebugFlag() const
void SetParentWeightByProcess(G4bool)
G4int GetVerboseLevel() const
void InitializeLocalEnergyDeposit(const G4Track &)
G4double GetAccuracyForWarning() const
virtual void DumpInfo() const
G4double GetWeight() const
G4VParticleChange & operator=(const G4VParticleChange &right)
G4bool CheckSecondary(G4Track &)
G4Step * UpdateStepInfo(G4Step *Step)
void ProposeSteppingControl(G4SteppingControl StepControlFlag)
void ProposeParentWeight(G4double finalWeight)
void ProposeFirstStepInVolume(G4bool flag)
G4bool IsSecondaryWeightSetByProcess() const
G4Track * GetSecondary(G4int anIndex) const
void InitializeSecondaries(const G4Track &)
void ProposeTrueStepLength(G4double truePathLength)
void InitializeParentWeight(const G4Track &)
G4bool operator==(const G4VParticleChange &right) const
G4bool operator!=(const G4VParticleChange &right) const
G4TrackStatus GetTrackStatus() const
virtual ~G4VParticleChange()
G4double GetTrueStepLength() const