00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #define INCLXX_IN_GEANT4_MODE 1
00034
00035 #include "globals.hh"
00036
00044 #include "G4INCLCoulombNone.hh"
00045 #include "G4INCLIntersection.hh"
00046
00047 namespace G4INCL {
00048
00049 ParticleEntryAvatar *CoulombNone::bringToSurface(Particle * const p, Nucleus * const n) const {
00050 Intersection intersection = IntersectionFactory::getEarlierTrajectoryIntersection(p->getPosition(), p->getPropagationVelocity(), n->getUniverseRadius());
00051 if(intersection.exists) {
00052 p->setPosition(intersection.position);
00053 return new ParticleEntryAvatar(0.0, n, p);
00054 } else
00055 return NULL;
00056 }
00057
00058 IAvatarList CoulombNone::bringToSurface(Cluster * const c, Nucleus * const n) const {
00059
00060 IAvatarList theAvatarList;
00061
00062
00063 ParticleList projectiles = c->getParticles();
00064 std::list<Intersection> theIntersections;
00065 G4double theFirstEntryTime = 1E+60;
00066 G4int theFirstID = 0;
00067 for(ParticleIter p=projectiles.begin(); p!=projectiles.end(); ++p) {
00068
00069 Intersection intersection(IntersectionFactory::getEarlierTrajectoryIntersection(
00070 (*p)->getPosition(),
00071 (*p)->getPropagationVelocity(),
00072 n->getUniverseRadius()));
00073
00074 theIntersections.push_back(intersection);
00075 if(intersection.exists) {
00076
00077 (*p)->setPosition(intersection.position);
00078
00079
00080 if(intersection.time < theFirstEntryTime) {
00081 theFirstEntryTime = intersection.time;
00082 theFirstID = (*p)->getID();
00083 }
00084 }
00085 }
00086
00087 std::list<Intersection>::const_iterator intIter = theIntersections.begin();
00088 for( ParticleIter p=projectiles.begin(); p!=projectiles.end(); ++p, ++intIter) {
00089
00090 if((*intIter).exists) {
00091
00092
00093 if((*p)->getID() == theFirstID) {
00094
00095
00096 theAvatarList.push_back(new ParticleEntryAvatar(0.0, n, *p));
00097 } else
00098 theAvatarList.push_back(new ParticleEntryAvatar(intIter->time - theFirstEntryTime, n, *p));
00099 }
00100
00101 }
00102
00103 return theAvatarList;
00104 }
00105
00106 }