34#define INCLXX_IN_GEANT4_MODE 1
66 :theNucleus(0), maximumTime(70.0), currentTime(0.0),
67 hadronizationTime(hTime),
69 theLocalEnergyType(localEnergyType),
70 theLocalEnergyDeltaType(localEnergyDeltaType)
86 return shootComposite(projectileSpecies, kineticEnergy, impactParameter, phi);
97 G4double energy = kineticEnergy + projectileMass;
98 G4double momentumZ = std::sqrt(energy*energy - projectileMass*projectileMass);
105 temfin = 30.18 * std::pow(theNucleus->
getA(), 0.17);
108 temfin = 29.8 * std::pow(theNucleus->
getA(), 0.16);
114 temfin *= (5.8E4-TLab)/5.6E4;
116 maximumTime = temfin;
122 const G4double traversalTime = distance / projectileVelocity;
123 if(maximumTime < traversalTime)
124 maximumTime = traversalTime;
125 INCL_DEBUG(
"Cascade stopping time is " << maximumTime <<
'\n');
131 INCL_DEBUG(
"impactParameter>CoulombDistortion::maxImpactParameter" <<
'\n');
137 impactParameter * std::sin(phi),
176 maximumTime = 29.8 * std::pow(theNucleus->
getA(), 0.16);
181 const G4double distance = 2.*rMax + 2.725*rms;
183 const G4double traversalTime = distance / projectileVelocity;
184 if(maximumTime < traversalTime)
185 maximumTime = traversalTime;
186 INCL_DEBUG(
"Cascade stopping time is " << maximumTime <<
'\n');
192 INCL_DEBUG(
"impactParameter>CoulombDistortion::maxImpactParameter" <<
'\n');
199 impactParameter * std::sin(phi),
216 if(theAvatarList.empty()) {
217 INCL_DEBUG(
"No ParticleEntryAvatar found, transparent event" <<
'\n');
257 theNucleus = nucleus;
262 if(anAvatar) theNucleus->
getStore()->
add(anAvatar);
274 G4double minDistOfApproachSquared = 0.0;
276 if(t>maximumTime || t<currentTime+hadronizationTime)
return NULL;
289 const G4bool p1HasLocalEnergy = (hasLocalEnergy && !p1->
isMeson());
290 const G4bool p2HasLocalEnergy = (hasLocalEnergy && !p2->
isMeson());
292 if(p1HasLocalEnergy) {
293 backupParticle1 = *p1;
296 *p1 = backupParticle1;
301 if(p2HasLocalEnergy) {
302 backupParticle2 = *p2;
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 INCL_ERROR(
"Imaginary reflection time for particle: " <<
'\n'
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(), e=updatedParticles.end(); updated!=e; ++updated)
384 for(
ParticleIter particle=particles.begin(), end=particles.end(); particle!=end; ++particle)
390 if(updatedParticles.
contains(*particle))
continue;
399 for(
ParticleIter p1=particles.begin(), e=particles.end(); p1!=e; ++p1) {
401 for(
ParticleIter p2 = p1 + 1; p2 != particles.end(); ++p2) {
409 const G4bool haveExcept = !except.empty();
412 for(
ParticleIter p1=particles.begin(), e=particles.end(); p1!=e; ++p1)
416 for(++p2; p2 != particles.end(); ++p2)
429 for(
ParticleIter iter=particles.begin(), e=particles.end(); iter!=e; ++iter) {
441 for(
ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
449#ifdef INCL_REGENERATE_AVATARS
450 void StandardPropagationModel::generateAllAvatarsExceptUpdated(
FinalState const *
const fs) {
453 for(
ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
459 except.insert(except.end(), entering.begin(), entering.end());
466 for(
ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
467 if((*i)->isDelta()) {
469 G4double time = currentTime + decayTime;
470 if(time <= maximumTime) {
476 G4double time = currentTime + decayTime;
477 if(time <= maximumTime) {
481 if((*i)->isOmega()) {
483 G4double timeOmega = currentTime + decayTimeOmega;
484 if(timeOmega <= maximumTime) {
496#ifdef INCL_REGENERATE_AVATARS
497#warning "The INCL_REGENERATE_AVATARS code has not been tested in a while. Use it at your peril."
502 theNucleus->
getStore()->initialiseParticleAvatarConnections();
503 generateAllAvatarsExceptUpdated(fs);
519 if(created.empty() && entering.empty())
523 updatedParticlesCopy.insert(updatedParticlesCopy.end(), entering.begin(), entering.end());
524 updatedParticlesCopy.insert(updatedParticlesCopy.end(), created.begin(), created.end());
532 if(theAvatar == 0)
return 0;
535 if(theAvatar->
getTime() < currentTime) {
536 INCL_ERROR(
"Avatar time = " << theAvatar->
getTime() <<
", currentTime = " << currentTime <<
'\n');
538 }
else if(theAvatar->
getTime() > currentTime) {
541 currentTime = theAvatar->
getTime();
Static class for selecting Coulomb distortion.
Simple class for computing intersections between a straight line and a sphere.
static G4double getCutNNSquared()
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 G4double computeDecayTime(Particle *p)
ParticleList const & getEnteringParticles() const
ParticleList const & getModifiedParticles() const
FinalStateValidity getValidity() const
ParticleList const & getCreatedParticles() 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 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.
ThreeVector boostVector() const
virtual G4INCL::ParticleSpecies getSpecies() const
Get the particle species.
G4int getS() const
Returns the strangeness number.
G4bool isMeson() const
Is this a Meson?
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
G4double getKineticEnergy() const
Get the particle kinetic energy.
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.
static G4double computeDecayTime(Particle *p)
void storeComponents()
Store the projectile components.
static G4double computeDecayTime(Particle *p)
virtual ~StandardPropagationModel()
G4double getReflectionTime(G4INCL::Particle const *const aParticle)
Get the reflection time.
G4INCL::IAvatar * propagate(FinalState const *const fs)
G4double getTime(G4INCL::Particle const *const particleA, G4INCL::Particle const *const particleB, G4double *minDistOfApproach) const
void generateCollisions(const ParticleList &particles)
Generate and register collisions among particles in a list, except between those in another list.
StandardPropagationModel(LocalEnergyType localEnergyType, LocalEnergyType localEnergyDeltaType, const G4double hTime=0.0)
void setStoppingTime(G4double)
void registerAvatar(G4INCL::IAvatar *anAvatar)
G4double getStoppingTime()
void updateAvatars(const ParticleList &particles)
void generateAllAvatars()
(Re)Generate all possible avatars.
G4double shoot(ParticleSpecies const &projectileSpecies, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)
IAvatar * generateBinaryCollisionAvatar(Particle *const p1, Particle *const p2)
Generate a two-particle avatar.
G4INCL::Nucleus * getNucleus()
void generateUpdatedCollisions(const ParticleList &updatedParticles, const ParticleList &particles)
Generate and register collisions between a list of updated particles and all the other particles.
G4double shootComposite(ParticleSpecies const &s, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)
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()
ParticleList const & getParticles() const
void addParticleEntryAvatar(IAvatar *a)
Add one ParticleEntry avatar.
G4double dot(const ThreeVector &v) const
G4bool contains(const T &t) const
ParticleEntryAvatar * bringToSurface(Particle *p, Nucleus *const n)
Modify the momentum of an incoming particle and position it on the surface of the nucleus.
G4double maxImpactParameter(ParticleSpecies const &p, const G4double kinE, Nucleus const *const n)
Return the maximum impact parameter for Coulomb-distorted trajectories.
G4double total(Particle const *const p1, Particle const *const p2)
Intersection getLaterTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r)
Compute the second intersection of a straight particle trajectory with a sphere.
G4double squareTotalEnergyInCM(Particle const *const p1, Particle const *const p2)
void transformToLocalEnergyFrame(Nucleus const *const n, Particle *const p)
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
G4ThreadLocal ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.
G4double getLargestNuclearRadius(const G4int A, const G4int Z)
ParticleList::const_iterator ParticleIter
@ FirstCollisionLocalEnergy
Intersection-point structure.