35#define INCLXX_IN_GEANT4_MODE 1
47 :theNucleus(n), theParticle(p)
117 const G4double theProjectileExcitationEnergy =
118 (projectileRemnant->
getA()-theParticle->
getA()>1) ?
121 const G4double theProjectileEffectiveMass =
123 + theProjectileExcitationEnergy;
125 const G4double theProjectileEnergy = std::sqrt(theProjectileMomentum.
mag2() + theProjectileEffectiveMass*theProjectileEffectiveMass);
128 theNucleus->
getA() + theParticle->
getA(),
129 theNucleus->
getZ() + theParticle->
getZ())
131 + theProjectileCorrection;
133 projectileRemnant->
removeParticle(theParticle, theProjectileCorrection);
139 DEBUG(
"The following Particle enters with correction " << theCorrection
140 << theParticle->
print() << std::endl);
144 G4bool success = particleEnters(theCorrection);
161 G4bool ParticleEntryChannel::particleEnters(
const G4double theQValueCorrection) {
175 thePotential(n->getPotential()),
176 theEnergy(theParticle->getEnergy()),
177 theMass(theParticle->getMass()),
178 theQValueCorrection(correction),
179 theMomentum(theParticle->getMomentum())
181 ~IncomingEFunctor() {}
183 G4double energyInside = std::max(theMass, theEnergy + v - theQValueCorrection);
184 theParticle->setEnergy(energyInside);
185 theParticle->setPotentialEnergy(v);
187 theParticle->setMomentum(theMomentum);
188 theParticle->adjustMomentumFromEnergy();
189 return v - thePotential->computePotentialEnergy(theParticle);
191 void cleanUp(
const G4bool )
const {}
193 Particle *theParticle;
194 NuclearPotential::INuclearPotential
const *thePotential;
198 ThreeVector theMomentum;
199 } theIncomingEFunctor(theParticle,theNucleus,theQValueCorrection);
203 DEBUG(
"Particle " << theParticle->
getID() <<
" is trying to enter below 0" << std::endl);
209 theIncomingEFunctor(theSolution.first);
211 WARN(
"Couldn't compute the potential for incoming particle, root-finding algorithm failed." << std::endl);
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.
NuclearPotential::INuclearPotential * getPotential() const
Getter for thePotential.
ProjectileRemnant * getProjectileRemnant() const
Get the projectile remnant.
G4bool isNucleusNucleusCollision() const
Is it a nucleus-nucleus collision?
virtual ~ParticleEntryChannel()
ParticleEntryChannel(Nucleus *n, Particle *p)
FinalState * getFinalState()
static NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
G4double getINCLMass() const
Get the INCL particle mass.
G4double getEmissionQValueCorrection(const G4int AParent, const G4int ZParent) const
Computes correction on the emission Q-value.
G4double getEnergy() const
G4int getZ() const
Returns the charge number.
G4double getKineticEnergy() const
Get the particle kinetic energy.
void setINCLMass()
Set the mass of the Particle to its table mass.
const G4INCL::ThreeVector & getMomentum() const
virtual G4double getTableMass() const
Get the tabulated particle mass.
std::string print() const
G4int getA() const
Returns the baryon number.
G4double computeExcitationEnergy(const long exceptID) const
Compute the excitation energy.
void removeParticle(Particle *const p, const G4double theProjectileCorrection)
Remove a nucleon from the projectile remnant.
static std::pair< G4double, G4double > const & getSolution()
Get the solution of the last call to solve().
static G4bool solve(RootFunctor const *const f, const G4double x0)
Numerically solve a one-dimensional equation.