33 #define INCLXX_IN_GEANT4_MODE 1
65 using std::vector<T>::push_back;
66 using std::vector<T>::pop_back;
67 using std::vector<T>::size;
68 using std::vector<T>::begin;
69 using std::vector<T>::end;
70 using std::vector<T>::rbegin;
71 using std::vector<T>::rend;
72 using std::vector<T>::front;
73 using std::vector<T>::back;
75 using std::vector<T>::empty;
76 using std::vector<T>::insert;
77 using std::vector<T>::erase;
78 using typename std::vector<T>::iterator;
79 using typename std::vector<T>::reverse_iterator;
80 using typename std::vector<T>::const_iterator;
81 using typename std::vector<T>::const_reverse_iterator;
82 void remove(
const T &t) {
83 const typename std::vector<T>::iterator removeMe = std::find(begin(), end(), t);
120 theHelicity(rhs.theHelicity),
121 emissionTime(rhs.emissionTime),
122 outOfWell(rhs.outOfWell),
163 std::swap(emissionTime, rhs.emissionTime);
179 swap(temporaryParticle);
238 INCL_ERROR(
"Trying to set particle type to Unknown!" << std::endl);
329 const G4double gamma = 1.0 / std::sqrt(1.0 - beta2);
331 const G4double alpha = (gamma*gamma)/(1.0 + gamma);
347 const G4double gamma = 1.0 / std::sqrt(1.0 - beta2);
349 const ThreeVector transversePosition = theRelativePosition - aBoostVector * (theRelativePosition.
dot(aBoostVector) / aBoostVector.
mag2());
350 const ThreeVector longitudinalPosition = theRelativePosition - transversePosition;
352 thePosition = refPos + transversePosition + longitudinalPosition / gamma;
381 INCL_ERROR(
"Particle::getINCLMass: Unknown particle type." << std::endl);
410 INCL_ERROR(
"Particle::getTableMass: Unknown particle type." << std::endl);
439 INCL_ERROR(
"Particle::getRealMass: Unknown particle type." << std::endl);
477 theQValue = massTableParent - massTableDaughter - massTableParticle;
485 return theQValue - (massINCLParent-massINCLDaughter-massINCLParticle);
504 const G4int AFromDaughter = AFrom -
theA;
505 const G4int ZFromDaughter = ZFrom -
theZ;
520 return theQValue - (massINCLToDaughter-massINCLTo-massINCLParticle);
531 INCL_ERROR(
"E*E - p*p is negative." << std::endl);
534 return std::sqrt(mass);
560 this->theMass = mass;
610 thePosition += ((*thePropagationMomentum)*(step/(*thePropagationEnergy)));
665 return (std::find(l.begin(), l.end(),
this)!=l.end());
721 std::stringstream ss;
722 ss <<
"Particle (ID = " <<
ID <<
") type = ";
725 <<
" energy = " <<
theEnergy << std::endl
736 std::stringstream ss;
737 ss <<
"(particle " <<
ID <<
" ";
754 INCL_WARN(
"Particle::getParticles() method was called on a Particle object" << std::endl);
G4int getA() const
Returns the baryon number.
ParticipantType theParticipantType
void setParticipantType(ParticipantType const p)
G4double getCosRPAngle() const
Get the cosine of the angle between position and momentum.
G4int getNumberOfCollisions() const
Return the number of collisions undergone by the particle.
void setMass(G4double mass)
G4bool isResonance() const
Is it a resonance?
virtual void makeTargetSpectator()
G4double getReflectionMomentum() const
Return the reflection momentum.
G4double getMass() const
Get the cached particle mass.
G4bool isInList(ParticleList const &l) const
Check if the particle belongs to a given list.
G4double * thePropagationEnergy
G4ThreadLocal ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.
G4double dot(const ThreeVector &v) const
void rotate(const G4double angle, const ThreeVector &axis)
Rotate the vector by a given angle around a given axis.
G4double getEmissionTime()
ThreeVector getPropagationVelocity() const
Get the propagation velocity of the particle.
void setEmissionTime(G4double t)
G4INCL::ThreeVector theFrozenMomentum
G4double getTableQValue(const G4int A1, const G4int Z1, const G4int A2, const G4int Z2)
Get Q-value (in MeV/c^2)
G4bool isTargetSpectator() const
void boost(const ThreeVector &aBoostVector)
const G4INCL::ThreeVector & getMomentum() const
G4double adjustEnergyFromMomentum()
Recompute the energy to match the momentum.
G4bool isDelta() const
Is it a Delta?
std::string print() const
G4double getEnergy() const
void setINCLMass()
Set the mass of the Particle to its table mass.
void thawPropagation()
Unfreeze particle propagation.
virtual void makeProjectileSpectator()
void propagate(G4double step)
void setOutOfWell()
Mark the particle as out of its potential well.
G4double getINCLMass() const
Get the INCL particle mass.
void incrementNumberOfCollisions()
Increment the number of collisions undergone by the particle.
G4bool isParticipant() const
void setUncorrelatedMomentum(const G4double p)
Set the uncorrelated momentum.
G4double uncorrelatedMomentum
ThreeVector boostVector() const
ThreeVector vector(const ThreeVector &v) const
G4double getPotentialEnergy() const
Get the particle potential energy.
ParticleList const * getParticles() const
void incrementNumberOfDecays()
Increment the number of decays undergone by the particle.
G4double getInvariantMass() const
Get the the particle invariant mass.
void rpCorrelate()
Make the particle follow a strict r-p correlation.
virtual void rotate(const G4double angle, const ThreeVector &axis)
Rotate the particle position and momentum.
void setEnergy(G4double energy)
G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2)
UnorderedVector< Particle * > ParticleList
void rpDecorrelate()
Make the particle not follow a strict r-p correlation.
void setNumberOfDecays(G4int n)
Set the number of decays 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.
ParticipantType getParticipantType() const
void lorentzContract(const ThreeVector &aBoostVector, const ThreeVector &refPos)
Lorentz-contract the particle position around some center.
virtual G4INCL::ThreeVector getAngularMomentum() const
virtual void setPosition(const G4INCL::ThreeVector &position)
G4int getZ() const
Returns the charge number.
void setPotentialEnergy(G4double v)
Set the particle potential energy.
void swap(shared_ptr< P > &, shared_ptr< P > &)
G4bool isOutOfWell() const
Check if the particle is out of its potential well.
G4INCL::ThreeVector thePosition
ThreeVector getFrozenMomentum() const
Get the frozen particle momentum.
ThreeVector getTransversePosition() const
Transverse component of the position w.r.t. the momentum.
Particle(const Particle &rhs)
Copy constructor.
G4INCL::ParticleType theType
void setFrozenMomentum(const ThreeVector &momentum)
Set the frozen particle momentum.
G4double getINCLMass(const G4int A, const G4int Z)
Get INCL nuclear mass (in MeV/c^2)
G4int getNumberOfDecays() const
Return the number of decays undergone by the particle.
G4INCL::ParticleType getType() const
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
void setTableMass()
Set the mass of the Particle to its table mass.
const G4INCL::ThreeVector & getPosition() const
void setRealMass()
Set the mass of the Particle to its real mass.
void swap(Particle &rhs)
Helper method for the assignment operator.
G4bool isProjectileSpectator() const
void setType(ParticleType t)
void setNumberOfCollisions(G4int n)
Set the number of collisions undergone by the particle.
Particle & operator=(const Particle &rhs)
Assignment operator.
G4INCL::ThreeVector theMomentum
virtual G4double getTableMass() const
Get the tabulated particle mass.
std::string print() const
G4double getKineticEnergy() const
Get the particle kinetic energy.
virtual G4INCL::ParticleSpecies getSpecies() const
Get the particle species.
G4double getRealMass() const
Get the real particle mass.
virtual void makeParticipant()
G4double getEmissionQValueCorrection(const G4int AParent, const G4int ZParent) const
Computes correction on the emission Q-value.
G4INCL::ThreeVector * thePropagationMomentum
G4bool isPion() const
Is this a pion?
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
ParticleList::iterator ParticleMutableIter
G4double thePotentialEnergy
ThreeVector getLongitudinalPosition() const
Longitudinal component of the position w.r.t. the momentum.
ParticleList::const_iterator ParticleIter
std::string getName(const ParticleType t)
Get the native INCL name of the particle.
void setHelicity(G4double h)
virtual void setMomentum(const G4INCL::ThreeVector &momentum)
void setFrozenEnergy(const G4double energy)
Set the frozen particle momentum.
void freezePropagation()
Freeze particle propagation.
G4double getFrozenEnergy() const
Get the frozen particle momentum.