ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4Step.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4Step.hh
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 // This class represents the Step of a particle being tracked.
30 // It includes information of
31 // 1) List of Step points which compose the Step,
32 // 2) static information of particle which generated the
33 // Step,
34 // 3) trackID and parent particle ID of the Step,
35 // 4) termination condition of the Step,
36 
37 // Contact:
38 // Questions and comments to this code should be sent to
39 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
40 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
41 //
42 // ---------------------------------------------------------------
43 // Modified for the new G4ParticleChange 12 Mar. 1998 H.Kurahige
44 // Correct treatment of touchable in G4Step::UpdateTrack
45 // 12 May. 1998 H.Kurashige
46 // ---------------------------------------------------------------
47 // Separate implementation of inline functions inti G4Step.icc
48 // Add updating mass/charge 6 Oct. 1999 H.Kurashige
49 // add nonIonizingEnergyLoss 26 Mar. 2007 H.Kurashige
50 // ---------------------------------------------------------------
51 #ifndef G4Step_hh
52 #define G4Step_hh 1
53 
54 #include <stdlib.h> // Include from 'system'
55 #include <cmath> // Include from 'system'
56 #include "G4ios.hh" // Include from 'system'
57 #include <iomanip> // Include from 'system'
58 #include "globals.hh" // Include from 'global'
59 #include "G4ThreeVector.hh" // Include from 'global'
60 #include "G4VPhysicalVolume.hh" // Include from 'geometry'
61 #include "G4StepPoint.hh" // Include from 'track'
62 #include "G4StepStatus.hh" // Include from 'track'
63 class G4Polyline; // Forward declaration.
64 class G4Track; // Forward declaration.
65 #include "G4TrackVector.hh" // Include from 'tracking'
66 
68 class G4Step
70 {
71 
72 //--------
73  public:
74 
75  // Constructor/Destrcutor
76  G4Step();
77  ~G4Step();
78 
79  // Copy Counstructor and assignment operator
80  G4Step(const G4Step& );
81  G4Step & operator=(const G4Step &);
82 
83 //--------
84  public: // with description
85 
86  // Get/Set functions
87 
88  // current track
89  G4Track* GetTrack() const;
90  void SetTrack(G4Track* value);
91 
92  // step points
94  void SetPreStepPoint(G4StepPoint* value);
95 
97  void SetPostStepPoint(G4StepPoint* value);
98 
99  // step length
100  G4double GetStepLength() const;
101  void SetStepLength(G4double value);
102  // Before the end of the AlongStepDoIt loop,StepLength keeps
103  // the initial value which is determined by the shortest geometrical Step
104  // proposed by a physics process. After finishing the AlongStepDoIt,
105  // it will be set equal to 'StepLength' in G4Step.
106 
107  // total energy deposit
109  void SetTotalEnergyDeposit(G4double value);
110 
111  // total non-ionizing energy deposit
114 
115  // control flag for stepping
117  void SetControlFlag(G4SteppingControl StepControlFlag);
118 
119  // manipulation of total energy deposit
120  void AddTotalEnergyDeposit(G4double value);
122 
123  // manipulation of non-ionizing energy deposit
126 
127 
128  // Get/Set/Clear flag for initial/last step
129  // NOTE: following flags are not used
130  G4bool IsFirstStepInVolume() const;
131  G4bool IsLastStepInVolume() const;
132 
133  void SetFirstStepFlag();
134  void ClearFirstStepFlag();
135  void SetLastStepFlag();
136  void ClearLastStepFlag();
137 
138  // difference of position, time, momentum and energy
140  G4double GetDeltaTime() const;
141 
142  // These methods will be deleted
143  // NOTE: use GetTotalEnergyDeposit() to obtain
144  // energy loss in the material
145  //
147  G4double GetDeltaEnergy() const;
148 
149  // Other member functions
150 
151  void InitializeStep( G4Track* aValue );
152  // initialize contents of G4Step
153 
154  void UpdateTrack( );
155  // update track by using G4Step information
156 
157  void CopyPostToPreStepPoint( );
158  // copy PostStepPoint to PreStepPoint
159 
160  G4Polyline* CreatePolyline () const;
161  // for visualization
162 
163 //-----------
164  protected:
165 //-----------
166 
167  // Member data
168 
170  // Accumulated total energy deposit in the current Step
171 
173  // Accumulated non-ionizing energy deposit in the current Step
174 
175 //---------
176  private:
177 //---------
178 
179  // Member data
180 
184  // Step length which may be updated at each invocation of
185  // AlongStepDoIt and PostStepDoIt
187  //
189  // A flag to control SteppingManager behavior from process
190 
191  // flag for initial/last step
194 
195  // Secondary buckets
196 
197  public:
198 
199  // secondaries in the current step
201 
202  const std::vector<const G4Track*>* GetSecondaryInCurrentStep() const;
203 
204  // NOTE: Secondary bucket of the Step contains
205  // all secondaries during tracking the current track
206  // (i.e. NOT secondaries produced in the current step)
207  // all following methods give same object (i.e. G4TrackVector )
208  // but 2nd one will create bucket in addition
209  const G4TrackVector* GetSecondary() const ;
212 
213  // just delete secondary bucket
214  // NOTE: G4Track objects inside the bucket are not deleted
215  void DeleteSecondaryVector();
216 
217  // Add secondary tracks to the bucket
218  void SetSecondary( G4TrackVector* value);
219 
220  private:
221 
222  // Secondary bucket implemented by using std::vector of G4Track*
224 
225  // number of secondaries which have been created by the last step
227 
228  typedef const G4Track* CT;
229  std::vector<CT>* secondaryInCurrentStep;
230 
231  // Prototyping implementation of smooth representation of curved
232  // trajectories. (jacek 30/10/2002)
233 
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  {
239  fpVectorOfAuxiliaryPointsPointer = theNewVectorPointer;
240  }
241  std::vector<G4ThreeVector>* GetPointerToVectorOfAuxiliaryPoints() const
242  {
244  }
245 
246  private:
247  // Explicity including the word "Pointer" in the name as I keep
248  // forgetting the * (jacek 30/10/2002)
249  std::vector<G4ThreeVector>* fpVectorOfAuxiliaryPointsPointer;
250 };
251 
252 #include "G4Step.icc"
253 
254 
255 #endif