Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4Step.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// G4Step
27//
28// Class description:
29//
30// This class represents the Step of a particle being tracked.
31// It includes information of:
32// 1) List of Step points which compose the Step,
33// 2) static information of particle which generated the Step,
34// 3) trackID and parent particle ID of the Step,
35// 4) termination condition of the Step.
36
37// Authors:
38// Katsuya Amako (e-mail: [email protected])
39// Takashi Sasaki (e-mail: [email protected])
40// Revisions:
41// Hisaya Kurashige, 1998-2007
42// --------------------------------------------------------------------
43#ifndef G4Step_hh
44#define G4Step_hh 1
45
46#include <cstdlib> // Include from 'system'
47#include <cmath> // Include from 'system'
48#include "G4ios.hh" // Include from 'system'
49#include <iomanip> // Include from 'system'
50#include "globals.hh" // Include from 'global'
51#include "G4ThreeVector.hh" // Include from 'global'
52#include "G4VPhysicalVolume.hh" // Include from 'geometry'
53#include "G4StepPoint.hh" // Include from 'track'
54#include "G4StepStatus.hh" // Include from 'track'
55#include "G4TrackVector.hh" // Include from 'tracking'
56#include "G4Profiler.hh" // Include from 'global'
57
58class G4Polyline; // Forward declaration.
59class G4Track; // Forward declaration.
60
61class G4Step
62{
63 public:
64 // the profiler aliases are only used when compiled with GEANT4_USE_TIMEMORY
66
67 G4Step();
68 ~G4Step();
69 // Constructor/Destructor
70
71 G4Step(const G4Step&);
72 G4Step& operator=(const G4Step&);
73 // Copy Constructor and assignment operator
74
75 G4Track* GetTrack() const;
76 void SetTrack(G4Track* value);
77 // Current track
78
82 // Pre-Step points
83 // If Set method is invoked, the previous StepPoint object is deleted.
84 // If Reset method is invoked, the previous StepPoint object is not deleted
85 // but its pointer is returned. Thus it's the caller's responsibility to
86 // properly delete it.
87
91 // Post-Step points
92 // If Set method is invoked, the previous StepPoint object is deleted.
93 // If Reset method is invoked, the previous StepPoint object is not deleted
94 // but its pointer is returned. Thus it's the caller's responsibility to
95 // properly delete it.
96
99 // Before the end of the AlongStepDoIt loop, StepLength keeps
100 // the initial value which is determined by the shortest geometrical Step
101 // proposed by a physics process. After finishing the AlongStepDoIt,
102 // it will be set equal to 'StepLength' in G4Step
103
106 // Total energy deposit
107
110 // Total non-ionizing energy deposit
111
113 void SetControlFlag(G4SteppingControl StepControlFlag);
114 // Control flag for stepping
115
118 // Manipulation of total energy deposit
119
122 // Manipulation of non-ionizing energy deposit
123
126
131 // Get/Set/Clear flag for initial/last step
132 // NOTE: flags are not used
133
136 // Difference of position, time, momentum and energy
137
139 G4double GetDeltaEnergy() const;
140 // These methods will be deleted
141 // NOTE: use GetTotalEnergyDeposit() to obtain energy loss in material
142
143 void InitializeStep(G4Track* aValue);
144 // Initialize contents of G4Step
145
147 // Update track by using G4Step information
148
150 // Copy PostStepPoint to PreStepPoint
151
153 // For visualization
154
155 inline void SetPointerToVectorOfAuxiliaryPoints(std::vector<G4ThreeVector>* vec);
156 inline std::vector<G4ThreeVector>* GetPointerToVectorOfAuxiliaryPoints() const;
157 // Auxiliary points modifiers
158
159 // --- Secondary buckets ---
160
162 // Secondaries in the current step
163
164 const std::vector<const G4Track*>* GetSecondaryInCurrentStep() const;
165
169 // NOTE: Secondary bucket of the Step contains
170 // all secondaries during tracking the current track
171 // (i.e. NOT secondaries produced in the current step)
172 // all these methods give same object (i.e. G4TrackVector )
173 // but 2nd one will create bucket in addition
174
176 // Just delete secondary bucket
177 // NOTE: G4Track objects inside the bucket are not deleted
178
180 // Add secondary tracks to the bucket
181
182 protected:
183
185 // Accumulated total energy deposit in the current Step
186
188 // Accumulated non-ionizing energy deposit in the current Step
189
190 private:
191
192 G4StepPoint* fpPreStepPoint = nullptr;
193 G4StepPoint* fpPostStepPoint = nullptr;
194 G4double fStepLength = 0.0;
195 // Step length which may be updated at each invocation of
196 // AlongStepDoIt and PostStepDoIt
197
198 G4Track* fpTrack = nullptr;
199
200 G4SteppingControl fpSteppingControlFlag = NormalCondition;
201 // A flag to control SteppingManager behavior from process
202
203 G4bool fFirstStepInVolume = false;
204 G4bool fLastStepInVolume = false;
205 // Flags for initial/last step
206
207 G4TrackVector* fSecondary = nullptr;
208 // Secondary bucket implemented by using std::vector of G4Track*
209
210 std::size_t nSecondaryByLastStep = 0;
211 // number of secondaries which have been created by the last step
212
213 std::vector<const G4Track*>* secondaryInCurrentStep = nullptr;
214
215 std::vector<G4ThreeVector>* fpVectorOfAuxiliaryPointsPointer = nullptr;
216};
217
218#include "G4Step.icc"
219
220#endif
G4SteppingControl
@ NormalCondition
std::vector< G4Track * > G4TrackVector
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
Definition: G4Step.hh:62
void DeleteSecondaryVector()
G4double GetDeltaTime() const
void SetPointerToVectorOfAuxiliaryPoints(std::vector< G4ThreeVector > *vec)
void InitializeStep(G4Track *aValue)
G4SteppingControl GetControlFlag() const
G4Polyline * CreatePolyline() const
std::vector< G4ThreeVector > * GetPointerToVectorOfAuxiliaryPoints() const
G4Track * GetTrack() const
~G4Step()
Definition: G4Step.cc:47
G4double GetDeltaEnergy() const
Definition: G4Step.cc:185
G4StepPoint * ResetPreStepPoint(G4StepPoint *value=nullptr)
void UpdateTrack()
void ResetTotalEnergyDeposit()
G4ThreeVector GetDeltaMomentum() const
Definition: G4Step.cc:169
void SetLastStepFlag()
void SetStepLength(G4double value)
void AddNonIonizingEnergyDeposit(G4double value)
G4Step()
Definition: G4Step.cc:38
void SetPostStepPoint(G4StepPoint *value)
G4Step & operator=(const G4Step &)
Definition: G4Step.cc:106
G4TrackVector * GetfSecondary()
G4bool IsLastStepInVolume() const
void AddTotalEnergyDeposit(G4double value)
G4bool IsFirstStepInVolume() const
const std::vector< const G4Track * > * GetSecondaryInCurrentStep() const
Definition: G4Step.cc:202
const G4TrackVector * GetSecondary() const
G4ThreeVector GetDeltaPosition() const
std::size_t GetNumberOfSecondariesInCurrentStep() const
void CopyPostToPreStepPoint()
void SetNonIonizingEnergyDeposit(G4double value)
G4StepPoint * GetPreStepPoint() const
G4double GetNonIonizingEnergyDeposit() const
G4double fNonIonizingEnergyDeposit
Definition: G4Step.hh:187
G4double GetStepLength() const
G4double GetTotalEnergyDeposit() const
G4TrackVector * NewSecondaryVector()
void SetSecondary(G4TrackVector *value)
void SetControlFlag(G4SteppingControl StepControlFlag)
void SetPreStepPoint(G4StepPoint *value)
void ClearLastStepFlag()
void SetFirstStepFlag()
void ClearFirstStepFlag()
G4double fTotalEnergyDeposit
Definition: G4Step.hh:184
void SetTotalEnergyDeposit(G4double value)
G4StepPoint * ResetPostStepPoint(G4StepPoint *value=nullptr)
G4StepPoint * GetPostStepPoint() const
void ResetNonIonizingEnergyDeposit()
void SetTrack(G4Track *value)