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
00037
00038
00039
00040
00041
00042
00043
00044 #include "G4INCLSurfaceAvatar.hh"
00045 #include "G4INCLRandom.hh"
00046 #include "G4INCLReflectionChannel.hh"
00047 #include "G4INCLTransmissionChannel.hh"
00048 #include "G4INCLClustering.hh"
00049 #include <sstream>
00050 #include <string>
00051
00052 namespace G4INCL {
00053
00054 SurfaceAvatar::SurfaceAvatar(G4INCL::Particle *aParticle, G4double time, G4INCL::Nucleus *n)
00055 :IAvatar(time), theParticle(aParticle), theNucleus(n)
00056 {
00057 setType(SurfaceAvatarType);
00058 }
00059
00060 SurfaceAvatar::~SurfaceAvatar() {
00061
00062 }
00063
00064 G4INCL::IChannel* SurfaceAvatar::getChannel() const
00065 {
00066 if(theParticle->isTargetSpectator()) {
00067 DEBUG("Particle " << theParticle->getID() << " is a spectator, reflection" << std::endl);
00068 return new ReflectionChannel(theNucleus, theParticle);
00069 }
00070
00071
00072
00073
00074 if(theParticle->isResonance()) {
00075 const G4double theFermiEnergy = theNucleus->getPotential()->getFermiEnergy(theParticle);
00076 if(theParticle->getKineticEnergy()<theFermiEnergy) {
00077 DEBUG("Particle " << theParticle->getID() << " is a resonance below Tf, reflection" << std::endl
00078 << " Tf=" << theFermiEnergy << ", EKin=" << theParticle->getKineticEnergy() << std::endl);
00079 return new ReflectionChannel(theNucleus, theParticle);
00080 }
00081 }
00082
00083
00084 const G4double transmissionProbability = getTransmissionProbability(theParticle);
00085
00086 DEBUG("Transmission probability for particle " << theParticle->getID() << " = " << transmissionProbability << std::endl);
00087
00088
00089
00090
00091
00092
00093
00094
00095 if(theParticle->isNucleon()
00096 && (!theParticle->isProjectileSpectator() || !theNucleus->isNucleusNucleusCollision())
00097 && transmissionProbability>1.E-4) {
00098 Cluster *candidateCluster = 0;
00099
00100 candidateCluster = Clustering::getCluster(theNucleus, theParticle);
00101 if(candidateCluster != 0 &&
00102 Clustering::clusterCanEscape(theNucleus, candidateCluster)) {
00103
00104 DEBUG("Cluster algorithm succeded. Candidate cluster:" << std::endl << candidateCluster->print() << std::endl);
00105
00106
00107 const G4double clusterTransmissionProbability = getTransmissionProbability(candidateCluster);
00108 const G4double x = Random::shoot();
00109
00110 DEBUG("Transmission probability for cluster " << candidateCluster->getID() << " = " << clusterTransmissionProbability << std::endl);
00111
00112 if (x <= clusterTransmissionProbability) {
00113 DEBUG("Cluster " << candidateCluster->getID() << " passes the Coulomb barrier, transmitting." << std::endl);
00114 return new TransmissionChannel(theNucleus, candidateCluster);
00115 } else {
00116 DEBUG("Cluster " << candidateCluster->getID() << " does not pass the Coulomb barrier. Falling back to transmission of the leading particle." << std::endl);
00117 delete candidateCluster;
00118 }
00119 } else {
00120 delete candidateCluster;
00121 }
00122 }
00123
00124
00125
00126
00127
00128
00129 if(theParticle->isProjectileSpectator() && transmissionProbability>0.) {
00130 DEBUG("Particle " << theParticle->getID() << " is a projectile spectator, transmission" << std::endl);
00131 return new TransmissionChannel(theNucleus, theParticle);
00132 }
00133
00134
00135 const G4double x = Random::shoot();
00136
00137 if(x <= transmissionProbability) {
00138 DEBUG("Particle " << theParticle->getID() << " passes the Coulomb barrier, transmitting." << std::endl);
00139 return new TransmissionChannel(theNucleus, theParticle);
00140 } else {
00141 DEBUG("Particle " << theParticle->getID() << " does not pass the Coulomb barrier, reflection." << std::endl);
00142 return new ReflectionChannel(theNucleus, theParticle);
00143 }
00144 }
00145
00146 G4INCL::FinalState* SurfaceAvatar::getFinalState() const
00147 {
00148 return getChannel()->getFinalState();
00149 }
00150
00151 void SurfaceAvatar::preInteraction() {}
00152
00153 FinalState *SurfaceAvatar::postInteraction(FinalState *fs) {
00154 ParticleList outgoing = fs->getOutgoingParticles();
00155 if(!outgoing.empty()) {
00156
00157 Particle *out = outgoing.front();
00158 if(out->isCluster()) {
00159 Cluster *clusterOut = dynamic_cast<Cluster*>(out);
00160 ParticleList const components = clusterOut->getParticles();
00161 for(ParticleIter i=components.begin(); i!=components.end(); ++i) {
00162 if(!(*i)->isTargetSpectator())
00163 theNucleus->getStore()->getBook()->decrementCascading();
00164 }
00165 } else if(!theParticle->isTargetSpectator()) {
00166
00167 theNucleus->getStore()->getBook()->decrementCascading();
00168 }
00169 }
00170 return fs;
00171 }
00172
00173 std::string SurfaceAvatar::dump() const {
00174 std::stringstream ss;
00175 ss << "(avatar " << theTime << " 'reflection" << std::endl
00176 << "(list " << std::endl
00177 << theParticle->dump()
00178 << "))" << std::endl;
00179 return ss.str();
00180 }
00181
00182 G4double SurfaceAvatar::getTransmissionProbability(Particle const * const particle) const {
00183
00184 G4double E = particle->getKineticEnergy();
00185 const G4double V = particle->getPotentialEnergy();
00186
00187
00188 const G4int theA = theNucleus->getA();
00189 const G4int theZ = theNucleus->getZ();
00190 E += particle->getEmissionQValueCorrection(theA, theZ);
00191
00192 if (E <= V)
00193 return 0.0;
00194
00195 const G4double m = particle->getMass();
00196 const G4double EMinusV = E-V;
00197 const G4double EMinusV2 = EMinusV*EMinusV;
00198
00199
00200 const G4double x=std::sqrt((2.*m*E+E*E)*(2.*m*EMinusV+EMinusV2));
00201
00202
00203 G4double theTransmissionProbability =
00204 4.*x/(2.*m*(E+EMinusV)+E*E+(EMinusV2)+2.*x);
00205
00206
00207
00208 const G4int theParticleZ = particle->getZ();
00209 if (theParticleZ <= 0 || theParticleZ >= theZ)
00210 return theTransmissionProbability;
00211
00212
00213 const G4double theTransmissionBarrier = theNucleus->getTransmissionBarrier(particle);
00214 if (EMinusV >= theTransmissionBarrier)
00215 return theTransmissionProbability;
00216
00217
00218 const G4double px = std::sqrt(EMinusV/theTransmissionBarrier);
00219 const G4double logCoulombTransmission =
00220 theParticleZ*(theZ-theParticleZ)/137.03*std::sqrt(2.*m/EMinusV/(1.+EMinusV/2./m))
00221 *(std::acos(px)-px*std::sqrt(1.-px*px));
00222 if (logCoulombTransmission > 35.)
00223 return 0.;
00224 theTransmissionProbability *= std::exp(-2.*logCoulombTransmission);
00225
00226 return theTransmissionProbability;
00227 }
00228
00229 }