Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
G4Track.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$
28//
29//
30//---------------------------------------------------------------
31//
32// G4Track.hh
33//
34// Class Description:
35// This class represents the partilce under tracking.
36// It includes information related to tracking for examples:
37// 1) current position/time of the particle,
38// 2) static particle information,
39// 3) the pointer to the physical volume where currently
40// the particle exists
41//
42//---------------------------------------------------------------
43// Modification for G4TouchableHandle 22 Oct. 2001 R.Chytracek
44// Add MaterialCutCouple 08 Oct. 2002 H.Kurashige
45// Add SetVelocityTableProperties 02 Apr. 2011 H.Kurashige
46// Add fVelocity and Set/GetVelocity 29 Apr. 2011 H.Kurashige
47// Use G4VelocityTable 17 AUg. 2011 H.Kurashige
48
49#ifndef G4Track_h
50#define G4Track_h 1
51
52#include "globals.hh" // Include from 'global'
53#include <cmath> // Include from 'system'
54#include "G4ThreeVector.hh" // Include from 'geometry'
55#include "G4LogicalVolume.hh" // Include from 'geometry'
56#include "G4VPhysicalVolume.hh" // Include from 'geometry'
57#include "G4Allocator.hh" // Include from 'particle+matter'
58#include "G4DynamicParticle.hh" // Include from 'particle+matter'
59#include "G4TrackStatus.hh" // Include from 'tracking'
60#include "G4TouchableHandle.hh" // Include from 'geometry'
62
63#include "G4Material.hh"
64
65class G4Step; // Forward declaration
67class G4VelocityTable;
68
69//////////////
71//////////////
72{
73
74//--------
75public: // With description
76
77// Constructor
78 G4Track();
79 G4Track(G4DynamicParticle* apValueDynamicParticle,
80 G4double aValueTime,
81 const G4ThreeVector& aValuePosition);
82 // aValueTime is a global time
83 G4Track(const G4Track&);
84 // Copy Constructor copys members other than tracking information
85
86private:
87 // Hide assignment operator as private
88 G4Track& operator=(const G4Track&);
89
90//--------
91public: // With description
92
93// Destrcutor
94 ~G4Track();
95
96// Operators
97 inline void *operator new(size_t);
98 // Override "new" for "G4Allocator".
99 inline void operator delete(void *aTrack);
100 // Override "delete" for "G4Allocator".
101
103
104//--------
105public: // With description
106// Copy information of the track (w/o tracking information)
107 void CopyTrackInfo(const G4Track&);
108
109// Get/Set functions
110 // track ID
112 void SetTrackID(const G4int aValue);
113
115 void SetParentID(const G4int aValue);
116
117 // dynamic particle
119
120 // particle definition
122 // following method of GetDefinition remains
123 // because of backward compatiblity. It will be removed in future
125
126 // position, time
128 void SetPosition(const G4ThreeVector& aValue);
129
131 void SetGlobalTime(const G4double aValue);
132 // Time since the event in which the track belongs is created.
133
135 void SetLocalTime(const G4double aValue);
136 // Time since the current track is created.
137
139 void SetProperTime(const G4double aValue);
140 // Proper time of the current track
141
142 // volume, material, touchable
145
148
151
155
159
163
164 // energy
166 void SetKineticEnergy(const G4double aValue);
167
169
170
171 // moemtnum
174
176
177 // velocity
180
183
186
187 // polarization
189 void SetPolarization(const G4ThreeVector& aValue);
190
191 // track status, flags for tracking
193 void SetTrackStatus(const G4TrackStatus aTrackStatus);
194
196 void SetBelowThresholdFlag(G4bool value = true);
197 // The flag of "BelowThreshold" is set to true
198 // if this track energy is below threshold energy
199 // in this material determined by the range cut value
200
202 void SetGoodForTrackingFlag(G4bool value = true);
203 // The flag of "GoodForTracking" is set by processes
204 // if this track should be tracked
205 // even if the energy is below threshold
206
207 // track length
209 void AddTrackLength(const G4double aValue);
210 // Accumulated the track length
211
212 // step information
213 const G4Step* GetStep() const;
214 void SetStep(const G4Step* aValue);
215
218
221 // Before the end of the AlongStepDoIt loop,StepLength keeps
222 // the initial value which is determined by the shortest geometrical Step
223 // proposed by a physics process. After finishing the AlongStepDoIt,
224 // it will be set equal to 'StepLength' in G4Step.
225
226 // vertex (,where this track was created) information
228 void SetVertexPosition(const G4ThreeVector& aValue);
229
232
235
238
240 void SetCreatorProcess(const G4VProcess* aValue);
241
242 // track weight
243 // These are methods for manipulating a weight for this track.
245 void SetWeight(G4double aValue);
246
247 // User information
250
251 // Velocity table
252 static void SetVelocityTableProperties(G4double t_max, G4double t_min, G4int nbin);
256
257//---------
258 private:
259//---------
260 // Member data
261 G4int fCurrentStepNumber; // Total steps number up to now
262 G4ThreeVector fPosition; // Current positon
263 G4double fGlobalTime; // Time since the event is created
264 G4double fLocalTime; // Time since the track is created
265 G4double fTrackLength; // Accumulated track length
266 G4int fParentID;
267 G4int fTrackID;
268 G4double fVelocity;
269
270 G4TouchableHandle fpTouchable;
271 G4TouchableHandle fpNextTouchable;
272 G4TouchableHandle fpOriginTouchable;
273 // Touchable Handle
274
275 G4DynamicParticle* fpDynamicParticle;
276 G4TrackStatus fTrackStatus;
277
278 G4bool fBelowThreshold;
279 // This flag is set to true if this track energy is below
280 // threshold energy in this material determined by the range cut value
281 G4bool fGoodForTracking;
282 // This flag is set by processes if this track should be tracked
283 // even if the energy is below threshold
284
285 G4double fStepLength;
286 // Before the end of the AlongStepDoIt loop, this keeps the initial
287 // Step length which is determined by the shortest geometrical Step
288 // proposed by a physics process. After finishing the AlongStepDoIt,
289 // this will be set equal to 'StepLength' in G4Step.
290
291 G4double fWeight;
292 // This is a weight for this track
293
294 const G4Step* fpStep;
295
296 G4ThreeVector fVtxPosition; // (x,y,z) of the vertex
297 G4ThreeVector fVtxMomentumDirection; // Momentum direction at the vertex
298 G4double fVtxKineticEnergy; // Kinetic energy at the vertex
299 const G4LogicalVolume* fpLVAtVertex; //Logical Volume at the vertex
300 const G4VProcess* fpCreatorProcess; // Process which created the track
301
302 G4VUserTrackInformation* fpUserInformation;
303
304 // cached values for CalculateVelocity
305 mutable G4Material* prev_mat;
306 mutable G4MaterialPropertyVector* groupvel;
307 mutable G4double prev_velocity;
308 mutable G4double prev_momentum;
309
310 G4bool is_OpticalPhoton;
311 static G4VelocityTable* velTable;
312
313 G4bool useGivenVelocity;
314 // do not calclulate velocity and just use current fVelocity
315 // if this flag is set
316
317};
318
319#include "G4Track.icc"
320
321#endif
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
G4TrackStatus
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
Definition: G4Step.hh:78
void SetVelocity(G4double val)
G4Material * GetNextMaterial() const
G4TrackStatus GetTrackStatus() const
void SetTrackStatus(const G4TrackStatus aTrackStatus)
void SetStepLength(G4double value)
void SetPosition(const G4ThreeVector &aValue)
G4double GetVelocity() const
void SetPolarization(const G4ThreeVector &aValue)
G4double CalculateVelocityForOpticalPhoton() const
Definition: G4Track.cc:243
const G4MaterialCutsCouple * GetNextMaterialCutsCouple() const
G4double GetVertexKineticEnergy() const
G4int GetTrackID() const
void SetStep(const G4Step *aValue)
const G4ParticleDefinition * GetParticleDefinition() const
G4VPhysicalVolume * GetVolume() const
void SetVertexPosition(const G4ThreeVector &aValue)
const G4TouchableHandle & GetNextTouchableHandle() const
const G4VProcess * GetCreatorProcess() const
void SetVertexMomentumDirection(const G4ThreeVector &aValue)
const G4LogicalVolume * GetLogicalVolumeAtVertex() const
G4VPhysicalVolume * GetNextVolume() const
static G4double GetMinTOfVelocityTable()
Definition: G4Track.cc:302
void SetNextTouchableHandle(const G4TouchableHandle &apValue)
G4bool UseGivenVelocity() const
void CopyTrackInfo(const G4Track &)
Definition: G4Track.cc:203
G4double GetWeight() const
void SetWeight(G4double aValue)
const G4ThreeVector & GetPosition() const
G4double GetTrackLength() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
const G4ThreeVector & GetVertexMomentumDirection() const
G4double GetGlobalTime() const
G4double GetProperTime() const
G4int GetCurrentStepNumber() const
static G4double GetMaxTOfVelocityTable()
Definition: G4Track.cc:297
G4ThreeVector GetMomentum() const
const G4ThreeVector & GetVertexPosition() const
const G4VTouchable * GetOriginTouchable() const
G4double GetLocalTime() const
void SetOriginTouchableHandle(const G4TouchableHandle &apValue)
G4Material * GetMaterial() const
G4ParticleDefinition * GetDefinition() const
void SetLocalTime(const G4double aValue)
void AddTrackLength(const G4double aValue)
const G4DynamicParticle * GetDynamicParticle() const
const G4TouchableHandle & GetTouchableHandle() const
const G4ThreeVector & GetMomentumDirection() const
G4VUserTrackInformation * GetUserInformation() const
G4double GetKineticEnergy() const
G4double CalculateVelocity() const
Definition: G4Track.cc:210
const G4ThreeVector & GetPolarization() const
G4Track()
Definition: G4Track.cc:94
void SetBelowThresholdFlag(G4bool value=true)
G4double GetStepLength() const
void UseGivenVelocity(G4bool val)
void SetVertexKineticEnergy(const G4double aValue)
static G4int GetNbinOfVelocityTable()
Definition: G4Track.cc:307
void SetTrackID(const G4int aValue)
G4int GetParentID() const
void IncrementCurrentStepNumber()
void SetKineticEnergy(const G4double aValue)
G4bool IsBelowThreshold() const
void SetMomentumDirection(const G4ThreeVector &aValue)
const G4TouchableHandle & GetOriginTouchableHandle() const
void SetLogicalVolumeAtVertex(const G4LogicalVolume *)
const G4MaterialCutsCouple * GetMaterialCutsCouple() const
const G4VTouchable * GetNextTouchable() const
G4bool operator==(const G4Track &)
const G4VTouchable * GetTouchable() const
G4double GetTotalEnergy() const
const G4Step * GetStep() const
G4bool IsGoodForTracking() const
void SetProperTime(const G4double aValue)
void SetGlobalTime(const G4double aValue)
~G4Track()
Definition: G4Track.cc:140
void SetUserInformation(G4VUserTrackInformation *aValue)
void SetParentID(const G4int aValue)
static void SetVelocityTableProperties(G4double t_max, G4double t_min, G4int nbin)
Definition: G4Track.cc:289
void SetGoodForTrackingFlag(G4bool value=true)
void SetCreatorProcess(const G4VProcess *aValue)