50static const G4double EnergyMomentumRelationAllowance = 1.0e-2 * CLHEP::keV;
52 EnergyMomentumRelationAllowance * EnergyMomentumRelationAllowance;
55 : theMomentumDirection(0.0, 0.0, 1.0), thePolarization(0.0, 0.0, 0.0)
61 : theMomentumDirection(aMomentumDirection),
62 thePolarization(0.0, 0.0, 0.0),
63 theParticleDefinition(aParticleDefinition),
64 theKineticEnergy(aKineticEnergy),
65 theDynamicalMass(aParticleDefinition->GetPDGMass()),
66 theDynamicalCharge(aParticleDefinition->GetPDGCharge()),
67 theDynamicalSpin(aParticleDefinition->GetPDGSpin()),
68 theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment())
74 : theMomentumDirection(aMomentumDirection),
75 thePolarization(0.0, 0.0, 0.0),
76 theParticleDefinition(aParticleDefinition),
77 theKineticEnergy(aKineticEnergy),
78 theDynamicalMass(aParticleDefinition->GetPDGMass()),
79 theDynamicalCharge(aParticleDefinition->GetPDGCharge()),
80 theDynamicalSpin(aParticleDefinition->GetPDGSpin()),
81 theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment())
83 if (std::abs(theDynamicalMass - dynamicalMass) > EnergyMomentumRelationAllowance) {
84 if (dynamicalMass > EnergyMomentumRelationAllowance)
85 theDynamicalMass = dynamicalMass;
87 theDynamicalMass = 0.0;
93 : thePolarization(0.0, 0.0, 0.0),
94 theParticleDefinition(aParticleDefinition),
95 theDynamicalMass(aParticleDefinition->GetPDGMass()),
96 theDynamicalCharge(aParticleDefinition->GetPDGCharge()),
97 theDynamicalSpin(aParticleDefinition->GetPDGSpin()),
98 theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment())
105 : thePolarization(0.0, 0.0, 0.0),
106 theParticleDefinition(aParticleDefinition),
107 theDynamicalMass(aParticleDefinition->GetPDGMass()),
108 theDynamicalCharge(aParticleDefinition->GetPDGCharge()),
109 theDynamicalSpin(aParticleDefinition->GetPDGSpin()),
110 theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment())
117 : thePolarization(0.0, 0.0, 0.0),
118 theParticleDefinition(aParticleDefinition),
119 theDynamicalMass(aParticleDefinition->GetPDGMass()),
120 theDynamicalCharge(aParticleDefinition->GetPDGCharge()),
121 theDynamicalSpin(aParticleDefinition->GetPDGSpin()),
122 theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment())
126 if (pModule2 > 0.0) {
127 G4double mass2 = totalEnergy * totalEnergy - pModule2;
130 if (mass2 < EnergyMRA2) {
131 theDynamicalMass = 0.;
135 if (std::abs(PDGmass2 - mass2) > EnergyMRA2) {
136 theDynamicalMass = std::sqrt(mass2);
151 : theMomentumDirection(right.theMomentumDirection),
152 thePolarization(right.thePolarization),
153 theParticleDefinition(right.theParticleDefinition),
155 primaryParticle(right.primaryParticle),
156 theKineticEnergy(right.theKineticEnergy),
157 theLogKineticEnergy(right.theLogKineticEnergy),
158 theBeta(right.theBeta),
159 theProperTime(right.theProperTime),
160 theDynamicalMass(right.theDynamicalMass),
161 theDynamicalCharge(right.theDynamicalCharge),
162 theDynamicalSpin(right.theDynamicalSpin),
163 theDynamicalMagneticMoment(right.theDynamicalMagneticMoment),
165 verboseLevel(right.verboseLevel),
166 thePDGcode(right.thePDGcode)
168 if (right.theElectronOccupancy !=
nullptr) {
169 theElectronOccupancy = new G4ElectronOccupancy(*right.theElectronOccupancy);
174 : theMomentumDirection(from.theMomentumDirection),
175 thePolarization(from.thePolarization),
176 theParticleDefinition(from.theParticleDefinition),
177 theElectronOccupancy(from.theElectronOccupancy),
179 primaryParticle(from.primaryParticle),
180 theKineticEnergy(from.theKineticEnergy),
181 theLogKineticEnergy(from.theLogKineticEnergy),
182 theBeta(from.theBeta),
183 theProperTime(from.theProperTime),
184 theDynamicalMass(from.theDynamicalMass),
185 theDynamicalCharge(from.theDynamicalCharge),
186 theDynamicalSpin(from.theDynamicalSpin),
187 theDynamicalMagneticMoment(from.theDynamicalMagneticMoment),
189 verboseLevel(from.verboseLevel),
190 thePDGcode(from.thePDGcode)
193 from.theParticleDefinition =
nullptr;
194 from.theElectronOccupancy =
nullptr;
195 from.thePreAssignedDecayProducts =
nullptr;
196 from.primaryParticle =
nullptr;
201 delete thePreAssignedDecayProducts;
202 thePreAssignedDecayProducts =
nullptr;
204 delete theElectronOccupancy;
205 theElectronOccupancy =
nullptr;
210 if (
this != &right) {
211 theMomentumDirection = right.theMomentumDirection;
212 theParticleDefinition = right.theParticleDefinition;
213 thePolarization = right.thePolarization;
214 theKineticEnergy = right.theKineticEnergy;
215 theProperTime = right.theProperTime;
217 theDynamicalMass = right.theDynamicalMass;
218 theDynamicalCharge = right.theDynamicalCharge;
219 theDynamicalSpin = right.theDynamicalSpin;
220 theDynamicalMagneticMoment = right.theDynamicalMagneticMoment;
222 delete theElectronOccupancy;
223 if (right.theElectronOccupancy !=
nullptr) {
227 theElectronOccupancy =
nullptr;
231 thePreAssignedDecayProducts =
nullptr;
232 thePreAssignedDecayTime = -1.0;
234 verboseLevel = right.verboseLevel;
239 thePDGcode = right.thePDGcode;
247 theMomentumDirection = from.theMomentumDirection;
248 thePolarization = from.thePolarization;
249 theKineticEnergy = from.theKineticEnergy;
250 theProperTime = from.theProperTime;
252 theDynamicalMass = from.theDynamicalMass;
253 theDynamicalCharge = from.theDynamicalCharge;
254 theDynamicalSpin = from.theDynamicalSpin;
255 theDynamicalMagneticMoment = from.theDynamicalMagneticMoment;
257 delete theElectronOccupancy;
258 theElectronOccupancy = from.theElectronOccupancy;
259 from.theElectronOccupancy =
nullptr;
262 thePreAssignedDecayProducts =
nullptr;
263 from.thePreAssignedDecayProducts =
nullptr;
264 thePreAssignedDecayTime = -1.0;
266 theParticleDefinition = from.theParticleDefinition;
267 from.theParticleDefinition =
nullptr;
269 verboseLevel = from.verboseLevel;
271 primaryParticle = from.primaryParticle;
272 from.primaryParticle =
nullptr;
274 thePDGcode = from.thePDGcode;
282 if (thePreAssignedDecayProducts !=
nullptr) {
284 if (verboseLevel > 0) {
285 G4cout <<
" G4DynamicParticle::SetDefinition()::"
286 <<
"!!! Pre-assigned decay products is attached !!!! " <<
G4endl;
289 G4cout <<
"!!! Pre-assigned decay products will be deleted !!!! " <<
G4endl;
292 delete thePreAssignedDecayProducts;
294 thePreAssignedDecayProducts =
nullptr;
296 theParticleDefinition = aParticleDefinition;
300 theDynamicalCharge = theParticleDefinition->
GetPDGCharge();
301 theDynamicalSpin = theParticleDefinition->
GetPDGSpin();
305 if (theElectronOccupancy !=
nullptr) {
306 delete theElectronOccupancy;
307 theElectronOccupancy =
nullptr;
328 theElectronOccupancy =
nullptr;
335 if (pModule2 > 0.0) {
336 const G4double mass = theDynamicalMass;
349 if (pModule2 > 0.0) {
351 const G4double totalenergy = momentum.
t();
352 const G4double mass2 = totalenergy * totalenergy - pModule2;
355 if (mass2 < EnergyMRA2) {
356 theDynamicalMass = 0.;
358 else if (std::abs(PDGmass2 - mass2) > EnergyMRA2) {
359 theDynamicalMass = std::sqrt(mass2);
372 if (theParticleDefinition ==
nullptr) {
373 G4cout <<
" G4DynamicParticle::DumpInfo() - Particle type not defined !!! " <<
G4endl;
387 <<
" MagneticMoment [MeV/T]: " <<
GetMagneticMoment() / CLHEP::MeV * CLHEP::tesla
391 if (theElectronOccupancy !=
nullptr) {
406 return CLHEP::electron_mass_c2;
G4Allocator< G4DynamicParticle > *& pDynamicParticleAllocator()
G4GLOB_DLL std::ostream G4cout
void SetMomentumDirection(const G4ThreeVector &aDirection)
void DumpInfo(G4int mode=0) const
const G4ThreeVector & GetMomentumDirection() const
G4bool operator==(const G4DynamicParticle &right) const
G4double GetCharge() const
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMass(G4double mass)
G4double GetKineticEnergy() const
G4double GetTotalEnergy() const
G4bool operator!=(const G4DynamicParticle &right) const
void Set4Momentum(const G4LorentzVector &momentum)
void SetMomentum(const G4ThreeVector &momentum)
G4double GetProperTime() const
G4ThreeVector GetMomentum() const
G4DynamicParticle & operator=(const G4DynamicParticle &right)
G4double GetMagneticMoment() const
G4double GetTotalMomentum() const
G4double GetElectronMass() const
void AllocateElectronOccupancy()
void SetKineticEnergy(G4double aEnergy)
static G4bool IsIon(const G4ParticleDefinition *)
G4double GetPDGMagneticMoment() const
G4double GetPDGMass() const
G4double GetPDGCharge() const
const G4String & GetParticleName() const
G4double GetPDGSpin() const
#define G4ThreadLocalStatic