33 #define INCLXX_IN_GEANT4_MODE 1
45 :theNucleus(n), theParticle(p)
115 const G4double theProjectileExcitationEnergy =
116 (projectileRemnant->
getA()-theParticle->
getA()>1) ?
119 const G4double theProjectileEffectiveMass =
121 + theProjectileExcitationEnergy;
123 const G4double theProjectileEnergy = std::sqrt(theProjectileMomentum.mag2() + theProjectileEffectiveMass*theProjectileEffectiveMass);
126 theNucleus->
getA() + theParticle->
getA(),
127 theNucleus->
getZ() + theParticle->
getZ())
129 + theProjectileCorrection;
131 projectileRemnant->
removeParticle(theParticle, theProjectileCorrection);
137 DEBUG(
"The following Particle enters with correction " << theCorrection
138 << theParticle->
print() << std::endl);
142 G4bool success = particleEnters(theCorrection);
159 G4bool ParticleEntryChannel::particleEnters(
const G4double theQValueCorrection) {
173 thePotential(n->getPotential()),
174 theEnergy(theParticle->getEnergy()),
175 theMass(theParticle->getMass()),
176 theQValueCorrection(correction),
177 theMomentum(theParticle->getMomentum())
179 ~IncomingEFunctor() {}
181 G4double energyInside = std::max(theMass, theEnergy + v - theQValueCorrection);
182 theParticle->setEnergy(energyInside);
183 theParticle->setPotentialEnergy(v);
185 theParticle->setMomentum(theMomentum);
186 theParticle->adjustMomentumFromEnergy();
187 return v - thePotential->computePotentialEnergy(theParticle);
189 void cleanUp(
const G4bool )
const {}
191 Particle *theParticle;
192 NuclearPotential::INuclearPotential
const *thePotential;
196 ThreeVector theMomentum;
197 } theIncomingEFunctor(theParticle,theNucleus,theQValueCorrection);
201 DEBUG(
"Particle " << theParticle->
getID() <<
" is trying to enter below 0" << std::endl);
207 theIncomingEFunctor(theSolution.first);
209 WARN(
"Couldn't compute the potential for incoming particle, root-finding algorithm failed." << std::endl);