35#define INCLXX_IN_GEANT4_MODE 1
90 theHelicity(rhs.theHelicity),
91 emissionTime(rhs.emissionTime),
92 outOfWell(rhs.outOfWell),
132 std::swap(theHelicity, rhs.theHelicity);
133 std::swap(emissionTime, rhs.emissionTime);
134 std::swap(outOfWell, rhs.outOfWell);
136 std::swap(theMass, rhs.theMass);
147 swap(temporaryParticle);
206 ERROR(
"Trying to set particle type to Unknown!" << std::endl);
297 const G4double gamma = 1.0 / std::sqrt(1.0 - beta2);
299 const G4double alpha = (gamma*gamma)/(1.0 + gamma);
315 const G4double gamma = 1.0 / std::sqrt(1.0 - beta2);
317 const ThreeVector transversePosition = theRelativePosition - aBoostVector * (theRelativePosition.
dot(aBoostVector) / aBoostVector.
mag2());
318 const ThreeVector longitudinalPosition = theRelativePosition - transversePosition;
320 thePosition = refPos + transversePosition + longitudinalPosition / gamma;
349 ERROR(
"Particle::getINCLMass: Unknown particle type." << std::endl);
378 ERROR(
"Particle::getTableMass: Unknown particle type." << std::endl);
407 ERROR(
"Particle::getRealMass: Unknown particle type." << std::endl);
445 theQValue = massTableParent - massTableDaughter - massTableParticle;
453 return theQValue - (massINCLParent-massINCLDaughter-massINCLParticle);
472 const G4int AFromDaughter = AFrom -
theA;
473 const G4int ZFromDaughter = ZFrom -
theZ;
488 return theQValue - (massINCLToDaughter-massINCLTo-massINCLParticle);
499 ERROR(
"E*E - p*p is negative." << std::endl);
502 return std::sqrt(mass);
528 this->theMass = mass;
578 thePosition += ((*thePropagationMomentum)*(step/(*thePropagationEnergy)));
633 return (std::find(l.begin(), l.end(),
this)!=l.end());
689 std::stringstream ss;
690 ss <<
"Particle (ID = " <<
ID <<
") type = ";
693 <<
" energy = " <<
theEnergy << std::endl
704 std::stringstream ss;
705 ss <<
"(particle " <<
ID <<
" ";
722 WARN(
"Particle::getParticles() method was called on a Particle object" << std::endl);
static G4double getINCLMass(const G4int A, const G4int Z)
Get INCL nuclear mass (in MeV/c^2)
static NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
static ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.
static G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2)
static std::string getName(const ParticleType t)
Get the native INCL name of the particle.
static G4double getTableQValue(const G4int A1, const G4int Z1, const G4int A2, const G4int Z2)
Get Q-value (in MeV/c^2)
ThreeVector boostVector() const
G4double getINCLMass() const
Get the INCL particle mass.
virtual G4INCL::ParticleSpecies getSpecies() const
Get the particle species.
void setPotentialEnergy(G4double v)
Set the particle potential energy.
ParticleList const * getParticles() const
G4INCL::ThreeVector * thePropagationMomentum
G4bool isOutOfWell() const
Check if the particle is out of its potential well.
G4double getEmissionQValueCorrection(const G4int AParent, const G4int ZParent) const
Computes correction on the emission Q-value.
G4INCL::ThreeVector theMomentum
virtual G4INCL::ThreeVector getAngularMomentum() const
void setFrozenMomentum(const ThreeVector &momentum)
Set the frozen particle momentum.
G4double getFrozenEnergy() const
Get the frozen particle momentum.
G4double getEnergy() const
G4double getPotentialEnergy() const
Get the particle potential energy.
void incrementNumberOfDecays()
Increment the number of decays undergone by the particle.
void setMass(G4double mass)
void lorentzContract(const ThreeVector &aBoostVector, const ThreeVector &refPos)
Lorentz-contract the particle position around some center.
virtual void makeTargetSpectator()
ParticipantType getParticipantType() const
void setHelicity(G4double h)
void setFrozenEnergy(const G4double energy)
Set the frozen particle momentum.
ThreeVector getPropagationVelocity() const
Get the propagation velocity of the particle.
G4double thePotentialEnergy
void setParticipantType(ParticipantType const p)
virtual void rotate(const G4double angle, const ThreeVector &axis)
Rotate the particle position and momentum.
ParticipantType theParticipantType
void propagate(G4double step)
G4int getZ() const
Returns the charge number.
const G4INCL::ThreeVector & getPosition() const
G4bool isParticipant() const
G4double getKineticEnergy() const
Get the particle kinetic energy.
G4INCL::ParticleType theType
Particle(const Particle &rhs)
Copy constructor.
G4bool isTargetSpectator() const
void setEmissionTime(G4double t)
ThreeVector getLongitudinalPosition() const
Longitudinal component of the position w.r.t. the momentum.
G4int getNumberOfCollisions() const
Return the number of collisions undergone by the particle.
virtual void makeProjectileSpectator()
G4double adjustEnergyFromMomentum()
Recompute the energy to match the momentum.
void setNumberOfDecays(G4int n)
Set the number of decays undergone by the particle.
G4int getNumberOfDecays() const
Return the number of decays undergone by the particle.
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
G4bool isPion() const
Is this a pion?
void setINCLMass()
Set the mass of the Particle to its table mass.
void incrementNumberOfCollisions()
Increment the number of collisions undergone by the particle.
G4double getTransferQValueCorrection(const G4int AFrom, const G4int ZFrom, const G4int ATo, const G4int ZTo) const
Computes correction on the transfer Q-value.
ThreeVector getFrozenMomentum() const
Get the frozen particle momentum.
G4bool isInList(ParticleList const &l) const
Check if the particle belongs to a given list.
G4double getRealMass() const
Get the real particle mass.
G4bool isProjectileSpectator() const
const G4INCL::ThreeVector & getMomentum() const
Particle & operator=(const Particle &rhs)
Assignment operator.
virtual void setMomentum(const G4INCL::ThreeVector &momentum)
G4INCL::ParticleType getType() const
void thawPropagation()
Unfreeze particle propagation.
virtual G4double getTableMass() const
Get the tabulated particle mass.
G4double getInvariantMass() const
Get the the particle invariant mass.
G4double getEmissionTime()
virtual void makeParticipant()
G4bool isResonance() const
Is it a resonance?
void setEnergy(G4double energy)
void setType(ParticleType t)
std::string print() const
ThreeVector getTransversePosition() const
Transverse component of the position w.r.t. the momentum.
G4double getMass() const
Get the cached particle mass.
void boost(const ThreeVector &aBoostVector)
virtual void setPosition(const G4INCL::ThreeVector &position)
void setTableMass()
Set the mass of the Particle to its table mass.
void setOutOfWell()
Mark the particle as out of its potential well.
void swap(Particle &rhs)
Helper method for the assignment operator.
G4double * thePropagationEnergy
G4bool isDelta() const
Is it a Delta?
void freezePropagation()
Freeze particle propagation.
void setRealMass()
Set the mass of the Particle to its real mass.
G4int getA() const
Returns the baryon number.
G4INCL::ThreeVector thePosition
G4INCL::ThreeVector theFrozenMomentum
void setNumberOfCollisions(G4int n)
Set the number of collisions undergone by the particle.
std::string print() const
void rotate(const G4double angle, const ThreeVector &axis)
Rotate the vector by a given angle around a given axis.
G4double dot(const ThreeVector &v) const
ThreeVector vector(const ThreeVector &v) const
std::list< G4INCL::Particle * > ParticleList
std::list< G4INCL::Particle * >::const_iterator ParticleIter