Geant4  10.01
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 //
27 // $Id: G4Step.hh 68795 2013-04-05 13:24:46Z gcosmo $
28 //
29 //
30 //---------------------------------------------------------------
31 //
32 // G4Step.hh
33 //
34 // Class Description:
35 // This class represents the Step of a particle tracked.
36 // It includes information of
37 // 1) List of Step points which compose the Step,
38 // 2) static information of particle which generated the
39 // Step,
40 // 3) trackID and parent particle ID of the Step,
41 // 4) termination condition of the Step,
42 //
43 // Contact:
44 // Questions and comments to this code should be sent to
45 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
46 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
47 //
48 // ---------------------------------------------------------------
49 // Modified for the new G4ParticleChange 12 Mar. 1998 H.Kurahige
50 // Correct treatment of touchable in G4Step::UpdateTrack
51 // 12 May. 1998 H.Kurashige
52 // ---------------------------------------------------------------
53 // Separate implementation of inline functions inti G4Step.icc
54 // Add updating mass/charge 6 Oct. 1999 H.Kurashige
55 // add nonIonizingEnergyLoss 26 Mar. 2007 H.Kurashige
56 //
57 // Repository test - Dennis Wright
58 //
59 #ifndef G4Step_h
60 #define G4Step_h 1
61 
62 #include <stdlib.h> // Include from 'system'
63 #include <cmath> // Include from 'system'
64 #include "G4ios.hh" // Include from 'system'
65 #include <iomanip> // Include from 'system'
66 #include "globals.hh" // Include from 'global'
67 #include "G4ThreeVector.hh" // Include from 'global'
68 #include "G4VPhysicalVolume.hh" // Include from 'geometry'
69 #include "G4StepPoint.hh" // Include from 'track'
70 #include "G4StepStatus.hh" // Include from 'track'
71 class G4Polyline; // Forward declaration.
72 class G4Track; // Forward declaration.
73 #include "G4TrackVector.hh" // Include from 'tracking'
74 
76 class G4Step
78 {
79 
80 //--------
81  public:
82 
83 // Constructor/Destrcutor
84  G4Step();
85  ~G4Step();
86 
87 // Copy Counstructor and assignment operator
88  G4Step(const G4Step& );
89  G4Step & operator=(const G4Step &);
90 
91 //--------
92  public: // WIth description
93 
94 // Get/Set functions
95  // currnet track
96  G4Track* GetTrack() const;
97  void SetTrack(G4Track* value);
98 
99  // step points
100  G4StepPoint* GetPreStepPoint() const;
101  void SetPreStepPoint(G4StepPoint* value);
102 
103  G4StepPoint* GetPostStepPoint() const;
104  void SetPostStepPoint(G4StepPoint* value);
105 
106  // step length
107  G4double GetStepLength() const;
108  void SetStepLength(G4double value);
109  // Before the end of the AlongStepDoIt loop,StepLength keeps
110  // the initial value which is determined by the shortest geometrical Step
111  // proposed by a physics process. After finishing the AlongStepDoIt,
112  // it will be set equal to 'StepLength' in G4Step.
113 
114  // total energy deposit
116  void SetTotalEnergyDeposit(G4double value);
117 
118  // total non-ionizing energy deposit
121 
122  // cotrole flag for stepping
124  void SetControlFlag(G4SteppingControl StepControlFlag);
125 
126  // manipulation of total energy deposit
127  void AddTotalEnergyDeposit(G4double value);
129 
130  // manipulation of non-ionizng energy deposit
133 
134 
135  // Get/Set/Clear flag for initial/last step
136  // NOTE: following flags are not used
137  // will be ready in later release
138  G4bool IsFirstStepInVolume() const;
139  G4bool IsLastStepInVolume() const;
140 
141  void SetFirstStepFlag();
142  void ClearFirstStepFlag();
143  void SetLastStepFlag();
144  void ClearLastStepFlag();
145 
146  // difference of position, time, momentum and energy
148  G4double GetDeltaTime() const;
149 
150  // These methods will be deleted
151  // NOTE: use GetTotalEnergyDeposit() to obtain
152  // energy loss in the material
153  //
155  G4double GetDeltaEnergy() const;
156 
157 
158 // Other member functions
159  void InitializeStep( G4Track* aValue );
160  // initiaize contents of G4Step
161 
162  void UpdateTrack( );
163  // update track by using G4Step information
164 
165  void CopyPostToPreStepPoint( );
166  // copy PostStepPoint to PreStepPoint
167 
168  G4Polyline* CreatePolyline () const;
169  // for visualization
170 
171 //-----------
172  protected:
173 //-----------
174 
175 // Member data
177  // Accummulated total energy desposit in the current Step
178 
180  // Accummulated non-ionizing energy desposit in the current Step
181 
182 //---------
183  private:
184 //---------
185 
186 // Member data
190  // Step length which may be updated at each invocation of
191  // AlongStepDoIt and PostStepDoIt
193  //
195  // A flag to control SteppingManager behavier from process
196 
197  // flag for initial/last step
200 
201 // Secondary buckets
202 public:
203  // secodaries in the current step
204  const std::vector<const G4Track*>* GetSecondaryInCurrentStep() const;
205 
206  // NOTE: Secondary bucket of the Step contains
207  // all secondaries during tracking the current track
208  // (i.e. NOT secondaries produced in the current step)
209  // all following methods give same object (i.e. G4TrackVector )
210  // but 2nd one will create bucket in addition
211  const G4TrackVector* GetSecondary() const ;
214 
215  // just delete secondary bucket
216  // NOTE: G4Track objects inside the bucket are not deleted
217  void DeleteSecondaryVector();
218 
219  // Add secondary tracks to the bucket
220  void SetSecondary( G4TrackVector* value);
221 
222 private:
223  // Secondaty bucket implemented by using std::vector of G4Track*
225 
226  // number of secondaries which have been created by the last step
228 
229  typedef const G4Track* CT;
230  std::vector<CT>* secondaryInCurrentStep;
231 
232  // Prototyping implementation of smooth representation of curved
233  // trajectories. (jacek 30/10/2002)
234 public:
235  // Auxiliary points are ThreeVectors for now; change to
236  // G4VAuxiliaryPoints or some such (jacek 30/10/2002)
237  void SetPointerToVectorOfAuxiliaryPoints( std::vector<G4ThreeVector>* theNewVectorPointer ) {
238  fpVectorOfAuxiliaryPointsPointer = theNewVectorPointer;
239  }
240  std::vector<G4ThreeVector>* GetPointerToVectorOfAuxiliaryPoints() const {
242  }
243 private:
244  // Explicity including the word "Pointer" in the name as I keep
245  // forgetting the * (jacek 30/10/2002)
246  std::vector<G4ThreeVector>* fpVectorOfAuxiliaryPointsPointer;
247 
248 };
249 
250 #include "G4Step.icc"
251 
252 
253 #endif
G4double GetDeltaEnergy() const
Definition: G4Step.cc:176
void SetFirstStepFlag()
void SetStepLength(G4double value)
const G4Track * CT
Definition: G4Step.hh:229
G4double fTotalEnergyDeposit
Definition: G4Step.hh:176
void AddNonIonizingEnergyDeposit(G4double value)
void SetTrack(G4Track *value)
CLHEP::Hep3Vector G4ThreeVector
G4StepPoint * fpPostStepPoint
Definition: G4Step.hh:188
G4double GetStepLength() const
void DeleteSecondaryVector()
G4double fNonIonizingEnergyDeposit
Definition: G4Step.hh:179
void SetLastStepFlag()
G4SteppingControl
G4double GetNonIonizingEnergyDeposit() const
G4SteppingControl GetControlFlag() const
void SetSecondary(G4TrackVector *value)
std::vector< CT > * secondaryInCurrentStep
Definition: G4Step.hh:230
void SetPointerToVectorOfAuxiliaryPoints(std::vector< G4ThreeVector > *theNewVectorPointer)
Definition: G4Step.hh:237
void ClearLastStepFlag()
void ClearFirstStepFlag()
int G4int
Definition: G4Types.hh:78
G4StepPoint * GetPreStepPoint() const
G4StepPoint * fpPreStepPoint
Definition: G4Step.hh:187
void UpdateTrack()
G4TrackVector * NewSecondaryVector()
void SetControlFlag(G4SteppingControl StepControlFlag)
bool G4bool
Definition: G4Types.hh:79
G4Step()
Definition: G4Step.cc:53
void ResetTotalEnergyDeposit()
G4TrackVector * fSecondary
Definition: G4Step.hh:224
G4Track * fpTrack
Definition: G4Step.hh:192
void SetPreStepPoint(G4StepPoint *value)
G4bool fLastStepInVolume
Definition: G4Step.hh:199
G4int nSecondaryByLastStep
Definition: G4Step.hh:227
G4ThreeVector GetDeltaMomentum() const
Definition: G4Step.cc:159
Definition: G4Step.hh:76
G4double GetDeltaTime() const
const std::vector< const G4Track * > * GetSecondaryInCurrentStep() const
Definition: G4Step.cc:193
G4Step & operator=(const G4Step &)
Definition: G4Step.cc:122
void SetPostStepPoint(G4StepPoint *value)
G4double GetTotalEnergyDeposit() const
void ResetNonIonizingEnergyDeposit()
G4double fStepLength
Definition: G4Step.hh:189
G4TrackVector * GetfSecondary()
G4Polyline * CreatePolyline() const
std::vector< G4Track * > G4TrackVector
G4StepPoint * GetPostStepPoint() const
std::vector< G4ThreeVector > * GetPointerToVectorOfAuxiliaryPoints() const
Definition: G4Step.hh:240
void AddTotalEnergyDeposit(G4double value)
void SetNonIonizingEnergyDeposit(G4double value)
void SetTotalEnergyDeposit(G4double value)
G4bool fFirstStepInVolume
Definition: G4Step.hh:198
void InitializeStep(G4Track *aValue)
std::vector< G4ThreeVector > * fpVectorOfAuxiliaryPointsPointer
Definition: G4Step.hh:246
~G4Step()
Definition: G4Step.cc:71
double G4double
Definition: G4Types.hh:76
G4SteppingControl fpSteppingControlFlag
Definition: G4Step.hh:194
G4Track * GetTrack() const
G4ThreeVector GetDeltaPosition() const
G4bool IsFirstStepInVolume() const
G4bool IsLastStepInVolume() const
const G4TrackVector * GetSecondary() const
void CopyPostToPreStepPoint()