34#define INCLXX_IN_GEANT4_MODE 1
46 :theNucleus(
n), theParticle(p)
119 const G4double theProjectileExcitationEnergy =
127 const G4double theProjectileEffectiveMass =
129 + theProjectileExcitationEnergy;
131 const G4double theProjectileEnergy = std::sqrt(theProjectileMomentum.
mag2() + theProjectileEffectiveMass*theProjectileEffectiveMass);
138 + theProjectileCorrection;
150 INCL_DEBUG(
"The following Particle enters with correction " << theCorrection <<
'\n'
184 thePotential(
n->getPotential()),
187 theQValueCorrection(correction),
188 refraction(
n->getStore()->getConfig()->getRefraction()),
197 if(cosIncidenceAngle < -1.)
198 sinIncidenceAnglePOut = 0.;
200 sinIncidenceAnglePOut = theMomentumDirection.mag()*std::sqrt(1.-cosIncidenceAngle*cosIncidenceAngle);
202 sinIncidenceAnglePOut = 0.;
205 ~IncomingEFunctor() {}
207 G4double energyInside =
std::max(theMass, theEnergy + v - theQValueCorrection);
212 const G4double pIn = std::sqrt(energyInside*energyInside-theMass*theMass);
213 const G4double sinRefractionAngle = sinIncidenceAnglePOut/pIn;
214 const G4double cosRefractionAngle = (sinRefractionAngle>1.) ? 0. : std::sqrt(1.-sinRefractionAngle*sinRefractionAngle);
222 return v - thePotential->computePotentialEnergy(
theParticle);
224 void cleanUp(
const G4bool )
const {}
244 theIncomingEFunctor(theSolution.
x);
247 INCL_WARN(
"Couldn't compute the potential for incoming particle, root-finding algorithm failed." <<
'\n');
Simple class for computing intersections between a straight line and a sphere.
Static root-finder algorithm.
void makeParticleBelowFermi()
void addEnteringParticle(Particle *p)
void makeParticleBelowZero()
void setTotalEnergyBeforeInteraction(G4double E)
virtual G4double computePotentialEnergy(const Particle *const p) const =0
G4double getFermiEnergy(const Particle *const p) const
Return the Fermi energy for a particle.
ProjectileRemnant * getProjectileRemnant() const
Get the projectile remnant.
G4bool isNucleusNucleusCollision() const
Is it a nucleus-nucleus collision?
NuclearPotential::INuclearPotential const * getPotential() const
Getter for thePotential.
virtual ~ParticleEntryChannel()
G4bool particleEnters(const G4double theQValueCorrection)
Modify particle that enters the nucleus.
void fillFinalState(FinalState *fs)
ParticleEntryChannel(Nucleus *n, Particle *p)
G4double getINCLMass() const
Get the INCL particle mass.
void setPotentialEnergy(G4double v)
Set the particle potential energy.
G4int getS() const
Returns the strangeness number.
G4double getEmissionQValueCorrection(const G4int AParent, const G4int ZParent) const
Computes correction on the emission Q-value.
void setNumberOfKaon(const G4int NK)
G4double getEnergy() const
G4bool isNucleonorLambda() const
Is this a Nucleon or a Lambda?
G4int getZ() const
Returns the charge number.
const G4INCL::ThreeVector & getPosition() const
G4double getKineticEnergy() const
Get the particle kinetic energy.
G4double getCosRPAngle() const
Get the cosine of the angle between position and momentum.
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
void setINCLMass()
Set the mass of the Particle to its table mass.
const G4INCL::ThreeVector & getMomentum() const
virtual void setMomentum(const G4INCL::ThreeVector &momentum)
G4bool isKaon() const
Is this a Kaon?
G4int getNumberOfKaon() const
Number of Kaon inside de nucleus.
virtual G4double getTableMass() const
Get the tabulated particle mass.
void setEnergy(G4double energy)
std::string print() const
G4double getMass() const
Get the cached particle mass.
G4int getA() const
Returns the baryon number.
void removeParticle(Particle *const p, const G4double theProjectileCorrection)
Remove a nucleon from the projectile remnant.
G4double computeExcitationEnergyExcept(const long exceptID) const
Compute the excitation energy when a nucleon is removed.
static double normal(HepRandomEngine *eptr)
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
Solution solve(RootFunctor const *const f, const G4double x0)
Numerically solve a one-dimensional equation.