34#define INCLXX_IN_GEANT4_MODE 1
68 :theNucleus(0), maximumTime(70.0), currentTime(0.0),
69 hadronizationTime(hTime),
71 theLocalEnergyType(localEnergyType),
72 theLocalEnergyDeltaType(localEnergyDeltaType)
90 return shootComposite(projectileSpecies, kineticEnergy, impactParameter, phi);
108 G4double energy = kineticEnergy + projectileMass;
109 G4double momentumZ = std::sqrt(energy*energy - projectileMass*projectileMass);
120 std::vector<G4double> energies;
121 std::vector<G4double> projections;
124 for(
ParticleIter pit = fslist.begin(), e = fslist.end(); pit!=e; ++pit){
125 energies.push_back((*pit)->getKineticEnergy());
126 ab = (*pit)->boostVector();
127 cd = (*pit)->getPosition();
128 projections.push_back(ab.
dot(cd));
131 temfin = 30.18 * std::pow(theNucleus->
getA(), 0.17);
132 TLab = *max_element(energies.begin(), energies.end());
136 temfin *= (5.8E4-TLab)/5.6E4;
138 maximumTime = temfin;
143 const G4double maxMesonVelocityProjection = *max_element(energies.begin(), energies.end());
144 const G4double traversalTime = distance / maxMesonVelocityProjection;
145 if(maximumTime < traversalTime)
146 maximumTime = traversalTime;
147 INCL_DEBUG(
"Cascade stopping time is " << maximumTime <<
'\n');
163 for(
ParticleIter p = fslist.begin(), e = fslist.end(); p!=e; ++p){
164 (*p)->makeProjectileSpectator();
187 G4double energy = kineticEnergy + projectileMass;
188 G4double momentumZ = std::sqrt(energy*energy - projectileMass*projectileMass);
195 temfin = 30.18 * std::pow(theNucleus->
getA(), 0.17);
198 temfin = 29.8 * std::pow(theNucleus->
getA(), 0.16);
204 temfin *= (5.8E4-TLab)/5.6E4;
206 maximumTime = temfin;
212 const G4double traversalTime = distance / projectileVelocity;
213 if(maximumTime < traversalTime)
214 maximumTime = traversalTime;
215 INCL_DEBUG(
"Cascade stopping time is " << maximumTime <<
'\n');
221 INCL_DEBUG(
"impactParameter>CoulombDistortion::maxImpactParameter" <<
'\n');
227 impactParameter * std::sin(phi),
266 maximumTime = 29.8 * std::pow(theNucleus->
getA(), 0.16);
271 const G4double distance = 2.*rMax + 2.725*rms;
273 const G4double traversalTime = distance / projectileVelocity;
274 if(maximumTime < traversalTime)
275 maximumTime = traversalTime;
276 INCL_DEBUG(
"Cascade stopping time is " << maximumTime <<
'\n');
282 INCL_DEBUG(
"impactParameter>CoulombDistortion::maxImpactParameter" <<
'\n');
289 impactParameter * std::sin(phi),
306 if(theAvatarList.empty()) {
307 INCL_DEBUG(
"No ParticleEntryAvatar found, transparent event" <<
'\n');
347 theNucleus = nucleus;
352 if(anAvatar) theNucleus->
getStore()->
add(anAvatar);
368 G4double minDistOfApproachSquared = 0.0;
370 if(t>maximumTime || t<currentTime+hadronizationTime)
return NULL;
377 theNucleus->
getStore()->getBook().getAcceptedCollisions()==0) ||
381 theNucleus->
getStore()->getBook().getAcceptedCollisions()==0) ||
386 if(p1HasLocalEnergy) {
387 backupParticle1 = *p1;
390 *p1 = backupParticle1;
395 if(p2HasLocalEnergy) {
396 backupParticle2 = *p2;
399 *p2 = backupParticle2;
400 if(p1HasLocalEnergy) {
401 *p1 = backupParticle1;
413 if(p1HasLocalEnergy) {
414 *p1 = backupParticle1;
416 if(p2HasLocalEnergy) {
417 *p2 = backupParticle2;
426 if(
Math::tenPi*minDistOfApproachSquared > totalCrossSection)
return NULL;
442 if(theIntersection.
exists) {
443 time = currentTime + theIntersection.
time;
445 INCL_ERROR(
"Imaginary reflection time for particle: " <<
'\n'
446 << aParticle->
print());
463 (*minDistOfApproach) = 100000.0;
464 return currentTime + 100000.0;
468 (*minDistOfApproach) = distance.
mag2() + time * t7;
469 return currentTime + time;
475 for(
ParticleIter updated=updatedParticles.begin(), e=updatedParticles.end(); updated!=e; ++updated)
478 for(
ParticleIter particle=particles.begin(), end=particles.end(); particle!=end; ++particle)
484 if(updatedParticles.
contains(*particle))
continue;
493 for(
ParticleIter p1=particles.begin(), e=particles.end(); p1!=e; ++p1) {
495 for(
ParticleIter p2 = p1 + 1; p2 != particles.end(); ++p2) {
503 const G4bool haveExcept = !except.empty();
506 for(
ParticleIter p1=particles.begin(), e=particles.end(); p1!=e; ++p1)
510 for(++p2; p2 != particles.end(); ++p2)
523 for(
ParticleIter iter=particles.begin(), e=particles.end(); iter!=e; ++iter) {
535 for(
ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
543#ifdef INCL_REGENERATE_AVATARS
544 void StandardPropagationModel::generateAllAvatarsExceptUpdated(
FinalState const *
const fs) {
547 for(
ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
553 except.insert(except.end(), entering.begin(), entering.end());
560 for(
ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
561 if((*i)->isDelta()) {
563 G4double time = currentTime + decayTime;
564 if(time <= maximumTime) {
570 G4double time = currentTime + decayTime;
571 if(time <= maximumTime) {
575 if((*i)->isOmega()) {
577 G4double timeOmega = currentTime + decayTimeOmega;
578 if(timeOmega <= maximumTime) {
590#ifdef INCL_REGENERATE_AVATARS
591#warning "The INCL_REGENERATE_AVATARS code has not been tested in a while. Use it at your peril."
596 theNucleus->
getStore()->initialiseParticleAvatarConnections();
597 generateAllAvatarsExceptUpdated(fs);
613 if(created.empty() && entering.empty())
617 updatedParticlesCopy.insert(updatedParticlesCopy.end(), entering.begin(), entering.end());
618 updatedParticlesCopy.insert(updatedParticlesCopy.end(), created.begin(), created.end());
626 if(theAvatar == 0)
return 0;
629 if(theAvatar->
getTime() < currentTime) {
630 INCL_ERROR(
"Avatar time = " << theAvatar->
getTime() <<
", currentTime = " << currentTime <<
'\n');
632 }
else if(theAvatar->
getTime() > currentTime) {
635 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
AnnihilationType getAnnihilationType() const
Getter for theAnnihilationType.
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.
G4bool isPhoton() const
Is this a photon?
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.
G4bool isAntiNucleon() const
Is this an antinucleon?
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.
ParticleList makeMesonStar()
IAvatarList bringMesonStar(ParticleList const &pL, Nucleus *const n)
G4bool ProtonIsTheVictim()
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.
G4double shootAtrest(ParticleType const t, const G4double kineticEnergy)
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.