source: trunk/source/track/include/G4Step.hh @ 1340

Last change on this file since 1340 was 1340, checked in by garnier, 14 years ago

update ti head

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