38 G4double totalEnergyIn,
39 G4double kineticEnergyIn,
45 ionDefinition(nullptr),
47 name(particleIn->GetParticleName()),
48 mass(particleIn->GetPDGMass()),
55 brho(
std::numeric_limits<double>::max()),
66 SetEnergies(totalEnergyIn, kineticEnergyIn, momentumIn);
145 particle(other.particle),
146 ionPDGID(other.ionPDGID),
149 charge(other.charge),
150 totalEnergy(other.totalEnergy),
151 kineticEnergy(other.kineticEnergy),
152 momentum(other.momentum),
157 forwards(other.forwards)
166 particle(other.particle),
167 ionPDGID(other.ionPDGID),
170 charge(other.charge),
171 totalEnergy(other.totalEnergy),
172 kineticEnergy(other.kineticEnergy),
173 momentum(other.momentum),
178 forwards(other.forwards)
180 ionDefinition = other.ionDefinition;
181 other.ionDefinition =
nullptr;
188 delete ionDefinition;
190 other.ionDefinition =
nullptr;
192 particle = other.particle;
193 ionPDGID = other.ionPDGID;
197 totalEnergy = other.totalEnergy;
198 kineticEnergy = other.kineticEnergy;
199 momentum = other.momentum;
204 forwards = other.forwards;
227 out <<
"Particle: \""<< def.
name <<
"\"" << G4endl;
228 out <<
"Mass: " << std::setprecision(pre) << def.
mass/CLHEP::GeV <<
" GeV" << G4endl;
229 out <<
"Charge: " << def.
charge <<
" e" << G4endl;
230 out <<
"Total Energy: " << std::setprecision(pre) << def.
totalEnergy/CLHEP::GeV <<
" GeV" << G4endl;
231 out <<
"Kinetic Energy: " << std::setprecision(pre) << def.
kineticEnergy/CLHEP::GeV <<
" GeV" << G4endl;
232 out <<
"Momentum: " << std::setprecision(pre) << def.
momentum/CLHEP::GeV <<
" GeV" << G4endl;
233 out <<
"Gamma: " << std::setprecision(pre) << def.
gamma << G4endl;
234 out <<
"Beta: " << std::setprecision(pre) << def.
beta << G4endl;
235 out <<
"FFact: " << std::setprecision(pre) << def.
ffact << G4endl;
236 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.