49static const G4double EnergyMomentumRelationAllowance = 1.0e-2*CLHEP::keV;
51 EnergyMomentumRelationAllowance*EnergyMomentumRelationAllowance;
57 : theMomentumDirection(0.0,0.0,1.0),
58 thePolarization(0.0,0.0,0.0)
67 : theMomentumDirection(aMomentumDirection),
68 thePolarization(0.0,0.0,0.0),
69 theParticleDefinition(aParticleDefinition),
70 theKineticEnergy(aKineticEnergy),
71 theDynamicalMass(aParticleDefinition->GetPDGMass()),
72 theDynamicalCharge(aParticleDefinition->GetPDGCharge()),
73 theDynamicalSpin(aParticleDefinition->GetPDGSpin()),
74 theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment())
84 : theMomentumDirection(aMomentumDirection),
85 thePolarization(0.0,0.0,0.0),
86 theParticleDefinition(aParticleDefinition),
87 theKineticEnergy(aKineticEnergy),
88 theDynamicalMass(aParticleDefinition->GetPDGMass()),
89 theDynamicalCharge(aParticleDefinition->GetPDGCharge()),
90 theDynamicalSpin(aParticleDefinition->GetPDGSpin()),
91 theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment())
93 if (std::abs(theDynamicalMass-dynamicalMass)
94 > EnergyMomentumRelationAllowance)
96 if (dynamicalMass>EnergyMomentumRelationAllowance)
97 theDynamicalMass= dynamicalMass;
99 theDynamicalMass= 0.0;
107 : thePolarization(0.0,0.0,0.0),
108 theParticleDefinition(aParticleDefinition),
109 theDynamicalMass(aParticleDefinition->GetPDGMass()),
110 theDynamicalCharge(aParticleDefinition->GetPDGCharge()),
111 theDynamicalSpin(aParticleDefinition->GetPDGSpin()),
112 theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment())
121 : thePolarization(0.0,0.0,0.0),
122 theParticleDefinition(aParticleDefinition),
123 theDynamicalMass(aParticleDefinition->GetPDGMass()),
124 theDynamicalCharge(aParticleDefinition->GetPDGCharge()),
125 theDynamicalSpin(aParticleDefinition->GetPDGSpin()),
126 theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment())
136 : thePolarization(0.0,0.0,0.0),
137 theParticleDefinition(aParticleDefinition),
138 theDynamicalMass(aParticleDefinition->GetPDGMass()),
139 theDynamicalCharge(aParticleDefinition->GetPDGCharge()),
140 theDynamicalSpin(aParticleDefinition->GetPDGSpin()),
141 theDynamicalMagneticMoment(aParticleDefinition->GetPDGMagneticMoment())
147 G4double mass2 = totalEnergy*totalEnergy - pModule2;
151 if (mass2 < EnergyMRA2)
153 theDynamicalMass = 0.;
158 if (std::abs(PDGmass2-mass2)>EnergyMRA2)
160 theDynamicalMass = std::sqrt(mass2);
178 : theMomentumDirection(right.theMomentumDirection),
179 thePolarization(right.thePolarization),
180 theParticleDefinition(right.theParticleDefinition),
181 theElectronOccupancy(nullptr),
182 thePreAssignedDecayProducts(nullptr),
183 primaryParticle(right.primaryParticle),
184 theKineticEnergy(right.theKineticEnergy),
185 theLogKineticEnergy(right.theLogKineticEnergy),
186 theBeta(right.theBeta),
187 theProperTime(right.theProperTime),
188 theDynamicalMass(right.theDynamicalMass),
189 theDynamicalCharge(right.theDynamicalCharge),
190 theDynamicalSpin(right.theDynamicalSpin),
191 theDynamicalMagneticMoment(right.theDynamicalMagneticMoment),
192 thePreAssignedDecayTime(-1.0),
193 verboseLevel(right.verboseLevel),
194 thePDGcode(right.thePDGcode)
196 if (right.theElectronOccupancy !=
nullptr)
204 : theMomentumDirection(from.theMomentumDirection),
205 thePolarization(from.thePolarization),
206 theParticleDefinition(from.theParticleDefinition),
207 theElectronOccupancy(from.theElectronOccupancy),
208 thePreAssignedDecayProducts(nullptr),
209 primaryParticle(from.primaryParticle),
210 theKineticEnergy(from.theKineticEnergy),
211 theLogKineticEnergy(from.theLogKineticEnergy),
212 theBeta(from.theBeta),
213 theProperTime(from.theProperTime),
214 theDynamicalMass(from.theDynamicalMass),
215 theDynamicalCharge(from.theDynamicalCharge),
216 theDynamicalSpin(from.theDynamicalSpin),
217 theDynamicalMagneticMoment(from.theDynamicalMagneticMoment),
218 thePreAssignedDecayTime(-1.0),
219 verboseLevel(from.verboseLevel),
220 thePDGcode(from.thePDGcode)
223 from.theParticleDefinition =
nullptr;
224 from.theElectronOccupancy =
nullptr;
225 from.thePreAssignedDecayProducts =
nullptr;
226 from.primaryParticle =
nullptr;
234 if (thePreAssignedDecayProducts !=
nullptr)
235 delete thePreAssignedDecayProducts;
236 thePreAssignedDecayProducts =
nullptr;
238 if (theElectronOccupancy !=
nullptr)
239 delete theElectronOccupancy;
240 theElectronOccupancy =
nullptr;
250 theMomentumDirection = right.theMomentumDirection;
251 theParticleDefinition = right.theParticleDefinition;
252 thePolarization = right.thePolarization;
253 theKineticEnergy = right.theKineticEnergy;
254 theProperTime = right.theProperTime;
256 theDynamicalMass = right.theDynamicalMass;
257 theDynamicalCharge = right.theDynamicalCharge;
258 theDynamicalSpin = right.theDynamicalSpin;
259 theDynamicalMagneticMoment = right.theDynamicalMagneticMoment;
261 if (theElectronOccupancy !=
nullptr) {
delete theElectronOccupancy; }
262 if (right.theElectronOccupancy !=
nullptr)
264 theElectronOccupancy =
269 theElectronOccupancy =
nullptr;
273 thePreAssignedDecayProducts =
nullptr;
274 thePreAssignedDecayTime = -1.0;
276 verboseLevel = right.verboseLevel;
281 thePDGcode = right.thePDGcode;
291 theMomentumDirection = from.theMomentumDirection;
292 thePolarization = from.thePolarization;
293 theKineticEnergy = from.theKineticEnergy;
294 theProperTime = from.theProperTime;
296 theDynamicalMass = from.theDynamicalMass;
297 theDynamicalCharge = from.theDynamicalCharge;
298 theDynamicalSpin = from.theDynamicalSpin;
299 theDynamicalMagneticMoment = from.theDynamicalMagneticMoment;
301 if (theElectronOccupancy !=
nullptr) {
delete theElectronOccupancy; }
302 theElectronOccupancy = from.theElectronOccupancy;
303 from.theElectronOccupancy =
nullptr;
306 thePreAssignedDecayProducts =
nullptr;
307 from.thePreAssignedDecayProducts =
nullptr;
308 thePreAssignedDecayTime = -1.0;
310 theParticleDefinition = from.theParticleDefinition;
311 from.theParticleDefinition =
nullptr;
313 verboseLevel = from.verboseLevel;
315 primaryParticle = from.primaryParticle;
316 from.primaryParticle =
nullptr;
318 thePDGcode = from.thePDGcode;
328 if (thePreAssignedDecayProducts !=
nullptr)
333 G4cout <<
" G4DynamicParticle::SetDefinition()::"
334 <<
"!!! Pre-assigned decay products is attached !!!! " <<
G4endl;
335 G4cout <<
"!!! New Definition is "
337 G4cout <<
"!!! Pre-assigned decay products will be deleted !!!! "
341 delete thePreAssignedDecayProducts;
343 thePreAssignedDecayProducts =
nullptr;
345 theParticleDefinition = aParticleDefinition;
349 theDynamicalCharge = theParticleDefinition->
GetPDGCharge();
350 theDynamicalSpin = theParticleDefinition->
GetPDGSpin();
354 if (theElectronOccupancy !=
nullptr)
356 delete theElectronOccupancy;
357 theElectronOccupancy =
nullptr;
386 theElectronOccupancy =
nullptr;
398 const G4double mass = theDynamicalMass;
416 const G4double totalenergy = momentum.
t();
417 const G4double mass2 = totalenergy*totalenergy - pModule2;
420 if (mass2 < EnergyMRA2)
422 theDynamicalMass = 0.;
424 else if (std::abs(PDGmass2-mass2)>EnergyMRA2)
426 theDynamicalMass = std::sqrt(mass2);
443 if (theParticleDefinition ==
nullptr)
445 G4cout <<
" G4DynamicParticle::DumpInfo() - Particle type not defined !!! "
457 <<
" Total Momentum = "
459 <<
" Momentum: " <<
GetMomentum().
x() /CLHEP::GeV <<
"[GeV]"
462 <<
" Total Energy = "
464 <<
" Kinetic Energy = "
466 <<
" MagneticMoment [MeV/T]: "
473 if( theElectronOccupancy !=
nullptr)
490 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