34#define INCLXX_IN_GEANT4_MODE 1
104 theHelicity(rhs.theHelicity),
105 emissionTime(rhs.emissionTime),
106 outOfWell(rhs.outOfWell),
120 theBiasCollisionVector = rhs.theBiasCollisionVector;
149 std::swap(theHelicity, rhs.theHelicity);
150 std::swap(emissionTime, rhs.emissionTime);
151 std::swap(outOfWell, rhs.outOfWell);
153 std::swap(theMass, rhs.theMass);
158 std::swap(theBiasCollisionVector, rhs.theBiasCollisionVector);
170 swap(temporaryParticle);
292 INCL_ERROR(
"Trying to set particle type to Unknown!" <<
'\n');
424 const G4double gamma = 1.0 / std::sqrt(1.0 - beta2);
426 const G4double alpha = (gamma*gamma)/(1.0 + gamma);
442 const G4double gamma = 1.0 / std::sqrt(1.0 - beta2);
444 const ThreeVector transversePosition = theRelativePosition - aBoostVector * (theRelativePosition.
dot(aBoostVector) / aBoostVector.
mag2());
445 const ThreeVector longitudinalPosition = theRelativePosition - transversePosition;
447 thePosition = refPos + transversePosition + longitudinalPosition / gamma;
490 INCL_ERROR(
"Particle::getINCLMass: Unknown particle type." <<
'\n');
533 INCL_ERROR(
"Particle::getTableMass: Unknown particle type." <<
'\n');
576 INCL_ERROR(
"Particle::getRealMass: Unknown particle type." <<
'\n');
603 const G4int SParent = 0;
606 const G4int SDaughter = 0;
616 theQValue = massTableParent - massTableDaughter - massTableParticle;
624 return theQValue - (massINCLParent-massINCLDaughter-massINCLParticle);
643 const G4int SFrom = 0;
645 const G4int AFromDaughter = AFrom -
theA;
646 const G4int ZFromDaughter = ZFrom -
theZ;
647 const G4int SFromDaughter = 0;
650 const G4int SToDaughter = 0;
663 return theQValue - (massINCLToDaughter-massINCLTo-massINCLParticle);
691 theQValue = massTableParent - massTableDaughter - massTableParticle;
699 return theQValue - (massINCLParent-massINCLDaughter-massINCLParticle);
720 const G4int AFromDaughter = AFrom -
theA;
721 const G4int ZFromDaughter = ZFrom -
theZ;
722 const G4int SFromDaughter = SFrom -
theS;
738 return theQValue - (massINCLToDaughter-massINCLTo-massINCLParticle);
754 return std::sqrt(mass);
780 this->theMass = mass;
830 thePosition += ((*thePropagationMomentum)*(step/(*thePropagationEnergy)));
954 std::stringstream ss;
955 ss <<
"Particle (ID = " <<
ID <<
") type = ";
969 std::stringstream ss;
970 ss <<
"(particle " <<
ID <<
" ";
987 INCL_WARN(
"Particle::getParticles() method was called on a Particle object" <<
'\n');
1042 this->theBiasCollisionVector = BiasCollisionVector;
1070#ifdef INCLXX_IN_GEANT4_MODE
1108 std::vector<G4int> theBiasCollisionVector;
Singleton for recycling allocation of instances of a given class.
#define INCL_DECLARE_ALLOCATION_POOL(T)
G4double getParticleListBias() const
std::vector< G4int > getParticleListBiasVector() const
void rotateMomentum(const G4double angle, const ThreeVector &axis) const
void boost(const ThreeVector &b) const
void rotatePosition(const G4double angle, const ThreeVector &axis) const
void rotatePositionAndMomentum(const G4double angle, const ThreeVector &axis) const
ThreeVector boostVector() const
G4double getINCLMass() const
Get the INCL particle mass.
G4bool isBaryon() const
Is this a Baryon?
virtual G4INCL::ParticleSpecies getSpecies() const
Get the particle species.
void setPotentialEnergy(G4double v)
Set the particle potential energy.
ParticleList const * getParticles() const
G4bool isPhoton() const
Is this a photon?
G4INCL::ThreeVector * thePropagationMomentum
G4bool isLambda() const
Is this a Lambda?
G4int getS() const
Returns the strangeness number.
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
void setBiasCollisionVector(std::vector< G4int > BiasCollisionVector)
Set the vector list of biased vertices on the particle path.
void setNumberOfKaon(const G4int NK)
G4bool isMeson() const
Is this a Meson?
virtual G4INCL::ThreeVector getAngularMomentum() const
void setFrozenMomentum(const ThreeVector &momentum)
Set the frozen particle momentum.
G4double getFrozenEnergy() const
Get the frozen particle momentum.
void setUncorrelatedMomentum(const G4double p)
Set the uncorrelated momentum.
G4double getEnergy() const
G4double getPotentialEnergy() const
Get the particle potential energy.
G4bool isStrange() const
Is this an Strange?
void incrementNumberOfDecays()
Increment the number of decays undergone by the particle.
G4bool isEtaPrime() const
Is this an etaprime?
static std::vector< G4double > INCLBiasVector
Time ordered vector of all bias applied.
void rpCorrelate()
Make the particle follow a strict r-p correlation.
void setMass(G4double mass)
G4bool isNucleonorLambda() const
Is this a Nucleon or a Lambda?
G4bool isOmega() const
Is this an omega?
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
virtual void rotatePositionAndMomentum(const G4double angle, const ThreeVector &axis)
Rotate the particle position and momentum.
void setParticipantType(ParticipantType const p)
ParticipantType theParticipantType
void propagate(G4double step)
G4int getZ() const
Returns the charge number.
static void FillINCLBiasVector(G4double newBias)
G4bool isSigma() const
Is this a Sigma?
const G4INCL::ThreeVector & getPosition() const
void setParticleBias(G4double ParticleBias)
Set the particle bias.
G4bool isParticipant() const
G4double getKineticEnergy() const
Get the particle kinetic energy.
G4INCL::ParticleType theType
Particle(const Particle &rhs)
Copy constructor.
G4double getReflectionMomentum() const
Return the reflection momentum.
G4bool isTargetSpectator() const
static std::vector< G4int > MergeVectorBias(Particle const *const p1, Particle const *const p2)
virtual void rotateMomentum(const G4double angle, const ThreeVector &axis)
Rotate the particle momentum.
G4int theNKaon
The number of Kaons inside the nucleus (update during the cascade)
G4double getCosRPAngle() const
Get the cosine of the angle between position and momentum.
std::vector< G4int > getBiasCollisionVector() const
Get the vector list of biased vertices on the particle path.
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.
G4bool isEta() const
Is this an eta?
virtual void makeProjectileSpectator()
G4double adjustEnergyFromMomentum()
Recompute the energy to match the momentum.
static void setINCLBiasVector(std::vector< G4double > NewVector)
static G4double getTotalBias()
General bias vector function.
virtual void rotatePosition(const G4double angle, const ThreeVector &axis)
Rotate the particle position.
G4double getParticleBias() const
Get the particle bias.
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.
G4double getRealMass() const
Get the real particle mass.
G4double uncorrelatedMomentum
G4bool isProjectileSpectator() const
G4bool isAntiKaon() const
Is this an antiKaon?
const G4INCL::ThreeVector & getMomentum() const
void rpDecorrelate()
Make the particle not follow a strict r-p correlation.
Particle & operator=(const Particle &rhs)
Assignment operator.
virtual void setMomentum(const G4INCL::ThreeVector &momentum)
G4INCL::ParticleType getType() const
G4bool isKaon() const
Is this a Kaon?
G4int getNumberOfKaon() const
Number of Kaon inside de nucleus.
void thawPropagation()
Unfreeze particle propagation.
virtual G4double getTableMass() const
Get the tabulated particle mass.
G4double getEmissionQValueCorrection(const G4int AParent, const G4int ZParent, const G4int SParent) const
Computes correction on the emission Q-value for hypernuclei.
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)
static G4ThreadLocal G4int nextBiasedCollisionID
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.
static G4double getBiasFromVector(std::vector< G4int > VectorBias)
G4int getA() const
Returns the baryon number.
G4bool isHyperon() const
Is this an Hyperon?
G4INCL::ThreeVector thePosition
G4INCL::ThreeVector theFrozenMomentum
void setNumberOfCollisions(G4int n)
Set the number of collisions undergone by the particle.
G4double getTransferQValueCorrection(const G4int AFrom, const G4int ZFrom, const G4int SFrom, const G4int ATo, const G4int ZTo, const G4int STo) const
Computes correction on the transfer Q-value for hypernuclei.
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
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
G4double getTableQValue(const G4int A1, const G4int Z1, const G4int S1, const G4int A2, const G4int Z2, const G4int S2)
Get Q-value (in MeV/c^2)
G4ThreadLocal ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.
G4double getRealMass(const G4INCL::ParticleType t)
Get particle mass (in MeV/c^2)
G4double getINCLMass(const G4int A, const G4int Z, const G4int S)
Get INCL nuclear mass (in MeV/c^2)
std::string getName(const ParticleType t)
Get the native INCL name of the particle.
ParticleList::iterator ParticleMutableIter
ParticleList::const_iterator ParticleIter