Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4INCL::StandardPropagationModel Class Reference

#include <G4INCLStandardPropagationModel.hh>

Inheritance diagram for G4INCL::StandardPropagationModel:
G4INCL::IPropagationModel

Public Member Functions

 StandardPropagationModel (LocalEnergyType localEnergyType, LocalEnergyType localEnergyDeltaType)
 
virtual ~StandardPropagationModel ()
 
G4double getCurrentTime ()
 
void setNucleus (G4INCL::Nucleus *nucleus)
 
G4INCL::NucleusgetNucleus ()
 
G4double shoot (ParticleSpecies const projectileSpecies, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)
 
G4double shootParticle (ParticleType const t, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)
 
G4double shootComposite (ParticleSpecies const s, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)
 
void setStoppingTime (G4double)
 
G4double getStoppingTime ()
 
void registerAvatar (G4INCL::IAvatar *anAvatar)
 
IAvatargenerateBinaryCollisionAvatar (Particle *const p1, Particle *const p2)
 Generate a two-particle avatar. More...
 
G4double getReflectionTime (G4INCL::Particle const *const aParticle)
 Get the reflection time. More...
 
G4double getTime (G4INCL::Particle const *const particleA, G4INCL::Particle const *const particleB, G4double *minDistOfApproach) const
 
void generateUpdatedCollisions (const ParticleList &updatedParticles, const ParticleList &particles)
 Generate and register collisions between a list of updated particles and all the other particles. More...
 
void generateCollisions (const ParticleList &particles)
 Generate and register collisions among particles in a list, except between those in another list. More...
 
void generateCollisions (const ParticleList &particles, const ParticleList &except)
 Generate and register collisions among particles in a list, except between those in another list. More...
 
void generateDecays (const ParticleList &particles)
 Generate decays for particles that can decay. More...
 
void updateAvatars (const ParticleList &particles)
 
void generateAllAvatars ()
 (Re)Generate all possible avatars. More...
 
G4INCL::IAvatarpropagate ()
 
- Public Member Functions inherited from G4INCL::IPropagationModel
 IPropagationModel ()
 
virtual ~IPropagationModel ()
 

Additional Inherited Members

Detailed Description

Standard INCL4 particle propagation and avatar prediction

This class implements the standard INCL4 avatar prediction and particle propagation logic. The main idea is to predict all collisions between particles and their reflections from the potential wall. After this we select the avatar with the smallest time, propagate all particles to their positions at that time and return the avatar to the INCL kernel

See also
G4INCL::Kernel.

The particle trajectories in this propagation model are straight lines and all particles are assumed to move with constant velocity.

Definition at line 68 of file G4INCLStandardPropagationModel.hh.

Constructor & Destructor Documentation

G4INCL::StandardPropagationModel::StandardPropagationModel ( LocalEnergyType  localEnergyType,
LocalEnergyType  localEnergyDeltaType 
)

Definition at line 62 of file G4INCLStandardPropagationModel.cc.

63  :theNucleus(0), maximumTime(70.0), currentTime(0.0), firstAvatar(true),
64  theLocalEnergyType(localEnergyType),
65  theLocalEnergyDeltaType(localEnergyDeltaType)
66  {
67  }
G4INCL::StandardPropagationModel::~StandardPropagationModel ( )
virtual

Definition at line 69 of file G4INCLStandardPropagationModel.cc.

70  {
71  delete theNucleus;
72  }

Member Function Documentation

void G4INCL::StandardPropagationModel::generateAllAvatars ( )

(Re)Generate all possible avatars.

Definition at line 433 of file G4INCLStandardPropagationModel.cc.

References generateCollisions(), generateDecays(), G4INCL::Store::getParticles(), getReflectionTime(), G4INCL::Nucleus::getStore(), and registerAvatar().

Referenced by shootComposite(), and shootParticle().

433  {
434  ParticleList const &particles = theNucleus->getStore()->getParticles();
435 // assert(!particles.empty());
436  for(ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
437  G4double time = this->getReflectionTime(*i);
438  if(time <= maximumTime) registerAvatar(new SurfaceAvatar(*i, time, theNucleus));
439  }
440  generateCollisions(particles);
441  generateDecays(particles);
442  }
void registerAvatar(G4INCL::IAvatar *anAvatar)
ParticleList const & getParticles() const
Definition: G4INCLStore.hh:231
void generateCollisions(const ParticleList &particles)
Generate and register collisions among particles in a list, except between those in another list...
Store * getStore() const
G4double getReflectionTime(G4INCL::Particle const *const aParticle)
Get the reflection time.
UnorderedVector< Particle * > ParticleList
void generateDecays(const ParticleList &particles)
Generate decays for particles that can decay.
double G4double
Definition: G4Types.hh:76
ParticleList::const_iterator ParticleIter
IAvatar * G4INCL::StandardPropagationModel::generateBinaryCollisionAvatar ( Particle *const  p1,
Particle *const  p2 
)

Generate a two-particle avatar.

Generate a two-particle avatar, if all the appropriate conditions are met.

Definition at line 261 of file G4INCLStandardPropagationModel.cc.

References G4INCL::AlwaysLocalEnergy, G4INCL::FirstCollisionLocalEnergy, G4INCL::Book::getAcceptedCollisions(), G4INCL::Store::getBook(), G4INCL::BinaryCollisionAvatar::getCutNNSquared(), G4INCL::Particle::getParticipantType(), G4INCL::Particle::getPosition(), G4INCL::Nucleus::getStore(), G4INCL::Nucleus::getSurfaceRadius(), getTime(), G4INCL::Particle::isNucleon(), G4INCL::Particle::isParticipant(), G4INCL::Particle::isPion(), G4INCL::Particle::isResonance(), G4INCL::ThreeVector::mag(), G4INCL::Particle::propagate(), G4INCL::KinematicsUtils::squareTotalEnergyInCM(), G4INCL::Math::tenPi, G4INCL::CrossSections::total(), and G4INCL::KinematicsUtils::transformToLocalEnergyFrame().

Referenced by generateCollisions(), and generateUpdatedCollisions().

261  {
262  // Is either particle a participant?
263  if(!p1->isParticipant() && !p2->isParticipant() && p1->getParticipantType()==p2->getParticipantType()) return NULL;
264 
265  // Is it a pi-resonance collision (we don't treat them)?
266  if((p1->isResonance() && p2->isPion()) || (p1->isPion() && p2->isResonance()))
267  return NULL;
268 
269  // Will the avatar take place between now and the end of the cascade?
270  G4double minDistOfApproachSquared = 0.0;
271  G4double t = getTime(p1, p2, &minDistOfApproachSquared);
272  if(t>maximumTime || t<currentTime) return NULL;
273 
274  // Local energy. Jump through some hoops to calculate the cross section
275  // at the collision point, and clean up after yourself afterwards.
276  G4bool hasLocalEnergy;
277  if(p1->isPion() || p2->isPion())
278  hasLocalEnergy = ((theLocalEnergyDeltaType == FirstCollisionLocalEnergy &&
279  theNucleus->getStore()->getBook().getAcceptedCollisions()==0) ||
280  theLocalEnergyDeltaType == AlwaysLocalEnergy);
281  else
282  hasLocalEnergy = ((theLocalEnergyType == FirstCollisionLocalEnergy &&
283  theNucleus->getStore()->getBook().getAcceptedCollisions()==0) ||
284  theLocalEnergyType == AlwaysLocalEnergy);
285  const G4bool p1HasLocalEnergy = (hasLocalEnergy && !p1->isPion());
286  const G4bool p2HasLocalEnergy = (hasLocalEnergy && !p2->isPion());
287 
288  if(p1HasLocalEnergy) {
289  backupParticle1 = *p1;
290  p1->propagate(t - currentTime);
291  if(p1->getPosition().mag() > theNucleus->getSurfaceRadius(p1)) {
292  *p1 = backupParticle1;
293  return NULL;
294  }
296  }
297  if(p2HasLocalEnergy) {
298  backupParticle2 = *p2;
299  p2->propagate(t - currentTime);
300  if(p2->getPosition().mag() > theNucleus->getSurfaceRadius(p2)) {
301  *p2 = backupParticle2;
302  if(p1HasLocalEnergy) {
303  *p1 = backupParticle1;
304  }
305  return NULL;
306  }
308  }
309 
310  // Compute the total cross section
311  const G4double totalCrossSection = CrossSections::total(p1, p2);
313 
314  // Restore particles to their state before the local-energy tweak
315  if(p1HasLocalEnergy) {
316  *p1 = backupParticle1;
317  }
318  if(p2HasLocalEnergy) {
319  *p2 = backupParticle2;
320  }
321 
322  // Is the CM energy > cutNN? (no cutNN on the first collision)
323  if(theNucleus->getStore()->getBook().getAcceptedCollisions()>0
324  && p1->isNucleon() && p2->isNucleon()
325  && squareTotalEnergyInCM < BinaryCollisionAvatar::getCutNNSquared()) return NULL;
326 
327  // Do the particles come close enough to each other?
328  if(Math::tenPi*minDistOfApproachSquared > totalCrossSection) return NULL;
329 
330  // Bomb out if the two collision partners are the same particle
331 // assert(p1->getID() != p2->getID());
332 
333  // Return a new avatar, then!
334  return new G4INCL::BinaryCollisionAvatar(t, totalCrossSection, theNucleus, p1, p2);
335  }
void transformToLocalEnergyFrame(Nucleus const *const n, Particle *const p)
G4int getAcceptedCollisions() const
Definition: G4INCLBook.hh:99
G4double squareTotalEnergyInCM(Particle const *const p1, Particle const *const p2)
const G4double tenPi
Store * getStore() const
void propagate(G4double step)
G4double getSurfaceRadius(Particle const *const particle) const
Get the maximum allowed radius for a given particle.
G4double getTime(G4INCL::Particle const *const particleA, G4INCL::Particle const *const particleB, G4double *minDistOfApproach) const
Book & getBook()
Definition: G4INCLStore.hh:237
bool G4bool
Definition: G4Types.hh:79
G4double total(Particle const *const p1, Particle const *const p2)
double G4double
Definition: G4Types.hh:76
void G4INCL::StandardPropagationModel::generateCollisions ( const ParticleList particles)

Generate and register collisions among particles in a list, except between those in another list.

This method generates all possible collisions among the particles. Each collision is generated only once.

Parameters
particleslist of particles

Definition at line 393 of file G4INCLStandardPropagationModel.cc.

References generateBinaryCollisionAvatar(), and registerAvatar().

Referenced by generateAllAvatars().

393  {
394  // Loop over all the particles
395  for(ParticleIter p1=particles.begin(), e=particles.end(); p1!=e; ++p1) {
396  // Loop over the rest of the particles
397  for(ParticleIter p2 = p1 + 1; p2 != particles.end(); ++p2) {
399  }
400  }
401  }
void registerAvatar(G4INCL::IAvatar *anAvatar)
IAvatar * generateBinaryCollisionAvatar(Particle *const p1, Particle *const p2)
Generate a two-particle avatar.
ParticleList::const_iterator ParticleIter
void G4INCL::StandardPropagationModel::generateCollisions ( const ParticleList particles,
const ParticleList except 
)

Generate and register collisions among particles in a list, except between those in another list.

This method generates all possible collisions among the particles. Each collision is generated only once. The collision is NOT generated if BOTH collision partners belong to the except list.

You should pass an empty list as the except parameter if you want to generate all possible collisions among particles.

Parameters
particleslist of particles
exceptlist of excluded particles

Definition at line 403 of file G4INCLStandardPropagationModel.cc.

References generateBinaryCollisionAvatar(), and registerAvatar().

403  {
404 
405  const G4bool haveExcept = !except.empty();
406 
407  // Loop over all the particles
408  for(ParticleIter p1=particles.begin(), e=particles.end(); p1!=e; ++p1)
409  {
410  // Loop over the rest of the particles
411  ParticleIter p2 = p1;
412  for(++p2; p2 != particles.end(); ++p2)
413  {
414  // Skip the collision if both particles must be excluded
415  if(haveExcept && (*p1)->isInList(except) && (*p2)->isInList(except)) continue;
416 
418  }
419  }
420 
421  }
void registerAvatar(G4INCL::IAvatar *anAvatar)
bool G4bool
Definition: G4Types.hh:79
IAvatar * generateBinaryCollisionAvatar(Particle *const p1, Particle *const p2)
Generate a two-particle avatar.
ParticleList::const_iterator ParticleIter
void G4INCL::StandardPropagationModel::generateDecays ( const ParticleList particles)

Generate decays for particles that can decay.

The list of particles given as an argument is allowed to contain also stable particles.

Parameters
particleslist of particles to (possibly) generate decays for

Definition at line 458 of file G4INCLStandardPropagationModel.cc.

References G4INCL::DeltaDecayChannel::computeDecayTime(), and registerAvatar().

Referenced by generateAllAvatars(), and propagate().

458  {
459  for(ParticleIter i=particles.begin(), e=particles.end(); i!=e; ++i) {
460  if((*i)->isDelta()) {
462  G4double time = currentTime + decayTime;
463  if(time <= maximumTime) {
464  registerAvatar(new DecayAvatar((*i), time, theNucleus));
465  }
466  }
467  }
468  }
void registerAvatar(G4INCL::IAvatar *anAvatar)
static G4double computeDecayTime(Particle *p)
double G4double
Definition: G4Types.hh:76
ParticleList::const_iterator ParticleIter
void G4INCL::StandardPropagationModel::generateUpdatedCollisions ( const ParticleList updatedParticles,
const ParticleList particles 
)

Generate and register collisions between a list of updated particles and all the other particles.

This method does not generate collisions among the particles in updatedParticles; in other words, it generates a collision between one of the updatedParticles and one of the particles ONLY IF the latter does not belong to updatedParticles.

If you intend to generate all possible collisions among particles in a list, use generateCollisions().

Parameters
updatedParticleslist of updated particles
particleslist of particles

Definition at line 374 of file G4INCLStandardPropagationModel.cc.

References generateBinaryCollisionAvatar(), and registerAvatar().

Referenced by updateAvatars().

374  {
375 
376  // Loop over all the updated particles
377  for(ParticleIter updated=updatedParticles.begin(), e=updatedParticles.end(); updated!=e; ++updated)
378  {
379  // Loop over all the particles
380  for(ParticleIter particle=particles.begin(), end=particles.end(); particle!=end; ++particle)
381  {
382  /* Consider the generation of a collision avatar only if (*particle)
383  * is not one of the updated particles.
384  * The criterion makes sure that you don't generate avatars between
385  * updated particles. */
386  if((*particle)->isInList(updatedParticles)) continue;
387 
388  registerAvatar(generateBinaryCollisionAvatar(*particle,*updated));
389  }
390  }
391  }
void registerAvatar(G4INCL::IAvatar *anAvatar)
IAvatar * generateBinaryCollisionAvatar(Particle *const p1, Particle *const p2)
Generate a two-particle avatar.
ParticleList::const_iterator ParticleIter
G4double G4INCL::StandardPropagationModel::getCurrentTime ( )
virtual

Returns the current global time of the system.

Implements G4INCL::IPropagationModel.

Definition at line 247 of file G4INCLStandardPropagationModel.cc.

247  {
248  return currentTime;
249  }
G4INCL::Nucleus * G4INCL::StandardPropagationModel::getNucleus ( )
virtual

Get the nucleus.

Implements G4INCL::IPropagationModel.

Definition at line 74 of file G4INCLStandardPropagationModel.cc.

75  {
76  return theNucleus;
77  }
G4double G4INCL::StandardPropagationModel::getReflectionTime ( G4INCL::Particle const *const  aParticle)

Get the reflection time.

Returns the reflection time of a particle on the potential wall.

Parameters
aParticlepointer to the particle

Definition at line 337 of file G4INCLStandardPropagationModel.cc.

References G4INCL::Intersection::exists, G4INCL::IntersectionFactory::getLaterTrajectoryIntersection(), G4INCL::Particle::getPosition(), G4INCL::Particle::getPropagationVelocity(), G4INCL::Nucleus::getSurfaceRadius(), INCL_ERROR, G4INCL::Particle::print(), and G4INCL::Intersection::time.

Referenced by generateAllAvatars(), and updateAvatars().

337  {
338  Intersection theIntersection(
340  aParticle->getPosition(),
341  aParticle->getPropagationVelocity(),
342  theNucleus->getSurfaceRadius(aParticle)));
343  G4double time;
344  if(theIntersection.exists) {
345  time = currentTime + theIntersection.time;
346  } else {
347  INCL_ERROR("Imaginary reflection time for particle: " << std::endl
348  << aParticle->print());
349  time = 10000.0;
350  }
351  return time;
352  }
#define INCL_ERROR(x)
G4double getSurfaceRadius(Particle const *const particle) const
Get the maximum allowed radius for a given particle.
Intersection getLaterTrajectoryIntersection(const ThreeVector &x0, const ThreeVector &p, const G4double r)
Compute the second intersection of a straight particle trajectory with a sphere.
double G4double
Definition: G4Types.hh:76
G4double G4INCL::StandardPropagationModel::getStoppingTime ( )
virtual

Get the current stopping time.

Implements G4INCL::IPropagationModel.

Definition at line 238 of file G4INCLStandardPropagationModel.cc.

238  {
239  return maximumTime;
240  }
G4double G4INCL::StandardPropagationModel::getTime ( G4INCL::Particle const *const  particleA,
G4INCL::Particle const *const  particleB,
G4double minDistOfApproach 
) const

Get the predicted time of the collision between two particles.

Definition at line 354 of file G4INCLStandardPropagationModel.cc.

References G4INCL::ThreeVector::dot(), G4INCL::Particle::getPosition(), G4INCL::Particle::getPropagationVelocity(), and G4INCL::ThreeVector::mag2().

Referenced by generateBinaryCollisionAvatar().

356  {
357  G4double time;
358  G4INCL::ThreeVector t13 = particleA->getPropagationVelocity();
359  t13 -= particleB->getPropagationVelocity();
360  G4INCL::ThreeVector distance = particleA->getPosition();
361  distance -= particleB->getPosition();
362  const G4double t7 = t13.dot(distance);
363  const G4double dt = t13.mag2();
364  if(dt <= 1.0e-10) {
365  (*minDistOfApproach) = 100000.0;
366  return currentTime + 100000.0;
367  } else {
368  time = -t7/dt;
369  }
370  (*minDistOfApproach) = distance.mag2() + time * t7;
371  return currentTime + time;
372  }
G4double dot(const ThreeVector &v) const
G4double mag2() const
double G4double
Definition: G4Types.hh:76
G4INCL::IAvatar * G4INCL::StandardPropagationModel::propagate ( )
virtual

Propagate all particles and return the first avatar.

Implements G4INCL::IPropagationModel.

Definition at line 470 of file G4INCLStandardPropagationModel.cc.

References G4INCL::Store::clearAvatars(), G4INCL::Store::findSmallestTime(), generateDecays(), G4INCL::Nucleus::getBlockedDelta(), G4INCL::Store::getBook(), G4INCL::Nucleus::getCreatedParticles(), G4INCL::Nucleus::getStore(), G4INCL::IAvatar::getTime(), G4INCL::Nucleus::getUpdatedParticles(), INCL_ERROR, G4INCL::Store::initialiseParticleAvatarConnections(), G4INCL::Book::setCurrentTime(), G4INCL::Store::timeStep(), and updateAvatars().

471  {
472  // We update only the information related to particles that were updated
473  // by the previous avatar.
474 #ifdef INCL_REGENERATE_AVATARS
475 #warning "The INCL_REGENERATE_AVATARS code has not been tested in a while. Use it at your peril."
476  if(theNucleus->getUpdatedParticles().size()!=0 || theNucleus->getCreatedParticles().size()!=0) {
477  // Regenerates the entire avatar list, skipping collisions between
478  // updated particles
479  theNucleus->getStore()->clearAvatars();
481  generateAllAvatarsExceptUpdated();
482  }
483 #else
484  // Deltas are created by transforming nucleon into a delta for
485  // efficiency reasons
486  Particle * const blockedDelta = theNucleus->getBlockedDelta();
487  ParticleList updatedParticles = theNucleus->getUpdatedParticles();
488  if(blockedDelta)
489  updatedParticles.push_back(blockedDelta);
490  generateDecays(updatedParticles);
491 
492  ParticleList needNewAvatars = theNucleus->getUpdatedParticles();
493  ParticleList const &created = theNucleus->getCreatedParticles();
494  needNewAvatars.insert(needNewAvatars.end(), created.begin(), created.end());
495  updateAvatars(needNewAvatars);
496 #endif
497 
498  G4INCL::IAvatar *theAvatar = theNucleus->getStore()->findSmallestTime();
499  if(theAvatar == 0) return 0; // Avatar list is empty
500  // theAvatar->dispose();
501 
502  if(theAvatar->getTime() < currentTime) {
503  INCL_ERROR("Avatar time = " << theAvatar->getTime() << ", currentTime = " << currentTime << std::endl);
504  return 0;
505  } else if(theAvatar->getTime() > currentTime) {
506  theNucleus->getStore()->timeStep(theAvatar->getTime() - currentTime);
507 
508  currentTime = theAvatar->getTime();
509  theNucleus->getStore()->getBook().setCurrentTime(currentTime);
510  }
511 
512  return theAvatar;
513  }
void clearAvatars()
Definition: G4INCLStore.cc:252
#define INCL_ERROR(x)
IAvatar * findSmallestTime()
Definition: G4INCLStore.cc:173
Store * getStore() const
void updateAvatars(const ParticleList &particles)
G4double getTime() const
UnorderedVector< Particle * > ParticleList
Book & getBook()
Definition: G4INCLStore.hh:237
void initialiseParticleAvatarConnections()
Initialise the particleAvatarConnections map.
Definition: G4INCLStore.cc:267
ParticleList const & getUpdatedParticles() const
ParticleList const & getCreatedParticles() const
void generateDecays(const ParticleList &particles)
Generate decays for particles that can decay.
void setCurrentTime(G4double t)
Definition: G4INCLBook.hh:96
Particle * getBlockedDelta() const
Get the delta that could not decay.
void timeStep(G4double step)
Definition: G4INCLStore.cc:224
void G4INCL::StandardPropagationModel::registerAvatar ( G4INCL::IAvatar anAvatar)

Add an avatar to the storage.

Definition at line 256 of file G4INCLStandardPropagationModel.cc.

References G4INCL::Store::add(), and G4INCL::Nucleus::getStore().

Referenced by generateAllAvatars(), generateCollisions(), generateDecays(), generateUpdatedCollisions(), and updateAvatars().

257  {
258  if(anAvatar) theNucleus->getStore()->add(anAvatar);
259  }
Store * getStore() const
void add(Particle *p)
Definition: G4INCLStore.cc:57
void G4INCL::StandardPropagationModel::setNucleus ( G4INCL::Nucleus nucleus)
virtual

Set the nucleus for this propagation model.

Implements G4INCL::IPropagationModel.

Definition at line 251 of file G4INCLStandardPropagationModel.cc.

252  {
253  theNucleus = nucleus;
254  }
void G4INCL::StandardPropagationModel::setStoppingTime ( G4double  time)
virtual

Set the stopping time of the simulation.

Implements G4INCL::IPropagationModel.

Definition at line 242 of file G4INCLStandardPropagationModel.cc.

242  {
243 // assert(time>0.0);
244  maximumTime = time;
245  }
G4double G4INCL::StandardPropagationModel::shoot ( ParticleSpecies const  projectileSpecies,
const G4double  kineticEnergy,
const G4double  impactParameter,
const G4double  phi 
)
virtual

Implements G4INCL::IPropagationModel.

Definition at line 79 of file G4INCLStandardPropagationModel.cc.

References G4INCL::Composite, shootComposite(), shootParticle(), and G4INCL::ParticleSpecies::theType.

79  {
80  if(projectileSpecies.theType==Composite)
81  return shootComposite(projectileSpecies, kineticEnergy, impactParameter, phi);
82  else
83  return shootParticle(projectileSpecies.theType, kineticEnergy, impactParameter, phi);
84  }
G4double shootComposite(ParticleSpecies const s, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)
G4double shootParticle(ParticleType const t, const G4double kineticEnergy, const G4double impactParameter, const G4double phi)
G4double G4INCL::StandardPropagationModel::shootComposite ( ParticleSpecies const  s,
const G4double  kineticEnergy,
const G4double  impactParameter,
const G4double  phi 
)
virtual

Implements G4INCL::IPropagationModel.

Definition at line 160 of file G4INCLStandardPropagationModel.cc.

References G4INCL::Store::addParticleEntryAvatars(), G4INCL::Particle::boostVector(), G4INCL::CoulombDistortion::bringToSurface(), generateAllAvatars(), G4INCL::Particle::getA(), G4INCL::Cluster::getAngularMomentum(), G4INCL::Particle::getEnergy(), G4INCL::ParticleTable::getLargestNuclearRadius(), G4INCL::Particle::getMomentum(), G4INCL::Nucleus::getStore(), G4INCL::ParticleTable::getTableMass, G4INCL::Particle::getTransversePosition(), G4INCL::Nucleus::getUniverseRadius(), G4INCL::Particle::getZ(), INCL_DEBUG, G4INCL::ThreeVector::mag(), G4INCL::CoulombDistortion::maxImpactParameter(), position, gammaraytel::pr, G4INCL::Nucleus::setIncomingAngularMomentum(), G4INCL::Nucleus::setIncomingMomentum(), G4INCL::Nucleus::setInitialEnergy(), G4INCL::Nucleus::setNucleusNucleusCollision(), G4INCL::Cluster::setPosition(), G4INCL::Nucleus::setProjectileChargeNumber(), G4INCL::Nucleus::setProjectileMassNumber(), G4INCL::Nucleus::setProjectileRemnant(), and G4INCL::ProjectileRemnant::storeComponents().

Referenced by shoot().

160  {
161  theNucleus->setNucleusNucleusCollision();
162  currentTime = 0.0;
163 
164  // Create the ProjectileRemnant object
165  ProjectileRemnant *pr = new ProjectileRemnant(species, kineticEnergy);
166 
167  // Same stopping time as for nucleon-nucleus
168  maximumTime = 29.8 * std::pow(theNucleus->getA(), 0.16);
169 
170  // If the incoming cluster is slow, use a larger stopping time
171  const G4double rms = ParticleTable::getLargestNuclearRadius(pr->getA(), pr->getZ());
172  const G4double rMax = theNucleus->getUniverseRadius();
173  const G4double distance = 2.*rMax + 2.725*rms;
174  const G4double projectileVelocity = pr->boostVector().mag();
175  const G4double traversalTime = distance / projectileVelocity;
176  if(maximumTime < traversalTime)
177  maximumTime = traversalTime;
178  INCL_DEBUG("Cascade stopping time is " << maximumTime << std::endl);
179 
180  // If Coulomb is activated, do not process events with impact
181  // parameter larger than the maximum impact parameter, taking into
182  // account Coulomb distortion.
183  if(impactParameter>CoulombDistortion::maxImpactParameter(pr,theNucleus)) {
184  INCL_DEBUG("impactParameter>CoulombDistortion::maxImpactParameter" << std::endl);
185  delete pr;
186  return -1.;
187  }
188 
189  // Position the cluster at the right impact parameter
190  ThreeVector position(impactParameter * std::cos(phi),
191  impactParameter * std::sin(phi),
192  0.);
193  pr->setPosition(position);
194 
195  // Fill in the relevant kinematic variables
196  theNucleus->setIncomingAngularMomentum(pr->getAngularMomentum());
197  theNucleus->setIncomingMomentum(pr->getMomentum());
198  theNucleus->setInitialEnergy(pr->getEnergy()
199  + ParticleTable::getTableMass(theNucleus->getA(),theNucleus->getZ()));
200 
202  firstAvatar = false;
203 
204  // Get the entry avatars from Coulomb
205  IAvatarList theAvatarList
206  = CoulombDistortion::bringToSurface(pr, theNucleus);
207 
208  if(theAvatarList.empty()) {
209  INCL_DEBUG("No ParticleEntryAvatar found, transparent event" << std::endl);
210  delete pr;
211  return -1.;
212  }
213 
214  /* Store the internal kinematics of the projectile remnant.
215  *
216  * Note that this is at variance with the Fortran version, which stores
217  * the initial kinematics of the particles *after* putting the spectators
218  * on mass shell, but *before* removing the same energy from the
219  * participants. Due to the different code flow, doing so in the C++
220  * version leads to wrong excitation energies for the forced compound
221  * nucleus.
222  */
223  pr->storeComponents();
224 
225  // Tell the Nucleus about the ProjectileRemnant
226  theNucleus->setProjectileRemnant(pr);
227 
228  // Set the number of projectile particles
229  theNucleus->setProjectileChargeNumber(pr->getZ());
230  theNucleus->setProjectileMassNumber(pr->getA());
231 
232  // Register the ParticleEntryAvatars
233  theNucleus->getStore()->addParticleEntryAvatars(theAvatarList);
234 
235  return pr->getTransversePosition().mag();
236  }
G4int getA() const
Returns the baryon number.
void generateAllAvatars()
(Re)Generate all possible avatars.
void setIncomingAngularMomentum(const ThreeVector &j)
Set the incoming angular-momentum vector.
void setIncomingMomentum(const ThreeVector &p)
Set the incoming momentum vector.
void setInitialEnergy(const G4double e)
Set the initial energy.
Store * getStore() const
static ParticleEntryAvatar * bringToSurface(Particle *p, Nucleus *const n)
Modify the momentum of an incoming particle and position it on the surface of the nucleus...
void addParticleEntryAvatars(IAvatarList const &al)
Add one ParticleEntry avatar.
Definition: G4INCLStore.cc:78
static G4double maxImpactParameter(ParticleSpecies const &p, const G4double kinE, Nucleus const *const n)
Return the maximum impact parameter for Coulomb-distorted trajectories.
G4double getLargestNuclearRadius(const G4int A, const G4int Z)
G4int getZ() const
Returns the charge number.
UnorderedVector< IAvatar * > IAvatarList
void setProjectileChargeNumber(G4int n)
Set the charge number of the projectile.
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
void setProjectileRemnant(ProjectileRemnant *const c)
Set the projectile remnant.
int position
Definition: filter.cc:7
void setProjectileMassNumber(G4int n)
Set the mass number of the projectile.
G4double getUniverseRadius() const
Getter for theUniverseRadius.
double G4double
Definition: G4Types.hh:76
#define INCL_DEBUG(x)
void setNucleusNucleusCollision()
Set a nucleus-nucleus collision.
G4double G4INCL::StandardPropagationModel::shootParticle ( ParticleType const  t,
const G4double  kineticEnergy,
const G4double  impactParameter,
const G4double  phi 
)
virtual

Implements G4INCL::IPropagationModel.

Definition at line 86 of file G4INCLStandardPropagationModel.cc.

References G4INCL::Store::addParticleEntryAvatar(), G4INCL::Particle::adjustMomentumFromEnergy(), G4INCL::Particle::boostVector(), G4INCL::CoulombDistortion::bringToSurface(), energy(), generateAllAvatars(), G4INCL::Particle::getA(), G4INCL::Particle::getAngularMomentum(), G4INCL::Particle::getEnergy(), G4INCL::Particle::getMass(), G4INCL::Particle::getMomentum(), G4INCL::Particle::getSpecies(), G4INCL::Nucleus::getStore(), G4INCL::ParticleTable::getTableMass, G4INCL::ParticleTable::getTableParticleMass, G4INCL::Particle::getTransversePosition(), G4INCL::Nucleus::getUniverseRadius(), G4INCL::Particle::getZ(), INCL_DEBUG, G4INCL::Particle::isNucleon(), G4INCL::ThreeVector::mag(), G4INCL::Particle::makeProjectileSpectator(), G4INCL::CoulombDistortion::maxImpactParameter(), position, G4INCL::Particle::setEnergy(), G4INCL::Particle::setINCLMass(), G4INCL::Nucleus::setIncomingAngularMomentum(), G4INCL::Nucleus::setIncomingMomentum(), G4INCL::Nucleus::setInitialEnergy(), G4INCL::Nucleus::setParticleNucleusCollision(), G4INCL::Particle::setPosition(), G4INCL::Nucleus::setProjectileChargeNumber(), and G4INCL::Nucleus::setProjectileMassNumber().

Referenced by shoot().

86  {
87  theNucleus->setParticleNucleusCollision();
88  currentTime = 0.0;
89 
90  // Create the projectile particle
91  const G4double projectileMass = ParticleTable::getTableParticleMass(type);
92  G4double energy = kineticEnergy + projectileMass;
93  G4double momentumZ = std::sqrt(energy*energy - projectileMass*projectileMass);
94  ThreeVector momentum(0.0, 0.0, momentumZ);
95  Particle *p= new G4INCL::Particle(type, energy, momentum, ThreeVector());
96 
97  G4double temfin = 0.0;
98  if( p->isNucleon() )
99  temfin = 29.8 * std::pow(theNucleus->getA(), 0.16);
100  else {
101  const G4double tlab = p->getEnergy() - p->getMass();
102  temfin = 30.18 * std::pow(theNucleus->getA(), 0.17*(1.0 - 5.7E-5*tlab));
103  }
104 
105  maximumTime = temfin;
106 
107  // If the incoming particle is slow, use a larger stopping time
108  const G4double rMax = theNucleus->getUniverseRadius();
109  const G4double distance = 2.*rMax;
110  const G4double projectileVelocity = p->boostVector().mag();
111  const G4double traversalTime = distance / projectileVelocity;
112  if(maximumTime < traversalTime)
113  maximumTime = traversalTime;
114  INCL_DEBUG("Cascade stopping time is " << maximumTime << std::endl);
115 
116  // If Coulomb is activated, do not process events with impact
117  // parameter larger than the maximum impact parameter, taking into
118  // account Coulomb distortion.
119  if(impactParameter>CoulombDistortion::maxImpactParameter(p->getSpecies(), kineticEnergy, theNucleus)) {
120  INCL_DEBUG("impactParameter>CoulombDistortion::maxImpactParameter" << std::endl);
121  delete p;
122  return -1.;
123  }
124 
125  ThreeVector position(impactParameter * std::cos(phi),
126  impactParameter * std::sin(phi),
127  0.);
128  p->setPosition(position);
129 
130  // Fill in the relevant kinematic variables
131  theNucleus->setIncomingAngularMomentum(p->getAngularMomentum());
132  theNucleus->setIncomingMomentum(p->getMomentum());
133  theNucleus->setInitialEnergy(p->getEnergy()
134  + ParticleTable::getTableMass(theNucleus->getA(),theNucleus->getZ()));
135 
136  // Reset the particle kinematics to the INCL values
137  p->setINCLMass();
138  p->setEnergy(p->getMass() + kineticEnergy);
139  p->adjustMomentumFromEnergy();
140 
141  p->makeProjectileSpectator();
143  firstAvatar = false;
144 
145  // Get the entry avatars from Coulomb and put them in the Store
146  ParticleEntryAvatar *theEntryAvatar = CoulombDistortion::bringToSurface(p, theNucleus);
147  if(theEntryAvatar) {
148  theNucleus->getStore()->addParticleEntryAvatar(theEntryAvatar);
149 
150  theNucleus->setProjectileChargeNumber(p->getZ());
151  theNucleus->setProjectileMassNumber(p->getA());
152 
153  return p->getTransversePosition().mag();
154  } else {
155  delete p;
156  return -1.;
157  }
158  }
G4int getA() const
Returns the baryon number.
void generateAllAvatars()
(Re)Generate all possible avatars.
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.
void setInitialEnergy(const G4double e)
Set the initial energy.
const char * p
Definition: xmltok.h:285
Store * getStore() const
void setParticleNucleusCollision()
Set a particle-nucleus collision.
static ParticleEntryAvatar * bringToSurface(Particle *p, Nucleus *const n)
Modify the momentum of an incoming particle and position it on the surface of the nucleus...
double precision function energy(A, Z)
Definition: dpm25nuc6.f:4106
static G4double maxImpactParameter(ParticleSpecies const &p, const G4double kinE, Nucleus const *const n)
Return the maximum impact parameter for Coulomb-distorted trajectories.
G4int getZ() const
Returns the charge number.
void addParticleEntryAvatar(IAvatar *a)
Add one ParticleEntry avatar.
Definition: G4INCLStore.cc:66
void setProjectileChargeNumber(G4int n)
Set the charge number of the projectile.
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
int position
Definition: filter.cc:7
void setProjectileMassNumber(G4int n)
Set the mass number of the projectile.
G4double getUniverseRadius() const
Getter for theUniverseRadius.
double G4double
Definition: G4Types.hh:76
#define INCL_DEBUG(x)
void G4INCL::StandardPropagationModel::updateAvatars ( const ParticleList particles)

Update all avatars related to a particle.

Definition at line 423 of file G4INCLStandardPropagationModel.cc.

References generateUpdatedCollisions(), G4INCL::Store::getParticles(), getReflectionTime(), G4INCL::Nucleus::getStore(), and registerAvatar().

Referenced by propagate().

423  {
424 
425  for(ParticleIter iter=particles.begin(), e=particles.end(); iter!=e; ++iter) {
426  G4double time = this->getReflectionTime(*iter);
427  if(time <= maximumTime) registerAvatar(new SurfaceAvatar(*iter, time, theNucleus));
428  }
429  ParticleList const &p = theNucleus->getStore()->getParticles();
430  generateUpdatedCollisions(particles, p); // Predict collisions with spectators and participants
431  }
void registerAvatar(G4INCL::IAvatar *anAvatar)
ParticleList const & getParticles() const
Definition: G4INCLStore.hh:231
const char * p
Definition: xmltok.h:285
Store * getStore() const
G4double getReflectionTime(G4INCL::Particle const *const aParticle)
Get the reflection time.
UnorderedVector< Particle * > ParticleList
double G4double
Definition: G4Types.hh:76
void generateUpdatedCollisions(const ParticleList &updatedParticles, const ParticleList &particles)
Generate and register collisions between a list of updated particles and all the other particles...
ParticleList::const_iterator ParticleIter

The documentation for this class was generated from the following files: