Geant4-11
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: Katsuya.Amako@kek.jp)
39// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
40// Revisions:
41// Hisaya Kurashige, 1998-2007
42// --------------------------------------------------------------------
43#ifndef G4Step_hh
44#define G4Step_hh 1
45
46#include <stdlib.h> // 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
81 // Pre-Step points
82
85 // Post-Step points
86
89 // Before the end of the AlongStepDoIt loop, StepLength keeps
90 // the initial value which is determined by the shortest geometrical Step
91 // proposed by a physics process. After finishing the AlongStepDoIt,
92 // it will be set equal to 'StepLength' in G4Step
93
96 // Total energy deposit
97
100 // Total non-ionizing energy deposit
101
103 void SetControlFlag(G4SteppingControl StepControlFlag);
104 // Control flag for stepping
105
108 // Manipulation of total energy deposit
109
112 // Manipulation of non-ionizing energy deposit
113
116
121 // Get/Set/Clear flag for initial/last step
122 // NOTE: flags are not used
123
126 // Difference of position, time, momentum and energy
127
129 G4double GetDeltaEnergy() const;
130 // These methods will be deleted
131 // NOTE: use GetTotalEnergyDeposit() to obtain energy loss in material
132
133 void InitializeStep(G4Track* aValue);
134 // Initialize contents of G4Step
135
137 // Update track by using G4Step information
138
140 // Copy PostStepPoint to PreStepPoint
141
143 // For visualization
144
145 inline void SetPointerToVectorOfAuxiliaryPoints(std::vector<G4ThreeVector>* vec);
146 inline std::vector<G4ThreeVector>* GetPointerToVectorOfAuxiliaryPoints() const;
147 // Auxiliary points modifiers
148
149 // --- Secondary buckets ---
150
152 // Secondaries in the current step
153
154 const std::vector<const G4Track*>* GetSecondaryInCurrentStep() const;
155
159 // NOTE: Secondary bucket of the Step contains
160 // all secondaries during tracking the current track
161 // (i.e. NOT secondaries produced in the current step)
162 // all these methods give same object (i.e. G4TrackVector )
163 // but 2nd one will create bucket in addition
164
166 // Just delete secondary bucket
167 // NOTE: G4Track objects inside the bucket are not deleted
168
170 // Add secondary tracks to the bucket
171
172 protected:
173
175 // Accumulated total energy deposit in the current Step
176
178 // Accumulated non-ionizing energy deposit in the current Step
179
180 private:
181
185 // Step length which may be updated at each invocation of
186 // AlongStepDoIt and PostStepDoIt
187
188 G4Track* fpTrack = nullptr;
189
191 // A flag to control SteppingManager behavior from process
192
195 // Flags for initial/last step
196
198 // Secondary bucket implemented by using std::vector of G4Track*
199
200 std::size_t nSecondaryByLastStep = 0;
201 // number of secondaries which have been created by the last step
202
203 std::vector<const G4Track*>* secondaryInCurrentStep = nullptr;
204
205 std::vector<G4ThreeVector>* fpVectorOfAuxiliaryPointsPointer = nullptr;
206};
207
208#include "G4Step.icc"
209
210#endif
G4SteppingControl
@ NormalCondition
std::vector< G4Track * > G4TrackVector
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
Definition: G4Step.hh:62
std::vector< const G4Track * > * secondaryInCurrentStep
Definition: G4Step.hh:203
void DeleteSecondaryVector()
G4StepPoint * fpPreStepPoint
Definition: G4Step.hh:182
G4double GetDeltaTime() const
void SetPointerToVectorOfAuxiliaryPoints(std::vector< G4ThreeVector > *vec)
void InitializeStep(G4Track *aValue)
std::vector< G4ThreeVector > * fpVectorOfAuxiliaryPointsPointer
Definition: G4Step.hh:205
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:192
std::size_t nSecondaryByLastStep
Definition: G4Step.hh:200
G4Track * fpTrack
Definition: G4Step.hh:188
void UpdateTrack()
void ResetTotalEnergyDeposit()
G4ThreeVector GetDeltaMomentum() const
Definition: G4Step.cc:176
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:110
G4TrackVector * GetfSecondary()
G4bool IsLastStepInVolume() const
G4double fStepLength
Definition: G4Step.hh:184
void AddTotalEnergyDeposit(G4double value)
G4bool IsFirstStepInVolume() const
G4TrackVector * fSecondary
Definition: G4Step.hh:197
const std::vector< const G4Track * > * GetSecondaryInCurrentStep() const
Definition: G4Step.cc:209
G4bool fLastStepInVolume
Definition: G4Step.hh:194
G4bool fFirstStepInVolume
Definition: G4Step.hh:193
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:177
G4double GetStepLength() const
G4double GetTotalEnergyDeposit() const
G4SteppingControl fpSteppingControlFlag
Definition: G4Step.hh:190
G4TrackVector * NewSecondaryVector()
void SetSecondary(G4TrackVector *value)
void SetControlFlag(G4SteppingControl StepControlFlag)
void SetPreStepPoint(G4StepPoint *value)
void ClearLastStepFlag()
void SetFirstStepFlag()
void ClearFirstStepFlag()
G4StepPoint * fpPostStepPoint
Definition: G4Step.hh:183
G4double fTotalEnergyDeposit
Definition: G4Step.hh:174
void SetTotalEnergyDeposit(G4double value)
G4StepPoint * GetPostStepPoint() const
void ResetNonIonizingEnergyDeposit()
void SetTrack(G4Track *value)