34#define INCLXX_IN_GEANT4_MODE 1
56 :
IAvatar(time), theParticle(aParticle), theNucleus(n),
65 sinRefractionAngle(0.),
66 cosRefractionAngle(0.),
67 refractionIndexRatio(0.),
68 internalReflection(false)
79 INCL_DEBUG(
"Particle " << theParticle->
getID() <<
" is a spectator, reflection" <<
'\n');
89 INCL_DEBUG(
"Particle " << theParticle->
getID() <<
" is a resonance below Tf, reflection" <<
'\n'
90 <<
" Tf=" << theFermiEnergy <<
", EKin=" << theParticle->
getKineticEnergy() <<
'\n');
99 const G4double cosR = cosRefractionAngle;
101 INCL_DEBUG(
"Transmission probability for particle " << theParticle->
getID() <<
" = " << transmissionProbability <<
'\n');
112 && transmissionProbability>1.E-4) {
116 if(candidateCluster != 0 &&
119 INCL_DEBUG(
"Cluster algorithm succeeded. Candidate cluster:" <<
'\n' << candidateCluster->
print() <<
'\n');
125 INCL_DEBUG(
"Transmission probability for cluster " << candidateCluster->
getID() <<
" = " << clusterTransmissionProbability <<
'\n');
127 if (x <= clusterTransmissionProbability) {
129 INCL_DEBUG(
"Cluster " << candidateCluster->
getID() <<
" passes the Coulomb barrier, transmitting." <<
'\n');
132 INCL_DEBUG(
"Cluster " << candidateCluster->
getID() <<
" does not pass the Coulomb barrier. Falling back to transmission of the leading particle." <<
'\n');
133 delete candidateCluster;
136 delete candidateCluster;
146 INCL_DEBUG(
"Particle " << theParticle->
getID() <<
" is a projectile spectator, transmission" <<
'\n');
153 if(x <= transmissionProbability) {
154 INCL_DEBUG(
"Particle " << theParticle->
getID() <<
" passes the Coulomb barrier, transmitting." <<
'\n');
162 INCL_DEBUG(
"Particle " << theParticle->
getID() <<
" does not pass the Coulomb barrier, reflection." <<
'\n');
175 if(!outgoing.empty()) {
182 for(
ParticleIter i=components.begin(), e=components.end(); i!=e; ++i) {
183 if(!(*i)->isTargetSpectator())
195 std::stringstream ss;
196 ss <<
"(avatar " <<
theTime <<
" 'reflection" <<
'\n'
198 << theParticle->
dump()
205 particleMass = particle->
getMass();
215 if (particleTOut <= V)
218 TMinusV = particleTOut-V;
219 TMinusV2 = TMinusV*TMinusV;
223 const G4double particlePOut2 = 2.*particleMass*TMinusV+TMinusV2;
224 particlePIn = std::sqrt(particlePIn2);
225 particlePOut = std::sqrt(particlePOut2);
231 G4double theTransmissionProbability;
234 initializeRefractionVariables(particle);
236 if(internalReflection)
240 const G4double x = refractionIndexRatio*cosIncidentAngle;
241 const G4double y = (x - cosRefractionAngle) / (x + cosRefractionAngle);
243 theTransmissionProbability = 1. - y*y;
247 const G4double y = particlePIn+particlePOut;
250 theTransmissionProbability = 4.*particlePIn*particlePOut/(y*y);
255 const G4int particleZ = particle->
getZ();
256 if (particleZ <= 0 || particleZ >= theZ)
257 return theTransmissionProbability;
261 if (TMinusV >= theTransmissionBarrier)
262 return theTransmissionProbability;
265 const G4double px = std::sqrt(TMinusV/theTransmissionBarrier);
266 const G4double logCoulombTransmission =
267 particleZ*(theZ-particleZ)/137.03*std::sqrt(2.*particleMass/TMinusV/(1.+TMinusV/2./particleMass))
269 INCL_DEBUG(
"Coulomb barrier, logCoulombTransmission=" << logCoulombTransmission <<
'\n');
270 if (logCoulombTransmission > 35.)
272 theTransmissionProbability *= std::exp(-2.*logCoulombTransmission);
274 return theTransmissionProbability;
277 void SurfaceAvatar::initializeRefractionVariables(
Particle const *
const particle) {
279 if(cosIncidentAngle>1.)
281 sinIncidentAngle = std::sqrt(1. - cosIncidentAngle*cosIncidentAngle);
282 refractionIndexRatio = particlePIn/particlePOut;
283 const G4double sinCandidate = refractionIndexRatio*sinIncidentAngle;
284 internalReflection = (std::fabs(sinCandidate)>1.);
285 if(internalReflection) {
286 sinRefractionAngle = 1.;
287 cosRefractionAngle = 0.;
289 sinRefractionAngle = sinCandidate;
290 cosRefractionAngle = std::sqrt(1. - sinRefractionAngle*sinRefractionAngle);
292 INCL_DEBUG(
"Refraction parameters initialised as follows:\n"
293 <<
" cosIncidentAngle=" << cosIncidentAngle <<
'\n'
294 <<
" sinIncidentAngle=" << sinIncidentAngle <<
'\n'
295 <<
" cosRefractionAngle=" << cosRefractionAngle <<
'\n'
296 <<
" sinRefractionAngle=" << sinRefractionAngle <<
'\n'
297 <<
" refractionIndexRatio=" << refractionIndexRatio <<
'\n'
298 <<
" internalReflection=" << internalReflection <<
'\n');
Static class for cluster formation.
void decrementCascading()
void incrementEmittedClusters()
ParticleList const & getParticles() const
std::string print() const
G4bool getRefraction() const
True if we should use refraction.
ParticleList const & getOutgoingParticles() const
void setType(AvatarType t)
virtual void fillFinalState(FinalState *fs)=0
G4double getFermiEnergy(const Particle *const p) const
Return the Fermi energy for a particle.
G4bool isNucleusNucleusCollision() const
Is it a nucleus-nucleus collision?
G4double getTransmissionBarrier(Particle const *const p)
Get the transmission barrier.
NuclearPotential::INuclearPotential const * getPotential() const
Getter for thePotential.
std::vector< G4int > getParticleListBiasVector() const
G4int getS() const
Returns the strangeness number.
G4double getEmissionQValueCorrection(const G4int AParent, const G4int ZParent) const
Computes correction on the emission Q-value.
void setBiasCollisionVector(std::vector< G4int > BiasCollisionVector)
Set the vector list of biased vertices on the particle path.
void setNumberOfKaon(const G4int NK)
G4double getPotentialEnergy() const
Get the particle potential energy.
void rpCorrelate()
Make the particle follow a strict r-p correlation.
G4bool isNucleonorLambda() const
Is this a Nucleon or a Lambda?
G4int getZ() const
Returns the charge number.
G4double getKineticEnergy() const
Get the particle kinetic energy.
G4bool isTargetSpectator() const
G4double getCosRPAngle() const
Get the cosine of the angle between position and momentum.
G4bool isProjectileSpectator() const
const G4INCL::ThreeVector & getMomentum() const
G4bool isKaon() const
Is this a Kaon?
G4int getNumberOfKaon() const
Number of Kaon inside de nucleus.
G4bool isResonance() const
Is it a resonance?
G4double getMass() const
Get the cached particle mass.
G4int getA() const
Returns the baryon number.
Config const * getConfig()
SurfaceAvatar(G4INCL::Particle *aParticle, G4double time, G4INCL::Nucleus *aNucleus)
virtual void postInteraction(FinalState *)
G4double getTransmissionProbability(Particle const *const particle)
Calculate the transmission probability for the particle.
void fillFinalState(FinalState *fs)
virtual void preInteraction()
Cluster * getCluster(Nucleus *n, Particle *p)
Call the clustering algorithm.
G4bool clusterCanEscape(Nucleus const *const n, Cluster const *const c)
Determine whether the cluster can escape or not.
G4double arcCos(const G4double x)
Calculates arccos with some tolerance on illegal arguments.
ParticleList::const_iterator ParticleIter