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