#include <G4INCLStandardPropagationModel.hh>
Inheritance diagram for G4INCL::StandardPropagationModel:
Public Member Functions | |
StandardPropagationModel (LocalEnergyType localEnergyType, LocalEnergyType localEnergyDeltaType) | |
virtual | ~StandardPropagationModel () |
G4double | getCurrentTime () |
void | setNucleus (G4INCL::Nucleus *nucleus) |
G4INCL::Nucleus * | getNucleus () |
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) |
IAvatar * | generateBinaryCollisionAvatar (Particle *const p1, Particle *const p2) const |
Generate a two-particle avatar. | |
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 | 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. | |
void | generateDecays (const ParticleList &particles) |
Generate decays for particles that can decay. | |
void | updateAvatars (const ParticleList &particles) |
void | generateAllAvatars (G4bool excludeUpdated=false) |
(Re)Generate all possible avatars. | |
G4INCL::IAvatar * | propagate () |
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
Definition at line 68 of file G4INCLStandardPropagationModel.hh.
G4INCL::StandardPropagationModel::StandardPropagationModel | ( | LocalEnergyType | localEnergyType, | |
LocalEnergyType | localEnergyDeltaType | |||
) |
Definition at line 62 of file G4INCLStandardPropagationModel.cc.
00063 :theNucleus(0), maximumTime(70.0), currentTime(0.0), firstAvatar(true), 00064 theLocalEnergyType(localEnergyType), 00065 theLocalEnergyDeltaType(localEnergyDeltaType) 00066 { 00067 }
G4INCL::StandardPropagationModel::~StandardPropagationModel | ( | ) | [virtual] |
void G4INCL::StandardPropagationModel::generateAllAvatars | ( | G4bool | excludeUpdated = false |
) |
(Re)Generate all possible avatars.
excludeUpdated | exclude collisions between updated particles. |
Definition at line 426 of file G4INCLStandardPropagationModel.cc.
References ERROR, generateCollisions(), generateDecays(), G4INCL::Store::getParticles(), G4INCL::Nucleus::getStore(), G4INCL::Nucleus::getUpdatedParticles(), and registerAvatar().
Referenced by propagate(), shootComposite(), and shootParticle().
00426 { 00427 ParticleList particles = theNucleus->getStore()->getParticles(); 00428 if(particles.empty()) { ERROR("No particles inside the nucleus!" << std::endl); } 00429 for(ParticleIter i = particles.begin(); i != particles.end(); ++i) { 00430 G4double time = this->getReflectionTime(*i); 00431 if(time <= maximumTime) registerAvatar(new SurfaceAvatar(*i, time, theNucleus)); 00432 } 00433 ParticleList except; 00434 if(excludeUpdated) 00435 except = theNucleus->getUpdatedParticles(); 00436 generateCollisions(particles,except); 00437 generateDecays(particles); 00438 }
IAvatar * G4INCL::StandardPropagationModel::generateBinaryCollisionAvatar | ( | Particle *const | p1, | |
Particle *const | p2 | |||
) | const |
Generate a two-particle avatar.
Generate a two-particle avatar, if all the appropriate conditions are met.
Definition at line 263 of file G4INCLStandardPropagationModel.cc.
References G4INCL::AlwaysLocalEnergy, G4INCL::BinaryCollisionAvatar::cutNNSquared, G4INCL::FirstCollisionLocalEnergy, G4INCL::Book::getAcceptedCollisions(), G4INCL::Store::getBook(), 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().
00263 { 00264 // Is either particle a participant? 00265 if(!p1->isParticipant() && !p2->isParticipant() && p1->getParticipantType()==p2->getParticipantType()) return NULL; 00266 00267 // Is it a pi-resonance collision (we don't treat them)? 00268 if((p1->isResonance() && p2->isPion()) || (p1->isPion() && p2->isResonance())) 00269 return NULL; 00270 00271 // Will the avatar take place between now and the end of the cascade? 00272 G4double minDistOfApproachSquared = 0.0; 00273 G4double t = getTime(p1, p2, &minDistOfApproachSquared); 00274 if(t>maximumTime || t<currentTime) return NULL; 00275 00276 // Local energy. Jump through some hoops to calculate the cross section 00277 // at the collision point, and clean up after yourself afterwards. 00278 G4bool hasLocalEnergy; 00279 if(p1->isPion() || p2->isPion()) 00280 hasLocalEnergy = ((theLocalEnergyDeltaType == FirstCollisionLocalEnergy && 00281 theNucleus->getStore()->getBook()->getAcceptedCollisions()==0) || 00282 theLocalEnergyDeltaType == AlwaysLocalEnergy); 00283 else 00284 hasLocalEnergy = ((theLocalEnergyType == FirstCollisionLocalEnergy && 00285 theNucleus->getStore()->getBook()->getAcceptedCollisions()==0) || 00286 theLocalEnergyType == AlwaysLocalEnergy); 00287 const G4bool p1HasLocalEnergy = (hasLocalEnergy && !p1->isPion()); 00288 const G4bool p2HasLocalEnergy = (hasLocalEnergy && !p2->isPion()); 00289 00290 Particle backupParticle1 = *p1; 00291 if(p1HasLocalEnergy) { 00292 p1->propagate(t - currentTime); 00293 if(p1->getPosition().mag() > theNucleus->getSurfaceRadius(p1)) { 00294 *p1 = backupParticle1; 00295 return NULL; 00296 } 00297 KinematicsUtils::transformToLocalEnergyFrame(theNucleus, p1); 00298 } 00299 Particle backupParticle2 = *p2; 00300 if(p2HasLocalEnergy) { 00301 p2->propagate(t - currentTime); 00302 if(p2->getPosition().mag() > theNucleus->getSurfaceRadius(p2)) { 00303 *p2 = backupParticle2; 00304 if(p1HasLocalEnergy) { 00305 *p1 = backupParticle1; 00306 } 00307 return NULL; 00308 } 00309 KinematicsUtils::transformToLocalEnergyFrame(theNucleus, p2); 00310 } 00311 00312 // Compute the total cross section 00313 const G4double totalCrossSection = CrossSections::total(p1, p2); 00314 const G4double squareTotalEnergyInCM = KinematicsUtils::squareTotalEnergyInCM(p1,p2); 00315 00316 // Restore particles to their state before the local-energy tweak 00317 if(p1HasLocalEnergy) { 00318 *p1 = backupParticle1; 00319 } 00320 if(p2HasLocalEnergy) { 00321 *p2 = backupParticle2; 00322 } 00323 00324 // Is the CM energy > cutNN? (no cutNN on the first collision) 00325 if(theNucleus->getStore()->getBook()->getAcceptedCollisions()>0 00326 && p1->isNucleon() && p2->isNucleon() 00327 && squareTotalEnergyInCM < BinaryCollisionAvatar::cutNNSquared) return NULL; 00328 00329 // Do the particles come close enough to each other? 00330 if(Math::tenPi*minDistOfApproachSquared > totalCrossSection) return NULL; 00331 00332 // Bomb out if the two collision partners are the same particle 00333 // assert(p1->getID() != p2->getID()); 00334 00335 // Return a new avatar, then! 00336 return new G4INCL::BinaryCollisionAvatar(t, totalCrossSection, theNucleus, p1, p2); 00337 }
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.
particles | list of particles | |
except | list of excluded particles |
Definition at line 395 of file G4INCLStandardPropagationModel.cc.
References generateBinaryCollisionAvatar(), and registerAvatar().
Referenced by generateAllAvatars().
00395 { 00396 00397 G4bool haveExcept; 00398 haveExcept=(except.size()!=0); 00399 00400 // Loop over all the particles 00401 for(ParticleIter p1 = particles.begin(); p1 != particles.end(); ++p1) 00402 { 00403 // Loop over the rest of the particles 00404 ParticleIter p2 = p1; 00405 for(++p2; p2 != particles.end(); ++p2) 00406 { 00407 // Skip the collision if both particles must be excluded 00408 if(haveExcept && (*p1)->isInList(except) && (*p2)->isInList(except)) continue; 00409 00410 registerAvatar(generateBinaryCollisionAvatar(*p1,*p2)); 00411 } 00412 } 00413 00414 }
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.
particles | list of particles to (possibly) generate decays for |
Definition at line 440 of file G4INCLStandardPropagationModel.cc.
References G4INCL::DeltaDecayChannel::computeDecayTime(), and registerAvatar().
Referenced by generateAllAvatars(), and propagate().
00440 { 00441 for(ParticleIter i = particles.begin(); i != particles.end(); ++i) { 00442 if((*i)->isDelta()) { 00443 G4double decayTime = DeltaDecayChannel::computeDecayTime((*i)); 00444 G4double time = currentTime + decayTime; 00445 if(time <= maximumTime) { 00446 registerAvatar(new DecayAvatar((*i), time, theNucleus)); 00447 } 00448 } 00449 } 00450 }
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().
updatedParticles | list of updated particles | |
particles | list of particles |
Definition at line 376 of file G4INCLStandardPropagationModel.cc.
References generateBinaryCollisionAvatar(), and registerAvatar().
Referenced by updateAvatars().
00376 { 00377 00378 // Loop over all the updated particles 00379 for(ParticleIter updated = updatedParticles.begin(); updated != updatedParticles.end(); ++updated) 00380 { 00381 // Loop over all the particles 00382 for(ParticleIter particle = particles.begin(); particle != particles.end(); ++particle) 00383 { 00384 /* Consider the generation of a collision avatar only if (*particle) 00385 * is not one of the updated particles. 00386 * The criterion makes sure that you don't generate avatars between 00387 * updated particles. */ 00388 if((*particle)->isInList(updatedParticles)) continue; 00389 00390 registerAvatar(generateBinaryCollisionAvatar(*particle,*updated)); 00391 } 00392 } 00393 }
G4double G4INCL::StandardPropagationModel::getCurrentTime | ( | ) | [virtual] |
Returns the current global time of the system.
Implements G4INCL::IPropagationModel.
Definition at line 249 of file G4INCLStandardPropagationModel.cc.
G4INCL::Nucleus * G4INCL::StandardPropagationModel::getNucleus | ( | ) | [virtual] |
Get the nucleus.
Implements G4INCL::IPropagationModel.
Definition at line 74 of file G4INCLStandardPropagationModel.cc.
G4double G4INCL::StandardPropagationModel::getReflectionTime | ( | G4INCL::Particle const *const | aParticle | ) |
Get the reflection time.
Returns the reflection time of a particle on the potential wall.
aParticle | pointer to the particle |
Definition at line 339 of file G4INCLStandardPropagationModel.cc.
References ERROR, G4INCL::Intersection::exists, G4INCL::IntersectionFactory::getLaterTrajectoryIntersection(), G4INCL::Particle::getPosition(), G4INCL::Particle::getPropagationVelocity(), G4INCL::Nucleus::getSurfaceRadius(), G4INCL::Particle::print(), and G4INCL::Intersection::time.
00339 { 00340 Intersection theIntersection( 00341 IntersectionFactory::getLaterTrajectoryIntersection( 00342 aParticle->getPosition(), 00343 aParticle->getPropagationVelocity(), 00344 theNucleus->getSurfaceRadius(aParticle))); 00345 G4double time; 00346 if(theIntersection.exists) { 00347 time = currentTime + theIntersection.time; 00348 } else { 00349 ERROR("Imaginary reflection time for particle: " << std::endl 00350 << aParticle->print()); 00351 time = 10000.0; 00352 } 00353 return time; 00354 }
G4double G4INCL::StandardPropagationModel::getStoppingTime | ( | ) | [virtual] |
Get the current stopping time.
Implements G4INCL::IPropagationModel.
Definition at line 240 of file G4INCLStandardPropagationModel.cc.
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 356 of file G4INCLStandardPropagationModel.cc.
References G4INCL::ThreeVector::dot(), G4INCL::Particle::getPosition(), G4INCL::Particle::getPropagationVelocity(), and G4INCL::ThreeVector::mag2().
Referenced by generateBinaryCollisionAvatar().
00358 { 00359 G4double time; 00360 G4INCL::ThreeVector t13 = particleA->getPropagationVelocity(); 00361 t13 -= particleB->getPropagationVelocity(); 00362 G4INCL::ThreeVector distance = particleA->getPosition(); 00363 distance -= particleB->getPosition(); 00364 const G4double t7 = t13.dot(distance); 00365 const G4double dt = t13.mag2(); 00366 if(dt <= 1.0e-10) { 00367 (*minDistOfApproach) = 100000.0; 00368 return currentTime + 100000.0; 00369 } else { 00370 time = -t7/dt; 00371 } 00372 (*minDistOfApproach) = distance.mag2() + time * t7; 00373 return currentTime + time; 00374 }
G4INCL::IAvatar * G4INCL::StandardPropagationModel::propagate | ( | ) | [virtual] |
Propagate all particles and return the first avatar.
Implements G4INCL::IPropagationModel.
Definition at line 452 of file G4INCLStandardPropagationModel.cc.
References G4INCL::Store::clearAvatars(), ERROR, G4INCL::Store::findSmallestTime(), generateAllAvatars(), generateDecays(), G4INCL::Nucleus::getBlockedDelta(), G4INCL::Store::getBook(), G4INCL::Nucleus::getCreatedParticles(), G4INCL::Nucleus::getStore(), G4INCL::IAvatar::getTime(), G4INCL::Nucleus::getUpdatedParticles(), G4INCL::Store::initialiseParticleAvatarConnections(), G4INCL::Book::setCurrentTime(), G4INCL::Store::timeStep(), and updateAvatars().
00453 { 00454 // We update only the information related to particles that were updated 00455 // by the previous avatar. 00456 #ifdef INCL_REGENERATE_AVATARS 00457 #warning "The INCL_REGENERATE_AVATARS code has not been tested in a while. Use it at your peril." 00458 if(theNucleus->getUpdatedParticles().size()!=0 || theNucleus->getCreatedParticles().size()!=0) { 00459 // Regenerates the entire avatar list, skipping collisions between 00460 // updated particles 00461 theNucleus->getStore()->clearAvatars(); 00462 theNucleus->getStore()->initialiseParticleAvatarConnections(); 00463 generateAllAvatars(true); 00464 } 00465 #else 00466 // Deltas are created by transforming nucleon into a delta for 00467 // efficiency reasons 00468 Particle * const blockedDelta = theNucleus->getBlockedDelta(); 00469 ParticleList updatedParticles = theNucleus->getUpdatedParticles(); 00470 if(blockedDelta) 00471 updatedParticles.push_back(blockedDelta); 00472 generateDecays(updatedParticles); 00473 00474 ParticleList needNewAvatars = theNucleus->getUpdatedParticles(); 00475 ParticleList created = theNucleus->getCreatedParticles(); 00476 needNewAvatars.splice(needNewAvatars.end(), created); 00477 updateAvatars(needNewAvatars); 00478 #endif 00479 00480 G4INCL::IAvatar *theAvatar = theNucleus->getStore()->findSmallestTime(); 00481 if(theAvatar == 0) return 0; // Avatar list is empty 00482 // theAvatar->dispose(); 00483 00484 if(theAvatar->getTime() < currentTime) { 00485 ERROR("Avatar time = " << theAvatar->getTime() << ", currentTime = " << currentTime << std::endl); 00486 return 0; 00487 } else if(theAvatar->getTime() > currentTime) { 00488 theNucleus->getStore()->timeStep(theAvatar->getTime() - currentTime); 00489 00490 currentTime = theAvatar->getTime(); 00491 theNucleus->getStore()->getBook()->setCurrentTime(currentTime); 00492 } 00493 00494 return theAvatar; 00495 }
void G4INCL::StandardPropagationModel::registerAvatar | ( | G4INCL::IAvatar * | anAvatar | ) |
Add an avatar to the storage.
Definition at line 258 of file G4INCLStandardPropagationModel.cc.
References G4INCL::Store::add(), and G4INCL::Nucleus::getStore().
Referenced by generateAllAvatars(), generateCollisions(), generateDecays(), generateUpdatedCollisions(), and updateAvatars().
00259 { 00260 if(anAvatar) theNucleus->getStore()->add(anAvatar); 00261 }
void G4INCL::StandardPropagationModel::setNucleus | ( | G4INCL::Nucleus * | nucleus | ) | [virtual] |
Set the nucleus for this propagation model.
Implements G4INCL::IPropagationModel.
Definition at line 253 of file G4INCLStandardPropagationModel.cc.
void G4INCL::StandardPropagationModel::setStoppingTime | ( | G4double | ) | [virtual] |
Set the stopping time of the simulation.
Implements G4INCL::IPropagationModel.
Definition at line 244 of file G4INCLStandardPropagationModel.cc.
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.
00079 { 00080 if(projectileSpecies.theType==Composite) 00081 return shootComposite(projectileSpecies, kineticEnergy, impactParameter, phi); 00082 else 00083 return shootParticle(projectileSpecies.theType, kineticEnergy, impactParameter, phi); 00084 }
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(), DEBUG, generateAllAvatars(), G4INCL::Particle::getA(), G4INCL::ParticleTable::getNuclearRadius(), G4INCL::Nucleus::getStore(), G4INCL::ParticleTable::getTableMass, G4INCL::Nucleus::getUniverseRadius(), G4INCL::Particle::getZ(), G4INCL::ThreeVector::mag(), G4INCL::CoulombDistortion::maxImpactParameter(), position, G4INCL::Nucleus::setIncomingAngularMomentum(), G4INCL::Nucleus::setIncomingMomentum(), G4INCL::Nucleus::setInitialEnergy(), G4INCL::Nucleus::setNucleusNucleusCollision(), G4INCL::Nucleus::setProjectileChargeNumber(), G4INCL::Nucleus::setProjectileMassNumber(), and G4INCL::Nucleus::setProjectileRemnant().
Referenced by shoot().
00160 { 00161 theNucleus->setNucleusNucleusCollision(); 00162 currentTime = 0.0; 00163 00164 // Create the ProjectileRemnant object 00165 ProjectileRemnant *pr = new ProjectileRemnant(species, kineticEnergy); 00166 00167 // Same stopping time as for nucleon-nucleus 00168 maximumTime = 29.8 * std::pow(theNucleus->getA(), 0.16); 00169 00170 // If the incoming cluster is slow, use a larger stopping time 00171 const G4double rms = ParticleTable::getNuclearRadius(pr->getA(), pr->getZ()); 00172 const G4double rMax = theNucleus->getUniverseRadius(); 00173 const G4double distance = 2.*rMax + 2.725*rms; 00174 const G4double projectileVelocity = pr->boostVector().mag(); 00175 const G4double traversalTime = distance / projectileVelocity; 00176 if(maximumTime < traversalTime) 00177 maximumTime = traversalTime; 00178 DEBUG("Cascade stopping time is " << maximumTime << std::endl); 00179 00180 // If Coulomb is activated, do not process events with impact 00181 // parameter larger than the maximum impact parameter, taking into 00182 // account Coulomb distortion. 00183 if(impactParameter>CoulombDistortion::maxImpactParameter(pr,theNucleus)) { 00184 pr->deleteParticles(); 00185 DEBUG("impactParameter>CoulombDistortion::maxImpactParameter" << std::endl); 00186 delete pr; 00187 return -1.; 00188 } 00189 00190 // Position the cluster at the right impact parameter 00191 ThreeVector position(impactParameter * std::cos(phi), 00192 impactParameter * std::sin(phi), 00193 0.); 00194 pr->setPosition(position); 00195 00196 /* Store the internal kinematics of the projectile remnant. 00197 * 00198 * Note that this is at variance with the Fortran version, which stores 00199 * the initial kinematics of the particles *after* putting the spectators 00200 * on mass shell, but *before* removing the same energy from the 00201 * participants. Due to the different code flow, doing so in the C++ 00202 * version leads to wrong excitation energies for the forced compound 00203 * nucleus. 00204 */ 00205 pr->storeComponents(); 00206 00207 // Fill in the relevant kinematic variables 00208 theNucleus->setIncomingAngularMomentum(pr->getAngularMomentum()); 00209 theNucleus->setIncomingMomentum(pr->getMomentum()); 00210 theNucleus->setInitialEnergy(pr->getEnergy() 00211 + ParticleTable::getTableMass(theNucleus->getA(),theNucleus->getZ())); 00212 00213 generateAllAvatars(); 00214 firstAvatar = false; 00215 00216 // Get the entry avatars from Coulomb 00217 IAvatarList theAvatarList 00218 = CoulombDistortion::bringToSurface(pr, theNucleus); 00219 00220 if(theAvatarList.empty()) { 00221 DEBUG("No ParticleEntryAvatar found, transparent event" << std::endl); 00222 pr->deleteParticles(); 00223 delete pr; 00224 return -1.; 00225 } 00226 00227 // Tell the Nucleus about the ProjectileRemnant 00228 theNucleus->setProjectileRemnant(pr); 00229 00230 // Set the number of projectile particles 00231 theNucleus->setProjectileChargeNumber(pr->getZ()); 00232 theNucleus->setProjectileMassNumber(pr->getA()); 00233 00234 // Register the ParticleEntryAvatars 00235 theNucleus->getStore()->addParticleEntryAvatars(theAvatarList); 00236 00237 return pr->getTransversePosition().mag(); 00238 }
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(), DEBUG, 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(), 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().
00086 { 00087 theNucleus->setParticleNucleusCollision(); 00088 currentTime = 0.0; 00089 00090 // Create the projectile particle 00091 const G4double projectileMass = ParticleTable::getTableParticleMass(type); 00092 G4double energy = kineticEnergy + projectileMass; 00093 G4double momentumZ = std::sqrt(energy*energy - projectileMass*projectileMass); 00094 ThreeVector momentum(0.0, 0.0, momentumZ); 00095 Particle *p= new G4INCL::Particle(type, energy, momentum, ThreeVector()); 00096 00097 G4double temfin = 0.0; 00098 if( p->isNucleon() ) 00099 temfin = 29.8 * std::pow(theNucleus->getA(), 0.16); 00100 else { 00101 const G4double tlab = p->getEnergy() - p->getMass(); 00102 temfin = 30.18 * std::pow(theNucleus->getA(), 0.17*(1.0 - 5.7E-5*tlab)); 00103 } 00104 00105 maximumTime = temfin; 00106 00107 // If the incoming particle is slow, use a larger stopping time 00108 const G4double rMax = theNucleus->getUniverseRadius(); 00109 const G4double distance = 2.*rMax; 00110 const G4double projectileVelocity = p->boostVector().mag(); 00111 const G4double traversalTime = distance / projectileVelocity; 00112 if(maximumTime < traversalTime) 00113 maximumTime = traversalTime; 00114 DEBUG("Cascade stopping time is " << maximumTime << std::endl); 00115 00116 // If Coulomb is activated, do not process events with impact 00117 // parameter larger than the maximum impact parameter, taking into 00118 // account Coulomb distortion. 00119 if(impactParameter>CoulombDistortion::maxImpactParameter(p->getSpecies(), kineticEnergy, theNucleus)) { 00120 DEBUG("impactParameter>CoulombDistortion::maxImpactParameter" << std::endl); 00121 delete p; 00122 return -1.; 00123 } 00124 00125 ThreeVector position(impactParameter * std::cos(phi), 00126 impactParameter * std::sin(phi), 00127 0.); 00128 p->setPosition(position); 00129 00130 // Fill in the relevant kinematic variables 00131 theNucleus->setIncomingAngularMomentum(p->getAngularMomentum()); 00132 theNucleus->setIncomingMomentum(p->getMomentum()); 00133 theNucleus->setInitialEnergy(p->getEnergy() 00134 + ParticleTable::getTableMass(theNucleus->getA(),theNucleus->getZ())); 00135 00136 // Reset the particle kinematics to the INCL values 00137 p->setINCLMass(); 00138 p->setEnergy(p->getMass() + kineticEnergy); 00139 p->adjustMomentumFromEnergy(); 00140 00141 p->makeProjectileSpectator(); 00142 generateAllAvatars(); 00143 firstAvatar = false; 00144 00145 // Get the entry avatars from Coulomb and put them in the Store 00146 ParticleEntryAvatar *theEntryAvatar = CoulombDistortion::bringToSurface(p, theNucleus); 00147 if(theEntryAvatar) { 00148 theNucleus->getStore()->addParticleEntryAvatar(theEntryAvatar); 00149 00150 theNucleus->setProjectileChargeNumber(p->getZ()); 00151 theNucleus->setProjectileMassNumber(p->getA()); 00152 00153 return p->getTransversePosition().mag(); 00154 } else { 00155 delete p; 00156 return -1.; 00157 } 00158 }
void G4INCL::StandardPropagationModel::updateAvatars | ( | const ParticleList & | particles | ) |
Update all avatars related to a particle.
Definition at line 416 of file G4INCLStandardPropagationModel.cc.
References generateUpdatedCollisions(), G4INCL::Store::getParticles(), G4INCL::Nucleus::getStore(), and registerAvatar().
Referenced by propagate().
00416 { 00417 00418 for(ParticleIter iter = particles.begin(); iter != particles.end(); ++iter) { 00419 G4double time = this->getReflectionTime(*iter); 00420 if(time <= maximumTime) registerAvatar(new SurfaceAvatar(*iter, time, theNucleus)); 00421 } 00422 ParticleList const &p = theNucleus->getStore()->getParticles(); 00423 generateUpdatedCollisions(particles, p); // Predict collisions with spectators and participants 00424 }