00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id: G4Track.hh,v 1.18 2006/06/29 21:14:47 gunter Exp $ 00028 // GEANT4 tag $Name: geant4-09-01-patch-01 $ 00029 // 00030 // 00031 //--------------------------------------------------------------- 00032 // 00033 // G4Track.hh 00034 // 00035 // Class Description: 00036 // This class represents the partilce under tracking. 00037 // It includes information related to tracking for examples: 00038 // 1) current position/time of the particle, 00039 // 2) static particle information, 00040 // 3) the pointer to the physical volume where currently 00041 // the particle exists 00042 // 00043 //--------------------------------------------------------------- 00044 // Modification for G4TouchableHandle 22 Oct. 2001 R.Chytracek 00045 // Add MaterialCutCouple 08 Oct. 2002 H.Kurashige 00046 00047 #ifndef G4Track_h 00048 #define G4Track_h 1 00049 00050 #include "globals.hh" // Include from 'global' 00051 #include <cmath> // Include from 'system' 00052 #include "G4ThreeVector.hh" // Include from 'geometry' 00053 #include "G4LogicalVolume.hh" // Include from 'geometry' 00054 #include "G4VPhysicalVolume.hh" // Include from 'geometry' 00055 #include "G4Allocator.hh" // Include from 'particle+matter' 00056 #include "G4DynamicParticle.hh" // Include from 'particle+matter' 00057 #include "G4TrackStatus.hh" // Include from 'tracking' 00058 #include "G4TouchableHandle.hh" // Include from 'geometry' 00059 #include "G4VUserTrackInformation.hh" 00060 00061 #include "G4Material.hh" 00062 00063 class G4Step; // Forward declaration 00064 class G4MaterialCutsCouple; 00065 00067 class G4Track 00069 { 00070 00071 //-------- 00072 public: // With description 00073 00074 // Constructor 00075 G4Track(); 00076 G4Track(G4DynamicParticle* apValueDynamicParticle, 00077 G4double aValueTime, 00078 const G4ThreeVector& aValuePosition); 00079 // aValueTime is a global time 00080 G4Track(const G4Track&); 00081 // Copy Constructor copys members other than tracking information 00082 00083 private: 00084 // Hide assignment operator as private 00085 G4Track& operator=(const G4Track&); 00086 00087 //-------- 00088 public: // With description 00089 00090 // Destrcutor 00091 ~G4Track(); 00092 00093 // Operators 00094 inline void *operator new(size_t); 00095 // Override "new" for "G4Allocator". 00096 inline void operator delete(void *aTrack); 00097 // Override "delete" for "G4Allocator". 00098 00099 G4bool operator==( const G4Track& ); 00100 00101 //-------- 00102 public: // With description 00103 // Copy information of the track (w/o tracking information) 00104 void CopyTrackInfo(const G4Track&); 00105 00106 // Get/Set functions 00107 // track ID 00108 G4int GetTrackID() const; 00109 void SetTrackID(const G4int aValue); 00110 00111 G4int GetParentID() const; 00112 void SetParentID(const G4int aValue); 00113 00114 // dynamic particle 00115 const G4DynamicParticle* GetDynamicParticle() const; 00116 00117 // particle definition 00118 G4ParticleDefinition* GetDefinition() const; 00119 00120 // position, time 00121 const G4ThreeVector& GetPosition() const; 00122 void SetPosition(const G4ThreeVector& aValue); 00123 00124 G4double GetGlobalTime() const; 00125 void SetGlobalTime(const G4double aValue); 00126 // Time since the event in which the track belongs is created. 00127 00128 G4double GetLocalTime() const; 00129 void SetLocalTime(const G4double aValue); 00130 // Time since the current track is created. 00131 00132 G4double GetProperTime() const; 00133 void SetProperTime(const G4double aValue); 00134 // Proper time of the current track 00135 00136 // volume, material, touchable 00137 G4VPhysicalVolume* GetVolume() const; 00138 G4VPhysicalVolume* GetNextVolume() const; 00139 00140 G4Material* GetMaterial() const; 00141 G4Material* GetNextMaterial() const; 00142 00143 const G4MaterialCutsCouple* GetMaterialCutsCouple() const; 00144 const G4MaterialCutsCouple* GetNextMaterialCutsCouple() const; 00145 00146 const G4VTouchable* GetTouchable() const; 00147 const G4TouchableHandle& GetTouchableHandle() const; 00148 void SetTouchableHandle( const G4TouchableHandle& apValue); 00149 00150 const G4VTouchable* GetNextTouchable() const; 00151 const G4TouchableHandle& GetNextTouchableHandle() const; 00152 void SetNextTouchableHandle( const G4TouchableHandle& apValue); 00153 00154 // energy 00155 G4double GetKineticEnergy() const; 00156 void SetKineticEnergy(const G4double aValue); 00157 00158 G4double GetTotalEnergy() const; 00159 00160 00161 // moemtnum 00162 const G4ThreeVector& GetMomentumDirection() const; 00163 void SetMomentumDirection(const G4ThreeVector& aValue); 00164 00165 G4ThreeVector GetMomentum() const; 00166 00167 G4double GetVelocity() const; 00168 00169 00170 // polarization 00171 const G4ThreeVector& GetPolarization() const; 00172 void SetPolarization(const G4ThreeVector& aValue); 00173 00174 // track status, flags for tracking 00175 G4TrackStatus GetTrackStatus() const; 00176 void SetTrackStatus(const G4TrackStatus aTrackStatus); 00177 00178 G4bool IsBelowThreshold() const; 00179 void SetBelowThresholdFlag(G4bool value = true); 00180 // The flag of "BelowThreshold" is set to true 00181 // if this track energy is below threshold energy 00182 // in this material determined by the range cut value 00183 00184 G4bool IsGoodForTracking() const; 00185 void SetGoodForTrackingFlag(G4bool value = true); 00186 // The flag of "GoodForTracking" is set by processes 00187 // if this track should be tracked 00188 // even if the energy is below threshold 00189 00190 // track length 00191 G4double GetTrackLength() const; 00192 void AddTrackLength(const G4double aValue); 00193 // Accumulated the track length 00194 00195 // step information 00196 const G4Step* GetStep() const; 00197 void SetStep(const G4Step* aValue); 00198 00199 G4int GetCurrentStepNumber() const; 00200 void IncrementCurrentStepNumber(); 00201 00202 G4double GetStepLength() const; 00203 void SetStepLength(G4double value); 00204 // Before the end of the AlongStepDoIt loop,StepLength keeps 00205 // the initial value which is determined by the shortest geometrical Step 00206 // proposed by a physics process. After finishing the AlongStepDoIt, 00207 // it will be set equal to 'StepLength' in G4Step. 00208 00209 // vertex (,where this track was created) information 00210 const G4ThreeVector& GetVertexPosition() const; 00211 void SetVertexPosition(const G4ThreeVector& aValue); 00212 00213 const G4ThreeVector& GetVertexMomentumDirection() const; 00214 void SetVertexMomentumDirection(const G4ThreeVector& aValue); 00215 00216 G4double GetVertexKineticEnergy() const; 00217 void SetVertexKineticEnergy(const G4double aValue); 00218 00219 G4LogicalVolume* GetLogicalVolumeAtVertex() const; 00220 void SetLogicalVolumeAtVertex(G4LogicalVolume* ); 00221 00222 const G4VProcess* GetCreatorProcess() const; 00223 void SetCreatorProcess(G4VProcess* aValue); 00224 00225 // track weight 00226 // These are methods for manipulating a weight for this track. 00227 G4double GetWeight() const; 00228 void SetWeight(G4double aValue); 00229 00230 // User information 00231 G4VUserTrackInformation* GetUserInformation() const; 00232 void SetUserInformation(G4VUserTrackInformation* aValue); 00233 00234 //--------- 00235 private: 00236 //--------- 00237 00238 // Member data 00239 G4int fCurrentStepNumber; // Total steps number up to now 00240 G4ThreeVector fPosition; // Current positon 00241 G4double fGlobalTime; // Time since the event is created 00242 G4double fLocalTime; // Time since the track is created 00243 G4double fTrackLength; // Accumulated track length 00244 G4int fParentID; 00245 G4int fTrackID; 00246 00247 G4TouchableHandle fpTouchable; 00248 G4TouchableHandle fpNextTouchable; 00249 // Touchable Handle 00250 00251 G4DynamicParticle* fpDynamicParticle; 00252 G4TrackStatus fTrackStatus; 00253 00254 G4bool fBelowThreshold; 00255 // This flag is set to true if this track energy is below 00256 // threshold energy in this material determined by the range cut value 00257 G4bool fGoodForTracking; 00258 // This flag is set by processes if this track should be tracked 00259 // even if the energy is below threshold 00260 00261 G4double fStepLength; 00262 // Before the end of the AlongStepDoIt loop, this keeps the initial 00263 // Step length which is determined by the shortest geometrical Step 00264 // proposed by a physics process. After finishing the AlongStepDoIt, 00265 // this will be set equal to 'StepLength' in G4Step. 00266 00267 G4double fWeight; 00268 // This is a weight for this track 00269 00270 const G4Step* fpStep; 00271 00272 G4ThreeVector fVtxPosition; // (x,y,z) of the vertex 00273 G4ThreeVector fVtxMomentumDirection; // Momentum direction at the vertex 00274 G4double fVtxKineticEnergy; // Kinetic energy at the vertex 00275 G4LogicalVolume* fpLVAtVertex; //Logical Volume at the vertex 00276 G4VProcess* fpCreatorProcess; // Process which created the track 00277 00278 G4VUserTrackInformation* fpUserInformation; 00279 }; 00280 #include "G4Step.hh" 00281 #include "G4Track.icc" 00282 00283 #endif 00284 00285 00286 00287 00288 00289 00290 00291 00292 00293 00294 00295 00296 00297 00298
1.4.7