39 G4double totalEnergyIn,
40 G4double kineticEnergyIn,
46 ionDefinition(nullptr),
48 name(particleIn->GetParticleName()),
49 mass(particleIn->GetPDGMass()),
56 brho(
std::numeric_limits<double>::max()),
67 SetEnergies(totalEnergyIn, kineticEnergyIn, momentumIn);
146 particle(other.particle),
147 ionPDGID(other.ionPDGID),
150 charge(other.charge),
151 totalEnergy(other.totalEnergy),
152 kineticEnergy(other.kineticEnergy),
153 momentum(other.momentum),
158 forwards(other.forwards)
167 particle(other.particle),
168 ionPDGID(other.ionPDGID),
171 charge(other.charge),
172 totalEnergy(other.totalEnergy),
173 kineticEnergy(other.kineticEnergy),
174 momentum(other.momentum),
179 forwards(other.forwards)
181 ionDefinition = other.ionDefinition;
182 other.ionDefinition =
nullptr;
189 delete ionDefinition;
191 other.ionDefinition =
nullptr;
193 particle = other.particle;
194 ionPDGID = other.ionPDGID;
198 totalEnergy = other.totalEnergy;
199 kineticEnergy = other.kineticEnergy;
200 momentum = other.momentum;
205 forwards = other.forwards;
228 out <<
"Particle: \""<< def.
name <<
"\"" << G4endl;
229 out <<
"Mass: " << std::setprecision(pre) << def.
mass/CLHEP::GeV <<
" GeV" << G4endl;
230 out <<
"Charge: " << def.
charge <<
" e" << G4endl;
231 out <<
"Total Energy: " << std::setprecision(pre) << def.
totalEnergy/CLHEP::GeV <<
" GeV" << G4endl;
232 out <<
"Kinetic Energy: " << std::setprecision(pre) << def.
kineticEnergy/CLHEP::GeV <<
" GeV" << G4endl;
233 out <<
"Momentum: " << std::setprecision(pre) << def.
momentum/CLHEP::GeV <<
" GeV" << G4endl;
234 out <<
"Gamma: " << std::setprecision(pre) << def.
gamma << G4endl;
235 out <<
"Beta: " << std::setprecision(pre) << def.
beta << G4endl;
236 out <<
"FFact: " << std::setprecision(pre) << def.
ffact << G4endl;
237 out <<
"Rigidity (Brho): " << std::setprecision(pre) << def.
brho/(CLHEP::tesla*CLHEP::m) <<
" T*m" << G4endl;
Wrapper for particle definition.
void CalculateRigidity(const G4double &ffactIn)
Calculate and set rigidity based on charge and momentum.
void CalculateLorentzFactors()
Calculate and set lorentz factors.
void SetEnergies(G4double totalEnergyIn, G4double kineticEnergyIn, G4double momentumIn)
BDSIonDefinition * ionDefinition
Optional ion definition. Does own.
BDSParticleDefinition()=delete
No default constructor.
BDSParticleDefinition & operator=(BDSParticleDefinition &&other) noexcept
Copy, move and assignment constructors specified as we have to copy the ionDefinition if it exists.
G4bool forwards
In case of change of direction.
void ApplyChangeInKineticEnergy(G4double dEk)
Utility function to update quantities by adding on dEK (can be negative).
G4int ionPDGID
Cache this for ions only.
G4ParticleDefinition * particle
Does not own.
void CalculateMomentum()
Calculate and set momentum based on totalEnergy and mass.