File indexing completed on 2025-09-18 09:15:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 #ifndef G4Track_hh
0041 #define G4Track_hh 1
0042
0043 #include <cmath> // Include from 'system'
0044 #include <map>
0045 #include <CLHEP/Units/PhysicalConstants.h>
0046
0047 #include "globals.hh" // Include from 'global'
0048 #include "trkdefs.hh" // Include DLL defs...
0049 #include "G4ThreeVector.hh" // Include from 'geometry'
0050 #include "G4LogicalVolume.hh" // Include from 'geometry'
0051 #include "G4VPhysicalVolume.hh" // Include from 'geometry'
0052 #include "G4Allocator.hh" // Include from 'particle+matter'
0053 #include "G4DynamicParticle.hh" // Include from 'particle+matter'
0054 #include "G4TrackStatus.hh" // Include from 'tracking'
0055 #include "G4TouchableHandle.hh" // Include from 'geometry'
0056 #include "G4VUserTrackInformation.hh"
0057 #include "G4PhysicsModelCatalog.hh"
0058 #include "G4Material.hh"
0059
0060 class G4Step;
0061 class G4MaterialCutsCouple;
0062 class G4VAuxiliaryTrackInformation;
0063 class G4VProcess;
0064
0065 class G4Track
0066 {
0067 public:
0068 G4Track();
0069
0070 G4Track(G4DynamicParticle* apValueDynamicParticle,
0071 G4double aValueTime,
0072 const G4ThreeVector& aValuePosition);
0073
0074
0075 G4Track(const G4Track&,G4bool copyTouchables = true);
0076
0077
0078 ~G4Track();
0079
0080
0081 inline void* operator new(std::size_t);
0082
0083 inline void operator delete(void* aTrack);
0084
0085
0086 G4Track& operator=(const G4Track&);
0087
0088
0089 inline G4bool operator==(const G4Track&);
0090 inline G4bool operator!=(const G4Track&);
0091
0092
0093 void CopyTrackInfo(const G4Track&, G4bool copyTouchables = true);
0094
0095
0096 inline G4int GetTrackID() const;
0097 inline void SetTrackID(const G4int aValue);
0098
0099
0100 inline G4int GetParentID() const;
0101 inline void SetParentID(const G4int aValue);
0102
0103 inline const G4DynamicParticle* GetDynamicParticle() const;
0104
0105
0106 inline const G4ParticleDefinition* GetParticleDefinition() const;
0107
0108 inline G4ParticleDefinition* GetDefinition() const;
0109
0110
0111 inline const G4ThreeVector& GetPosition() const;
0112 inline void SetPosition(const G4ThreeVector& aValue);
0113
0114
0115 inline G4double GetGlobalTime() const;
0116 inline void SetGlobalTime(const G4double aValue);
0117
0118
0119 inline G4double GetLocalTime() const;
0120 inline void SetLocalTime(const G4double aValue);
0121
0122
0123 inline G4double GetProperTime() const;
0124 inline void SetProperTime(const G4double aValue);
0125
0126
0127 inline G4VPhysicalVolume* GetVolume() const;
0128 inline G4VPhysicalVolume* GetNextVolume() const;
0129
0130
0131 inline G4Material* GetMaterial() const;
0132 inline G4Material* GetNextMaterial() const;
0133
0134 inline const G4MaterialCutsCouple* GetMaterialCutsCouple() const;
0135 inline const G4MaterialCutsCouple* GetNextMaterialCutsCouple() const;
0136
0137 inline const G4VTouchable* GetTouchable() const;
0138 inline const G4TouchableHandle& GetTouchableHandle() const;
0139 inline void SetTouchableHandle(const G4TouchableHandle& apValue);
0140
0141 inline const G4VTouchable* GetNextTouchable() const;
0142 inline const G4TouchableHandle& GetNextTouchableHandle() const;
0143 inline void SetNextTouchableHandle(const G4TouchableHandle& apValue);
0144
0145 inline const G4VTouchable* GetOriginTouchable() const;
0146 inline const G4TouchableHandle& GetOriginTouchableHandle() const;
0147 inline void SetOriginTouchableHandle(const G4TouchableHandle& apValue);
0148
0149 inline G4double GetKineticEnergy() const;
0150 inline G4double GetTotalEnergy() const;
0151 inline void SetKineticEnergy(const G4double aValue);
0152
0153
0154 inline G4ThreeVector GetMomentum() const;
0155 inline const G4ThreeVector& GetMomentumDirection() const;
0156 inline void SetMomentumDirection(const G4ThreeVector& aValue);
0157
0158
0159 inline G4double GetVelocity() const;
0160 inline void SetVelocity(G4double val);
0161
0162
0163 inline G4double CalculateVelocity() const;
0164 G4double CalculateVelocityForOpticalPhoton() const;
0165
0166 inline G4bool UseGivenVelocity() const;
0167 inline void UseGivenVelocity(G4bool val);
0168
0169 inline const G4ThreeVector& GetPolarization() const;
0170 inline void SetPolarization(const G4ThreeVector& aValue);
0171
0172
0173 inline G4TrackStatus GetTrackStatus() const;
0174 inline void SetTrackStatus(const G4TrackStatus aTrackStatus);
0175
0176
0177 inline G4bool IsBelowThreshold() const;
0178 inline void SetBelowThresholdFlag(G4bool value = true);
0179
0180
0181
0182
0183 inline G4bool IsGoodForTracking() const;
0184 inline void SetGoodForTrackingFlag(G4bool value = true);
0185
0186
0187
0188
0189 inline G4double GetTrackLength() const;
0190 inline void AddTrackLength(const G4double aValue);
0191
0192
0193 inline const G4Step* GetStep() const;
0194 inline void SetStep(const G4Step* aValue);
0195
0196
0197 inline G4int GetCurrentStepNumber() const;
0198 inline void IncrementCurrentStepNumber();
0199
0200 inline G4double GetStepLength() const;
0201 inline void SetStepLength(G4double value);
0202
0203
0204
0205
0206
0207 inline const G4ThreeVector& GetVertexPosition() const;
0208 inline void SetVertexPosition(const G4ThreeVector& aValue);
0209
0210
0211 inline const G4ThreeVector& GetVertexMomentumDirection() const;
0212 inline void SetVertexMomentumDirection(const G4ThreeVector& aValue);
0213
0214 inline G4double GetVertexKineticEnergy() const;
0215 inline void SetVertexKineticEnergy(const G4double aValue);
0216
0217 inline const G4LogicalVolume* GetLogicalVolumeAtVertex() const;
0218 inline void SetLogicalVolumeAtVertex(const G4LogicalVolume*);
0219
0220 inline const G4VProcess* GetCreatorProcess() const;
0221 inline void SetCreatorProcess(const G4VProcess* aValue);
0222
0223 inline void SetCreatorModelID(const G4int id);
0224 inline G4int GetCreatorModelID() const;
0225 inline G4int GetCreatorModelIndex() const;
0226 inline const G4String GetCreatorModelName() const;
0227
0228
0229
0230
0231
0232 inline const G4ParticleDefinition* GetParentResonanceDef() const;
0233 inline void SetParentResonanceDef(const G4ParticleDefinition* parent);
0234 inline G4int GetParentResonanceID() const;
0235 inline void SetParentResonanceID(const G4int parentID );
0236 inline G4bool HasParentResonance() const;
0237 inline G4int GetParentResonancePDGEncoding() const;
0238 inline G4String GetParentResonanceName() const;
0239 inline G4double GetParentResonanceMass() const;
0240
0241
0242
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252
0253
0254
0255 inline G4double GetWeight() const;
0256 inline void SetWeight(G4double aValue);
0257
0258
0259 inline G4VUserTrackInformation* GetUserInformation() const;
0260 inline void SetUserInformation(G4VUserTrackInformation* aValue) const;
0261
0262
0263 void SetAuxiliaryTrackInformation(G4int id,
0264 G4VAuxiliaryTrackInformation* info) const;
0265 G4VAuxiliaryTrackInformation* GetAuxiliaryTrackInformation(G4int id) const;
0266 inline std::map<G4int, G4VAuxiliaryTrackInformation*>*
0267 GetAuxiliaryTrackInformationMap() const;
0268
0269 void RemoveAuxiliaryTrackInformation(G4int id);
0270 void RemoveAuxiliaryTrackInformation(G4String& name);
0271
0272
0273 private:
0274
0275 void ClearAuxiliaryTrackInformation();
0276
0277
0278
0279 G4ThreeVector fPosition;
0280
0281 G4double fGlobalTime = 0.0;
0282
0283 G4double fLocalTime = 0.0;
0284
0285 G4double fTrackLength = 0.0;
0286
0287
0288 G4double fVelocity = 0.0;
0289
0290 G4TouchableHandle fpTouchable;
0291 G4TouchableHandle fpNextTouchable;
0292 G4TouchableHandle fpOriginTouchable;
0293
0294
0295 G4DynamicParticle* fpDynamicParticle = nullptr;
0296 mutable G4TrackStatus fTrackStatus = fAlive;
0297
0298 G4double fStepLength = 0.0;
0299
0300
0301
0302
0303
0304 G4double fWeight = 1.0;
0305
0306
0307 const G4Step* fpStep = nullptr;
0308
0309 G4ThreeVector fVtxPosition;
0310
0311 G4ThreeVector fVtxMomentumDirection;
0312
0313 G4double fVtxKineticEnergy = 0.0;
0314
0315 const G4LogicalVolume* fpLVAtVertex = nullptr;
0316
0317 const G4VProcess* fpCreatorProcess = nullptr;
0318
0319
0320 mutable G4VUserTrackInformation* fpUserInformation = nullptr;
0321
0322 mutable G4Material* prev_mat = nullptr;
0323 mutable G4MaterialPropertyVector* groupvel = nullptr;
0324 mutable G4double prev_velocity = 0.0;
0325 mutable G4double prev_momentum = 0.0;
0326
0327
0328 mutable std::map<G4int, G4VAuxiliaryTrackInformation*>*
0329 fpAuxiliaryTrackInformationMap = nullptr;
0330
0331 G4int fCurrentStepNumber = 0;
0332
0333
0334 G4int fCreatorModelID = -1;
0335
0336
0337 const G4ParticleDefinition* fParentResonanceDef = nullptr;
0338
0339
0340
0341 G4int fParentResonanceID = 0;
0342
0343
0344
0345 G4int fParentID = 0;
0346 G4int fTrackID = 0;
0347
0348 G4bool fBelowThreshold = false;
0349
0350
0351 G4bool fGoodForTracking = false;
0352
0353
0354
0355 G4bool is_OpticalPhoton = false;
0356
0357 G4bool useGivenVelocity = false;
0358
0359
0360
0361 G4bool fCopyTouchables = true;
0362 };
0363
0364 #include "G4Track.icc"
0365
0366 #endif