34 #define INCLXX_IN_GEANT4_MODE 1
65 :theNucleus(0), maximumTime(70.0), currentTime(0.0),
66 hadronizationTime(hTime),
68 theLocalEnergyType(localEnergyType),
69 theLocalEnergyDeltaType(localEnergyDeltaType)
85 return shootComposite(projectileSpecies, kineticEnergy, impactParameter, phi);
97 G4double momentumZ = std::sqrt(energy*energy - projectileMass*projectileMass);
104 temfin = 30.18 * std::pow(theNucleus->
getA(), 0.17);
107 temfin = 29.8 * std::pow(theNucleus->
getA(), 0.16);
113 temfin *= (5.8E4-TLab)/5.6E4;
115 maximumTime = temfin;
121 const G4double traversalTime = distance / projectileVelocity;
122 if(maximumTime < traversalTime)
123 maximumTime = traversalTime;
124 INCL_DEBUG(
"Cascade stopping time is " << maximumTime <<
'\n');
130 INCL_DEBUG(
"impactParameter>CoulombDistortion::maxImpactParameter" <<
'\n');
136 impactParameter * std::sin(phi),
175 maximumTime = 29.8 * std::pow(theNucleus->
getA(), 0.16);
180 const G4double distance = 2.*rMax + 2.725*rms;
182 const G4double traversalTime = distance / projectileVelocity;
183 if(maximumTime < traversalTime)
184 maximumTime = traversalTime;
185 INCL_DEBUG(
"Cascade stopping time is " << maximumTime <<
'\n');
191 INCL_DEBUG(
"impactParameter>CoulombDistortion::maxImpactParameter" <<
'\n');
198 impactParameter * std::sin(phi),
215 if(theAvatarList.empty()) {
216 INCL_DEBUG(
"No ParticleEntryAvatar found, transparent event" <<
'\n');
256 theNucleus = nucleus;
261 if(anAvatar) theNucleus->
getStore()->
add(anAvatar);
273 G4double minDistOfApproachSquared = 0.0;
275 if(t>maximumTime || t<currentTime+hadronizationTime)
return NULL;
288 const G4bool p1HasLocalEnergy = (hasLocalEnergy && !p1->
isPion());
289 const G4bool p2HasLocalEnergy = (hasLocalEnergy && !p2->
isPion());
291 if(p1HasLocalEnergy) {
292 backupParticle1 = *p1;
295 *p1 = backupParticle1;
300 if(p2HasLocalEnergy) {
301 backupParticle2 = *p2;
304 *p2 = backupParticle2;
305 if(p1HasLocalEnergy) {
306 *p1 = backupParticle1;
318 if(p1HasLocalEnergy) {
319 *p1 = backupParticle1;
321 if(p2HasLocalEnergy) {
322 *p2 = backupParticle2;
331 if(
Math::tenPi*minDistOfApproachSquared > totalCrossSection)
return NULL;
347 if(theIntersection.
exists) {
348 time = currentTime + theIntersection.
time;
350 INCL_ERROR(
"Imaginary reflection time for particle: " <<
'\n'
351 << aParticle->
print());
368 (*minDistOfApproach) = 100000.0;
369 return currentTime + 100000.0;
373 (*minDistOfApproach) = distance.
mag2() + time * t7;
374 return currentTime + time;
380 for(
ParticleIter updated=updatedParticles.begin(), e=updatedParticles.end(); updated!=e; ++updated)
383 for(
ParticleIter particle=particles.begin(), end=particles.end(); particle!=end; ++particle)
389 if(updatedParticles.
contains(*particle))
continue;
398 for(
ParticleIter p1=particles.begin(), e=particles.end(); p1!=e; ++p1) {
400 for(
ParticleIter p2 = p1 + 1; p2 != particles.end(); ++p2) {
408 const G4bool haveExcept = !except.empty();
411 for(
ParticleIter p1=particles.begin(), e=particles.end(); p1!=e; ++p1)
415 for(++p2; p2 != particles.end(); ++p2)
428 for(
ParticleIter iter=particles.begin(), e=particles.end(); iter!=e; ++iter) {
440 for(
ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
448 #ifdef INCL_REGENERATE_AVATARS
449 void StandardPropagationModel::generateAllAvatarsExceptUpdated(
FinalState const *
const fs) {
452 for(
ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
458 except.insert(except.end(), entering.begin(), entering.end());
465 for(
ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
466 if((*i)->isDelta()) {
468 G4double time = currentTime + decayTime;
469 if(time <= maximumTime) {
488 #ifdef INCL_REGENERATE_AVATARS
489 #warning "The INCL_REGENERATE_AVATARS code has not been tested in a while. Use it at your peril."
494 theNucleus->
getStore()->initialiseParticleAvatarConnections();
495 generateAllAvatarsExceptUpdated(fs);
511 if(created.empty() && entering.empty())
515 updatedParticlesCopy.insert(updatedParticlesCopy.end(), entering.begin(), entering.end());
516 updatedParticlesCopy.insert(updatedParticlesCopy.end(), created.begin(), created.end());
524 if(theAvatar == 0)
return 0;
527 if(theAvatar->
getTime() < currentTime) {
528 INCL_ERROR(
"Avatar time = " << theAvatar->
getTime() <<
", currentTime = " << currentTime <<
'\n');
530 }
else if(theAvatar->
getTime() > currentTime) {
533 currentTime = theAvatar->
getTime();
G4int getA() const
Returns the baryon number.
G4double shootComposite(ParticleSpecies const &s, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)
G4double shoot(ParticleSpecies const &projectileSpecies, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)
void registerAvatar(G4INCL::IAvatar *anAvatar)
ParticleEntryAvatar * bringToSurface(Particle *p, Nucleus *const n)
Modify the momentum of an incoming particle and position it on the surface of the nucleus...
G4bool isResonance() const
Is it a resonance?
FinalStateValidity getValidity() const
void generateAllAvatars()
(Re)Generate all possible avatars.
G4double getMass() const
Get the cached particle mass.
void setIncomingAngularMomentum(const ThreeVector &j)
Set the incoming angular-momentum vector.
void setIncomingMomentum(const ThreeVector &p)
Set the incoming momentum vector.
G4ThreadLocal ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.
G4double dot(const ThreeVector &v) const
ParticleList const & getParticles() const
void transformToLocalEnergyFrame(Nucleus const *const n, Particle *const p)
G4int getAcceptedCollisions() const
ThreeVector getPropagationVelocity() const
Get the propagation velocity of the particle.
void setInitialEnergy(const G4double e)
Set the initial energy.
G4double squareTotalEnergyInCM(Particle const *const p1, Particle const *const p2)
ParticleList const & getModifiedParticles() const
void generateCollisions(const ParticleList &particles)
Generate and register collisions among particles in a list, except between those in another list...
IAvatar * findSmallestTime()
const G4INCL::ThreeVector & getMomentum() const
G4INCL::IAvatar * propagate(FinalState const *const fs)
void setParticleNucleusCollision()
Set a particle-nucleus collision.
std::string print() const
G4double getReflectionTime(G4INCL::Particle const *const aParticle)
Get the reflection time.
void updateAvatars(const ParticleList &particles)
void storeComponents()
Store the projectile components.
G4double getEnergy() const
void setINCLMass()
Set the mass of the Particle to its table mass.
virtual void makeProjectileSpectator()
void propagate(G4double step)
G4double maxImpactParameter(ParticleSpecies const &p, const G4double kinE, Nucleus const *const n)
Return the maximum impact parameter for Coulomb-distorted trajectories.
void setNucleus(G4INCL::Nucleus *nucleus)
G4double getSurfaceRadius(Particle const *const particle) const
Get the maximum allowed radius for a given particle.
G4bool isParticipant() const
ThreeVector boostVector() const
void setStoppingTime(G4double)
G4double getTime(G4INCL::Particle const *const particleA, G4INCL::Particle const *const particleB, G4double *minDistOfApproach) const
void setEnergy(G4double energy)
Intersection getLaterTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r)
Compute the second intersection of a straight particle trajectory with a sphere.
G4INCL::ThreeVector getAngularMomentum() const
Get the total angular momentum (orbital + spin)
static G4double computeDecayTime(Particle *p)
void addParticleEntryAvatars(IAvatarList const &al)
Add one ParticleEntry avatar.
ParticleList const & getCreatedParticles() const
Static class for selecting Coulomb distortion.
ParticipantType getParticipantType() const
G4double getLargestNuclearRadius(const G4int A, const G4int Z)
static G4double getCutNNSquared()
virtual G4INCL::ThreeVector getAngularMomentum() const
virtual void setPosition(const G4INCL::ThreeVector &position)
G4double getCurrentTime()
G4int getZ() const
Returns the charge number.
ThreeVector getTransversePosition() const
Transverse component of the position w.r.t. the momentum.
IAvatar * generateBinaryCollisionAvatar(Particle *const p1, Particle *const p2)
Generate a two-particle avatar.
void generateDecays(const ParticleList &particles)
Generate decays for particles that can decay.
void addParticleEntryAvatar(IAvatar *a)
Add one ParticleEntry avatar.
G4INCL::Nucleus * getNucleus()
G4double total(Particle const *const p1, Particle const *const p2)
G4double energy(const ThreeVector &p, const G4double m)
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
StandardPropagationModel(LocalEnergyType localEnergyType, LocalEnergyType localEnergyDeltaType, const G4double hTime=0.0)
void setProjectileRemnant(ProjectileRemnant *const c)
Set the projectile remnant.
ParticleList const & getEnteringParticles() const
const G4INCL::ThreeVector & getPosition() const
void setCurrentTime(G4double t)
G4double getKineticEnergy() const
Get the particle kinetic energy.
virtual G4INCL::ParticleSpecies getSpecies() const
Get the particle species.
G4double getUniverseRadius() const
Getter for theUniverseRadius.
G4bool contains(const T &t) const
Intersection-point structure.
virtual ~StandardPropagationModel()
G4double shootParticle(ParticleType const t, 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...
G4bool isPion() const
Is this a pion?
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
void setNucleusNucleusCollision()
Set a nucleus-nucleus collision.
G4double getStoppingTime()
void timeStep(G4double step)
void setPosition(const ThreeVector &position)
Set the position of the cluster.
ParticleList::const_iterator ParticleIter
Simple class for computing intersections between a straight line and a sphere.