35#define INCLXX_IN_GEANT4_MODE 1
65 :theNucleus(0), maximumTime(70.0), currentTime(0.0), firstAvatar(true),
66 theLocalEnergyType(localEnergyType),
67 theLocalEnergyDeltaType(localEnergyDeltaType)
83 return shootComposite(projectileSpecies, kineticEnergy, impactParameter, phi);
94 G4double energy = kineticEnergy + projectileMass;
95 G4double momentumZ = std::sqrt(energy*energy - projectileMass*projectileMass);
101 temfin = 29.8 * std::pow(theNucleus->
getA(), 0.16);
104 temfin = 30.18 * std::pow(theNucleus->
getA(), 0.17*(1.0 - 5.7E-5*tlab));
107 maximumTime = temfin;
113 const G4double traversalTime = distance / projectileVelocity;
114 if(maximumTime < traversalTime)
115 maximumTime = traversalTime;
116 DEBUG(
"Cascade stopping time is " << maximumTime << std::endl);
122 DEBUG(
"impactParameter>CoulombDistortion::maxImpactParameter" << std::endl);
128 impactParameter * std::sin(phi),
170 maximumTime = 29.8 * std::pow(theNucleus->
getA(), 0.16);
175 const G4double distance = 2.*rMax + 2.725*rms;
177 const G4double traversalTime = distance / projectileVelocity;
178 if(maximumTime < traversalTime)
179 maximumTime = traversalTime;
180 DEBUG(
"Cascade stopping time is " << maximumTime << std::endl);
187 DEBUG(
"impactParameter>CoulombDistortion::maxImpactParameter" << std::endl);
194 impactParameter * std::sin(phi),
222 if(theAvatarList.empty()) {
223 DEBUG(
"No ParticleEntryAvatar found, transparent event" << std::endl);
257 theNucleus = nucleus;
262 if(anAvatar) theNucleus->
getStore()->
add(anAvatar);
274 G4double minDistOfApproachSquared = 0.0;
276 if(t>maximumTime || t<currentTime)
return NULL;
289 const G4bool p1HasLocalEnergy = (hasLocalEnergy && !p1->
isPion());
290 const G4bool p2HasLocalEnergy = (hasLocalEnergy && !p2->
isPion());
293 if(p1HasLocalEnergy) {
296 *p1 = backupParticle1;
302 if(p2HasLocalEnergy) {
305 *p2 = backupParticle2;
306 if(p1HasLocalEnergy) {
307 *p1 = backupParticle1;
319 if(p1HasLocalEnergy) {
320 *p1 = backupParticle1;
322 if(p2HasLocalEnergy) {
323 *p2 = backupParticle2;
332 if(
Math::tenPi*minDistOfApproachSquared > totalCrossSection)
return NULL;
348 if(theIntersection.
exists) {
349 time = currentTime + theIntersection.
time;
351 ERROR(
"Imaginary reflection time for particle: " << std::endl
352 << aParticle->
print());
369 (*minDistOfApproach) = 100000.0;
370 return currentTime + 100000.0;
374 (*minDistOfApproach) = distance.
mag2() + time * t7;
375 return currentTime + time;
381 for(
ParticleIter updated = updatedParticles.begin(); updated != updatedParticles.end(); ++updated)
384 for(
ParticleIter particle = particles.begin(); particle != particles.end(); ++particle)
390 if((*particle)->isInList(updatedParticles))
continue;
400 haveExcept=(except.size()!=0);
403 for(
ParticleIter p1 = particles.begin(); p1 != particles.end(); ++p1)
407 for(++p2; p2 != particles.end(); ++p2)
410 if(haveExcept && (*p1)->isInList(except) && (*p2)->isInList(except))
continue;
420 for(
ParticleIter iter = particles.begin(); iter != particles.end(); ++iter) {
430 if(particles.empty()) {
ERROR(
"No particles inside the nucleus!" << std::endl); }
431 for(
ParticleIter i = particles.begin(); i != particles.end(); ++i) {
443 for(
ParticleIter i = particles.begin(); i != particles.end(); ++i) {
444 if((*i)->isDelta()) {
446 G4double time = currentTime + decayTime;
447 if(time <= maximumTime) {
458#ifdef INCL_REGENERATE_AVATARS
459#warning "The INCL_REGENERATE_AVATARS code has not been tested in a while. Use it at your peril."
473 updatedParticles.push_back(blockedDelta);
478 needNewAvatars.splice(needNewAvatars.end(), created);
483 if(theAvatar == 0)
return 0;
486 if(theAvatar->
getTime() < currentTime) {
487 ERROR(
"Avatar time = " << theAvatar->
getTime() <<
", currentTime = " << currentTime << std::endl);
489 }
else if(theAvatar->
getTime() > currentTime) {
492 currentTime = theAvatar->
getTime();
499 void StandardPropagationModel::putSpectatorsOnShell(
IAvatarList const &entryAvatars,
ParticleList const &spectators) {
501 for(
ParticleIter p=spectators.begin(); p!=spectators.end(); ++p) {
503 const G4double oldEnergy = (*p)->getEnergy();
504 (*p)->setTableMass();
505 (*p)->adjustEnergyFromMomentum();
506 deltaE += (*p)->getEnergy() - oldEnergy;
509 deltaE /= entryAvatars.size();
511 for(
IAvatarIter a=entryAvatars.begin(); a!=entryAvatars.end(); ++a) {
516 const G4double energy = p->getEnergy() - deltaE
518 p->setEnergy(energy);
519 const G4double newMass = std::sqrt(energy*energy - p->getMomentum().mag2());
Static class for selecting Coulomb distortion.
Simple class for computing intersections between a straight line and a sphere.
static const G4double cutNNSquared
void setCurrentTime(G4double t)
G4int getAcceptedCollisions() const
G4INCL::ThreeVector getAngularMomentum() const
Get the total angular momentum (orbital + spin)
void setPosition(const ThreeVector &position)
Set the position of the cluster.
static ParticleEntryAvatar * bringToSurface(Particle *p, Nucleus *const n)
Modify the momentum of an incoming particle and position it on the surface of the nucleus.
static G4double maxImpactParameter(ParticleSpecies const &p, const G4double kinE, Nucleus const *const n)
Return the maximum impact parameter for Coulomb-distorted trajectories.
static G4double total(Particle const *const p1, Particle const *const p2)
static G4double computeDecayTime(Particle *p)
virtual ParticleList getParticles() const =0
static Intersection getLaterTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r)
static G4double squareTotalEnergyInCM(Particle const *const p1, Particle const *const p2)
static void transformToLocalEnergyFrame(Nucleus const *const n, Particle *const p)
Particle * getBlockedDelta() const
Get the delta that could not decay.
ParticleList const & getUpdatedParticles() const
void setIncomingAngularMomentum(const ThreeVector &j)
Set the incoming angular-momentum vector.
void setInitialEnergy(const G4double e)
Set the initial energy.
G4double getSurfaceRadius(Particle const *const particle) const
Get the maximum allowed radius for a given particle.
void setProjectileMassNumber(G4int n)
Set the mass number of the projectile.
ParticleList const & getCreatedParticles() const
void setProjectileChargeNumber(G4int n)
Set the charge number of the projectile.
void setIncomingMomentum(const ThreeVector &p)
Set the incoming momentum vector.
void setParticleNucleusCollision()
Set a particle-nucleus collision.
void setNucleusNucleusCollision()
Set a nucleus-nucleus collision.
void setProjectileRemnant(ProjectileRemnant *const c)
Set the projectile remnant.
G4double getUniverseRadius() const
Getter for theUniverseRadius.
static G4double getINCLMass(const G4int A, const G4int Z)
Get INCL nuclear mass (in MeV/c^2)
static NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
static ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.
static G4double getNuclearRadius(const G4int A, const G4int Z)
ThreeVector boostVector() const
virtual G4INCL::ParticleSpecies getSpecies() const
Get the particle species.
virtual G4INCL::ThreeVector getAngularMomentum() const
G4double getEnergy() const
ParticipantType getParticipantType() const
ThreeVector getPropagationVelocity() const
Get the propagation velocity of the particle.
void propagate(G4double step)
G4int getZ() const
Returns the charge number.
const G4INCL::ThreeVector & getPosition() const
G4bool isParticipant() const
virtual void makeProjectileSpectator()
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.
const G4INCL::ThreeVector & getMomentum() const
G4bool isResonance() const
Is it a resonance?
void setEnergy(G4double energy)
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.
virtual void setPosition(const G4INCL::ThreeVector &position)
G4int getA() const
Returns the baryon number.
void storeComponents()
Store the projectile components.
G4double shootComposite(ParticleSpecies const s, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)
virtual ~StandardPropagationModel()
G4double getReflectionTime(G4INCL::Particle const *const aParticle)
Get the reflection time.
G4double getTime(G4INCL::Particle const *const particleA, G4INCL::Particle const *const particleB, G4double *minDistOfApproach) const
void generateAllAvatars(G4bool excludeUpdated=false)
(Re)Generate all possible avatars.
G4INCL::IAvatar * propagate()
void setStoppingTime(G4double)
void registerAvatar(G4INCL::IAvatar *anAvatar)
G4double getStoppingTime()
void updateAvatars(const ParticleList &particles)
IAvatar * generateBinaryCollisionAvatar(Particle *const p1, Particle *const p2) const
Generate a two-particle avatar.
StandardPropagationModel(LocalEnergyType localEnergyType, LocalEnergyType localEnergyDeltaType)
G4INCL::Nucleus * getNucleus()
G4double shoot(ParticleSpecies const projectileSpecies, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)
void generateUpdatedCollisions(const ParticleList &updatedParticles, const ParticleList &particles)
Generate and register collisions between a list of updated particles and all the other particles.
void generateCollisions(const ParticleList &particles, const ParticleList &except)
Generate and register collisions among particles in a list, except between those in another list.
G4double getCurrentTime()
void generateDecays(const ParticleList &particles)
Generate decays for particles that can decay.
void setNucleus(G4INCL::Nucleus *nucleus)
G4double shootParticle(ParticleType const t, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)
void addParticleEntryAvatars(IAvatarList const &al)
Add one ParticleEntry avatar.
void timeStep(G4double step)
IAvatar * findSmallestTime()
void initialiseParticleAvatarConnections()
Initialise the particleAvatarConnections map.
ParticleList const & getParticles() const
void addParticleEntryAvatar(IAvatar *a)
Add one ParticleEntry avatar.
G4double dot(const ThreeVector &v) const
std::list< IAvatar * >::const_iterator IAvatarIter
@ FirstCollisionLocalEnergy
std::list< IAvatar * > IAvatarList
std::list< G4INCL::Particle * > ParticleList
std::list< G4INCL::Particle * >::const_iterator ParticleIter
Intersection-point structure.