| 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: G4Track.hh,v 1.22 2010/08/11 17:11:54 kurasige Exp $
|
|---|
| 28 | // GEANT4 tag $Name: track-V09-03-09 $
|
|---|
| 29 | //
|
|---|
| 30 | //
|
|---|
| 31 | //---------------------------------------------------------------
|
|---|
| 32 | //
|
|---|
| 33 | // G4Track.hh
|
|---|
| 34 | //
|
|---|
| 35 | // Class Description:
|
|---|
| 36 | // This class represents the partilce under tracking.
|
|---|
| 37 | // It includes information related to tracking for examples:
|
|---|
| 38 | // 1) current position/time of the particle,
|
|---|
| 39 | // 2) static particle information,
|
|---|
| 40 | // 3) the pointer to the physical volume where currently
|
|---|
| 41 | // the particle exists
|
|---|
| 42 | //
|
|---|
| 43 | //---------------------------------------------------------------
|
|---|
| 44 | // Modification for G4TouchableHandle 22 Oct. 2001 R.Chytracek
|
|---|
| 45 | // Add MaterialCutCouple 08 Oct. 2002 H.Kurashige
|
|---|
| 46 |
|
|---|
| 47 | #ifndef G4Track_h
|
|---|
| 48 | #define G4Track_h 1
|
|---|
| 49 |
|
|---|
| 50 | #include "globals.hh" // Include from 'global'
|
|---|
| 51 | #include <cmath> // Include from 'system'
|
|---|
| 52 | #include "G4ThreeVector.hh" // Include from 'geometry'
|
|---|
| 53 | #include "G4LogicalVolume.hh" // Include from 'geometry'
|
|---|
| 54 | #include "G4VPhysicalVolume.hh" // Include from 'geometry'
|
|---|
| 55 | #include "G4Allocator.hh" // Include from 'particle+matter'
|
|---|
| 56 | #include "G4DynamicParticle.hh" // Include from 'particle+matter'
|
|---|
| 57 | #include "G4TrackStatus.hh" // Include from 'tracking'
|
|---|
| 58 | #include "G4TouchableHandle.hh" // Include from 'geometry'
|
|---|
| 59 | #include "G4VUserTrackInformation.hh"
|
|---|
| 60 |
|
|---|
| 61 | #include "G4PhysicsLogVector.hh"
|
|---|
| 62 |
|
|---|
| 63 | #include "G4Material.hh"
|
|---|
| 64 |
|
|---|
| 65 | class G4Step; // Forward declaration
|
|---|
| 66 | class G4MaterialCutsCouple;
|
|---|
| 67 |
|
|---|
| 68 | //////////////
|
|---|
| 69 | class G4Track
|
|---|
| 70 | //////////////
|
|---|
| 71 | {
|
|---|
| 72 |
|
|---|
| 73 | //--------
|
|---|
| 74 | public: // With description
|
|---|
| 75 |
|
|---|
| 76 | // Constructor
|
|---|
| 77 | G4Track();
|
|---|
| 78 | G4Track(G4DynamicParticle* apValueDynamicParticle,
|
|---|
| 79 | G4double aValueTime,
|
|---|
| 80 | const G4ThreeVector& aValuePosition);
|
|---|
| 81 | // aValueTime is a global time
|
|---|
| 82 | G4Track(const G4Track&);
|
|---|
| 83 | // Copy Constructor copys members other than tracking information
|
|---|
| 84 |
|
|---|
| 85 | private:
|
|---|
| 86 | // Hide assignment operator as private
|
|---|
| 87 | G4Track& operator=(const G4Track&);
|
|---|
| 88 |
|
|---|
| 89 | //--------
|
|---|
| 90 | public: // With description
|
|---|
| 91 |
|
|---|
| 92 | // Destrcutor
|
|---|
| 93 | ~G4Track();
|
|---|
| 94 |
|
|---|
| 95 | // Operators
|
|---|
| 96 | inline void *operator new(size_t);
|
|---|
| 97 | // Override "new" for "G4Allocator".
|
|---|
| 98 | inline void operator delete(void *aTrack);
|
|---|
| 99 | // Override "delete" for "G4Allocator".
|
|---|
| 100 |
|
|---|
| 101 | G4bool operator==( const G4Track& );
|
|---|
| 102 |
|
|---|
| 103 | //--------
|
|---|
| 104 | public: // With description
|
|---|
| 105 | // Copy information of the track (w/o tracking information)
|
|---|
| 106 | void CopyTrackInfo(const G4Track&);
|
|---|
| 107 |
|
|---|
| 108 | // Get/Set functions
|
|---|
| 109 | // track ID
|
|---|
| 110 | G4int GetTrackID() const;
|
|---|
| 111 | void SetTrackID(const G4int aValue);
|
|---|
| 112 |
|
|---|
| 113 | G4int GetParentID() const;
|
|---|
| 114 | void SetParentID(const G4int aValue);
|
|---|
| 115 |
|
|---|
| 116 | // dynamic particle
|
|---|
| 117 | const G4DynamicParticle* GetDynamicParticle() const;
|
|---|
| 118 |
|
|---|
| 119 | // particle definition
|
|---|
| 120 | const G4ParticleDefinition* GetParticleDefinition() const;
|
|---|
| 121 | // following method of GetDefinition remains
|
|---|
| 122 | // because of backward compatiblity. It will be removed in future
|
|---|
| 123 | G4ParticleDefinition* GetDefinition() const;
|
|---|
| 124 |
|
|---|
| 125 | // position, time
|
|---|
| 126 | const G4ThreeVector& GetPosition() const;
|
|---|
| 127 | void SetPosition(const G4ThreeVector& aValue);
|
|---|
| 128 |
|
|---|
| 129 | G4double GetGlobalTime() const;
|
|---|
| 130 | void SetGlobalTime(const G4double aValue);
|
|---|
| 131 | // Time since the event in which the track belongs is created.
|
|---|
| 132 |
|
|---|
| 133 | G4double GetLocalTime() const;
|
|---|
| 134 | void SetLocalTime(const G4double aValue);
|
|---|
| 135 | // Time since the current track is created.
|
|---|
| 136 |
|
|---|
| 137 | G4double GetProperTime() const;
|
|---|
| 138 | void SetProperTime(const G4double aValue);
|
|---|
| 139 | // Proper time of the current track
|
|---|
| 140 |
|
|---|
| 141 | // volume, material, touchable
|
|---|
| 142 | G4VPhysicalVolume* GetVolume() const;
|
|---|
| 143 | G4VPhysicalVolume* GetNextVolume() const;
|
|---|
| 144 |
|
|---|
| 145 | G4Material* GetMaterial() const;
|
|---|
| 146 | G4Material* GetNextMaterial() const;
|
|---|
| 147 |
|
|---|
| 148 | const G4MaterialCutsCouple* GetMaterialCutsCouple() const;
|
|---|
| 149 | const G4MaterialCutsCouple* GetNextMaterialCutsCouple() const;
|
|---|
| 150 |
|
|---|
| 151 | const G4VTouchable* GetTouchable() const;
|
|---|
| 152 | const G4TouchableHandle& GetTouchableHandle() const;
|
|---|
| 153 | void SetTouchableHandle( const G4TouchableHandle& apValue);
|
|---|
| 154 |
|
|---|
| 155 | const G4VTouchable* GetNextTouchable() const;
|
|---|
| 156 | const G4TouchableHandle& GetNextTouchableHandle() const;
|
|---|
| 157 | void SetNextTouchableHandle( const G4TouchableHandle& apValue);
|
|---|
| 158 |
|
|---|
| 159 | // energy
|
|---|
| 160 | G4double GetKineticEnergy() const;
|
|---|
| 161 | void SetKineticEnergy(const G4double aValue);
|
|---|
| 162 |
|
|---|
| 163 | G4double GetTotalEnergy() const;
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 | // moemtnum
|
|---|
| 167 | const G4ThreeVector& GetMomentumDirection() const;
|
|---|
| 168 | void SetMomentumDirection(const G4ThreeVector& aValue);
|
|---|
| 169 |
|
|---|
| 170 | G4ThreeVector GetMomentum() const;
|
|---|
| 171 |
|
|---|
| 172 | G4double GetVelocity() const;
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 | // polarization
|
|---|
| 176 | const G4ThreeVector& GetPolarization() const;
|
|---|
| 177 | void SetPolarization(const G4ThreeVector& aValue);
|
|---|
| 178 |
|
|---|
| 179 | // track status, flags for tracking
|
|---|
| 180 | G4TrackStatus GetTrackStatus() const;
|
|---|
| 181 | void SetTrackStatus(const G4TrackStatus aTrackStatus);
|
|---|
| 182 |
|
|---|
| 183 | G4bool IsBelowThreshold() const;
|
|---|
| 184 | void SetBelowThresholdFlag(G4bool value = true);
|
|---|
| 185 | // The flag of "BelowThreshold" is set to true
|
|---|
| 186 | // if this track energy is below threshold energy
|
|---|
| 187 | // in this material determined by the range cut value
|
|---|
| 188 |
|
|---|
| 189 | G4bool IsGoodForTracking() const;
|
|---|
| 190 | void SetGoodForTrackingFlag(G4bool value = true);
|
|---|
| 191 | // The flag of "GoodForTracking" is set by processes
|
|---|
| 192 | // if this track should be tracked
|
|---|
| 193 | // even if the energy is below threshold
|
|---|
| 194 |
|
|---|
| 195 | // track length
|
|---|
| 196 | G4double GetTrackLength() const;
|
|---|
| 197 | void AddTrackLength(const G4double aValue);
|
|---|
| 198 | // Accumulated the track length
|
|---|
| 199 |
|
|---|
| 200 | // step information
|
|---|
| 201 | const G4Step* GetStep() const;
|
|---|
| 202 | void SetStep(const G4Step* aValue);
|
|---|
| 203 |
|
|---|
| 204 | G4int GetCurrentStepNumber() const;
|
|---|
| 205 | void IncrementCurrentStepNumber();
|
|---|
| 206 |
|
|---|
| 207 | G4double GetStepLength() const;
|
|---|
| 208 | void SetStepLength(G4double value);
|
|---|
| 209 | // Before the end of the AlongStepDoIt loop,StepLength keeps
|
|---|
| 210 | // the initial value which is determined by the shortest geometrical Step
|
|---|
| 211 | // proposed by a physics process. After finishing the AlongStepDoIt,
|
|---|
| 212 | // it will be set equal to 'StepLength' in G4Step.
|
|---|
| 213 |
|
|---|
| 214 | // vertex (,where this track was created) information
|
|---|
| 215 | const G4ThreeVector& GetVertexPosition() const;
|
|---|
| 216 | void SetVertexPosition(const G4ThreeVector& aValue);
|
|---|
| 217 |
|
|---|
| 218 | const G4ThreeVector& GetVertexMomentumDirection() const;
|
|---|
| 219 | void SetVertexMomentumDirection(const G4ThreeVector& aValue);
|
|---|
| 220 |
|
|---|
| 221 | G4double GetVertexKineticEnergy() const;
|
|---|
| 222 | void SetVertexKineticEnergy(const G4double aValue);
|
|---|
| 223 |
|
|---|
| 224 | const G4LogicalVolume* GetLogicalVolumeAtVertex() const;
|
|---|
| 225 | void SetLogicalVolumeAtVertex(const G4LogicalVolume* );
|
|---|
| 226 |
|
|---|
| 227 | const G4VProcess* GetCreatorProcess() const;
|
|---|
| 228 | void SetCreatorProcess(const G4VProcess* aValue);
|
|---|
| 229 |
|
|---|
| 230 | // track weight
|
|---|
| 231 | // These are methods for manipulating a weight for this track.
|
|---|
| 232 | G4double GetWeight() const;
|
|---|
| 233 | void SetWeight(G4double aValue);
|
|---|
| 234 |
|
|---|
| 235 | // User information
|
|---|
| 236 | G4VUserTrackInformation* GetUserInformation() const;
|
|---|
| 237 | void SetUserInformation(G4VUserTrackInformation* aValue);
|
|---|
| 238 |
|
|---|
| 239 | //---------
|
|---|
| 240 | private:
|
|---|
| 241 | //---------
|
|---|
| 242 | // prepare velocity table
|
|---|
| 243 | void PrepareVelocityTable();
|
|---|
| 244 |
|
|---|
| 245 | // Member data
|
|---|
| 246 | G4int fCurrentStepNumber; // Total steps number up to now
|
|---|
| 247 | G4ThreeVector fPosition; // Current positon
|
|---|
| 248 | G4double fGlobalTime; // Time since the event is created
|
|---|
| 249 | G4double fLocalTime; // Time since the track is created
|
|---|
| 250 | G4double fTrackLength; // Accumulated track length
|
|---|
| 251 | G4int fParentID;
|
|---|
| 252 | G4int fTrackID;
|
|---|
| 253 |
|
|---|
| 254 | G4TouchableHandle fpTouchable;
|
|---|
| 255 | G4TouchableHandle fpNextTouchable;
|
|---|
| 256 | // Touchable Handle
|
|---|
| 257 |
|
|---|
| 258 | G4DynamicParticle* fpDynamicParticle;
|
|---|
| 259 | G4TrackStatus fTrackStatus;
|
|---|
| 260 |
|
|---|
| 261 | G4bool fBelowThreshold;
|
|---|
| 262 | // This flag is set to true if this track energy is below
|
|---|
| 263 | // threshold energy in this material determined by the range cut value
|
|---|
| 264 | G4bool fGoodForTracking;
|
|---|
| 265 | // This flag is set by processes if this track should be tracked
|
|---|
| 266 | // even if the energy is below threshold
|
|---|
| 267 |
|
|---|
| 268 | G4double fStepLength;
|
|---|
| 269 | // Before the end of the AlongStepDoIt loop, this keeps the initial
|
|---|
| 270 | // Step length which is determined by the shortest geometrical Step
|
|---|
| 271 | // proposed by a physics process. After finishing the AlongStepDoIt,
|
|---|
| 272 | // this will be set equal to 'StepLength' in G4Step.
|
|---|
| 273 |
|
|---|
| 274 | G4double fWeight;
|
|---|
| 275 | // This is a weight for this track
|
|---|
| 276 |
|
|---|
| 277 | const G4Step* fpStep;
|
|---|
| 278 |
|
|---|
| 279 | G4ThreeVector fVtxPosition; // (x,y,z) of the vertex
|
|---|
| 280 | G4ThreeVector fVtxMomentumDirection; // Momentum direction at the vertex
|
|---|
| 281 | G4double fVtxKineticEnergy; // Kinetic energy at the vertex
|
|---|
| 282 | const G4LogicalVolume* fpLVAtVertex; //Logical Volume at the vertex
|
|---|
| 283 | const G4VProcess* fpCreatorProcess; // Process which created the track
|
|---|
| 284 |
|
|---|
| 285 | G4VUserTrackInformation* fpUserInformation;
|
|---|
| 286 |
|
|---|
| 287 | mutable G4Material* prev_mat;
|
|---|
| 288 | mutable G4MaterialPropertyVector* groupvel;
|
|---|
| 289 | mutable G4double prev_velocity;
|
|---|
| 290 | mutable G4double prev_momentum;
|
|---|
| 291 |
|
|---|
| 292 | static G4PhysicsLogVector* velTable;
|
|---|
| 293 | static const G4double maxT;
|
|---|
| 294 | static const G4double minT;
|
|---|
| 295 | G4bool is_OpticalPhoton;
|
|---|
| 296 | };
|
|---|
| 297 |
|
|---|
| 298 | #include "G4Track.icc"
|
|---|
| 299 |
|
|---|
| 300 | #endif
|
|---|
| 301 |
|
|---|
| 302 |
|
|---|
| 303 |
|
|---|
| 304 |
|
|---|
| 305 |
|
|---|
| 306 |
|
|---|
| 307 |
|
|---|
| 308 |
|
|---|
| 309 |
|
|---|
| 310 |
|
|---|
| 311 |
|
|---|
| 312 |
|
|---|
| 313 |
|
|---|
| 314 |
|
|---|
| 315 |
|
|---|