File indexing completed on 2025-01-18 09:58:10
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
0041
0042 #ifndef G4DynamicParticle_hh
0043 #define G4DynamicParticle_hh 1
0044
0045 #include "G4Allocator.hh"
0046 #include "G4ElectronOccupancy.hh"
0047 #include "G4Log.hh"
0048 #include "G4LorentzVector.hh"
0049 #include "G4ParticleDefinition.hh"
0050 #include "G4ParticleMomentum.hh" // NOTE: means "momentum direction" not "momentum vector". It is a G4ThreeVector
0051 #include "G4ios.hh"
0052 #include "globals.hh"
0053
0054 #include <CLHEP/Units/PhysicalConstants.h>
0055 #include <CLHEP/Units/SystemOfUnits.h>
0056
0057 #include <cmath>
0058
0059 class G4PrimaryParticle;
0060 class G4DecayProducts;
0061
0062 class G4DynamicParticle
0063 {
0064 public:
0065
0066 G4DynamicParticle();
0067
0068 G4DynamicParticle(const G4ParticleDefinition* aParticleDefinition,
0069 const G4ThreeVector& aMomentumDirection, G4double aKineticEnergy);
0070 G4DynamicParticle(const G4ParticleDefinition* aParticleDefinition,
0071 const G4ThreeVector& aParticleMomentum);
0072 G4DynamicParticle(const G4ParticleDefinition* aParticleDefinition,
0073 const G4LorentzVector& aParticleMomentum);
0074 G4DynamicParticle(const G4ParticleDefinition* aParticleDefinition, G4double aTotalEnergy,
0075 const G4ThreeVector& aParticleMomentum);
0076 G4DynamicParticle(const G4ParticleDefinition* aParticleDefinition,
0077 const G4ThreeVector& aMomentumDirection, G4double aKineticEnergy,
0078 const G4double dynamicalMass);
0079
0080 G4DynamicParticle(const G4DynamicParticle& right);
0081
0082
0083 ~G4DynamicParticle();
0084
0085
0086 G4DynamicParticle& operator=(const G4DynamicParticle& right);
0087 G4bool operator==(const G4DynamicParticle& right) const;
0088 G4bool operator!=(const G4DynamicParticle& right) const;
0089
0090
0091 G4DynamicParticle(G4DynamicParticle&& from);
0092 G4DynamicParticle& operator=(G4DynamicParticle&& from);
0093
0094
0095 inline void* operator new(size_t);
0096 inline void operator delete(void* aDynamicParticle);
0097
0098
0099
0100
0101 inline const G4ThreeVector& GetMomentumDirection() const;
0102
0103
0104 inline void SetMomentumDirection(const G4ThreeVector& aDirection);
0105
0106
0107 inline void SetMomentumDirection(G4double px, G4double py, G4double pz);
0108
0109
0110 inline G4ThreeVector GetMomentum() const;
0111
0112
0113 void SetMomentum(const G4ThreeVector& momentum);
0114
0115
0116 inline G4LorentzVector Get4Momentum() const;
0117
0118
0119 void Set4Momentum(const G4LorentzVector& momentum);
0120
0121
0122 inline G4double GetTotalMomentum() const;
0123
0124
0125 inline G4double GetTotalEnergy() const;
0126
0127
0128 inline G4double GetKineticEnergy() const;
0129
0130
0131
0132
0133 inline G4double GetLogKineticEnergy() const;
0134
0135
0136 inline void SetKineticEnergy(G4double aEnergy);
0137
0138
0139 inline G4double GetBeta() const;
0140
0141
0142 inline G4double GetProperTime() const;
0143
0144
0145 inline void SetProperTime(G4double);
0146
0147
0148 inline const G4ThreeVector& GetPolarization() const;
0149 inline void SetPolarization(const G4ThreeVector&);
0150 inline void SetPolarization(G4double polX, G4double polY, G4double polZ);
0151
0152
0153
0154 inline G4double GetMass() const;
0155 inline void SetMass(G4double mass);
0156
0157
0158
0159 inline G4double GetCharge() const;
0160 inline void SetCharge(G4double charge);
0161 inline void SetCharge(G4int chargeInUnitOfEplus);
0162
0163
0164
0165 inline G4double GetSpin() const;
0166 inline void SetSpin(G4double spin);
0167 inline void SetSpin(G4int spinInUnitOfHalfInteger);
0168
0169
0170
0171 inline G4double GetMagneticMoment() const;
0172 inline void SetMagneticMoment(G4double magneticMoment);
0173
0174
0175
0176 inline const G4ElectronOccupancy* GetElectronOccupancy() const;
0177 inline G4int GetTotalOccupancy() const;
0178 inline G4int GetOccupancy(G4int orbit) const;
0179 inline void AddElectron(G4int orbit, G4int number = 1);
0180 inline void RemoveElectron(G4int orbit, G4int number = 1);
0181
0182
0183 inline const G4ParticleDefinition* GetParticleDefinition() const;
0184 void SetDefinition(const G4ParticleDefinition* aParticleDefinition);
0185
0186
0187
0188 inline G4ParticleDefinition* GetDefinition() const;
0189
0190
0191 inline const G4DecayProducts* GetPreAssignedDecayProducts() const;
0192 inline void SetPreAssignedDecayProducts(G4DecayProducts* aDecayProducts);
0193
0194
0195 inline G4double GetPreAssignedDecayProperTime() const;
0196 inline void SetPreAssignedDecayProperTime(G4double);
0197
0198
0199
0200
0201 void DumpInfo(G4int mode = 0) const;
0202
0203
0204
0205
0206
0207 inline void SetVerboseLevel(G4int value);
0208 inline G4int GetVerboseLevel() const;
0209
0210 inline void SetPrimaryParticle(G4PrimaryParticle* p);
0211 inline void SetPDGcode(G4int c);
0212
0213
0214
0215
0216 inline G4PrimaryParticle* GetPrimaryParticle() const;
0217
0218
0219
0220
0221
0222
0223
0224 inline G4int GetPDGcode() const;
0225
0226 protected:
0227 void AllocateElectronOccupancy();
0228 G4double GetElectronMass() const;
0229
0230 private:
0231 inline void ComputeBeta() const;
0232
0233
0234 G4ThreeVector theMomentumDirection;
0235
0236 G4ThreeVector thePolarization;
0237
0238
0239 const G4ParticleDefinition* theParticleDefinition = nullptr;
0240
0241 G4ElectronOccupancy* theElectronOccupancy = nullptr;
0242
0243 G4DecayProducts* thePreAssignedDecayProducts = nullptr;
0244
0245
0246
0247
0248 G4PrimaryParticle* primaryParticle = nullptr;
0249
0250 G4double theKineticEnergy = 0.0;
0251
0252 mutable G4double theLogKineticEnergy = DBL_MAX;
0253
0254 mutable G4double theBeta = -1.0;
0255
0256 G4double theProperTime = 0.0;
0257
0258 G4double theDynamicalMass = 0.0;
0259
0260 G4double theDynamicalCharge = 0.0;
0261
0262 G4double theDynamicalSpin = 0.0;
0263
0264 G4double theDynamicalMagneticMoment = 0.0;
0265
0266 G4double thePreAssignedDecayTime = -1.0;
0267
0268 G4int verboseLevel = 1;
0269
0270 G4int thePDGcode = 0;
0271 };
0272
0273 #include "G4DynamicParticle.icc"
0274
0275 #endif