Geant4-11
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes
G4INCL::SurfaceAvatar Class Reference

#include <G4INCLSurfaceAvatar.hh>

Inheritance diagram for G4INCL::SurfaceAvatar:
G4INCL::IAvatar

Public Member Functions

std::string dump () const
 
void fillFinalState (FinalState *fs)
 
IChannelgetChannel ()
 
G4double getCosRefractionAngle () const
 Get the cosine of the refraction angle (precalculated by initializeRefractionVariables) More...
 
FinalStategetFinalState ()
 
long getID () const
 
G4double getOutgoingMomentum () const
 Get the outgoing momentum (precalculated by initializeRefractionVariables) More...
 
ParticleList getParticles () const
 
G4double getTime () const
 
G4double getTransmissionProbability (Particle const *const particle)
 Calculate the transmission probability for the particle. More...
 
AvatarType getType () const
 
G4bool isACollision () const
 
G4bool isADecay () const
 
virtual void postInteraction (FinalState *)
 
virtual void preInteraction ()
 
void setType (AvatarType t)
 
 SurfaceAvatar (G4INCL::Particle *aParticle, G4double time, G4INCL::Nucleus *aNucleus)
 
std::string toString ()
 
virtual ~SurfaceAvatar ()
 

Protected Attributes

G4double theTime
 

Private Member Functions

void initializeRefractionVariables (Particle const *const particle)
 

Private Attributes

G4double cosIncidentAngle
 
G4double cosRefractionAngle
 
long ID
 
G4bool internalReflection
 
G4double particleMass
 
G4double particlePIn
 
G4double particlePOut
 
G4double particleTOut
 
G4double refractionIndexRatio
 
G4double sinIncidentAngle
 
G4double sinRefractionAngle
 
G4INCL::NucleustheNucleus
 
G4INCL::ParticletheParticle
 
G4double TMinusV
 
G4double TMinusV2
 
AvatarType type
 

Static Private Attributes

static G4ThreadLocal long nextID = 1
 

Detailed Description

Surface avatar

The reflection avatar is created when a particle reaches the boundary of the nucleus. At this point it can either be reflected from the boundary or exit the nucleus.

Definition at line 62 of file G4INCLSurfaceAvatar.hh.

Constructor & Destructor Documentation

◆ SurfaceAvatar()

G4INCL::SurfaceAvatar::SurfaceAvatar ( G4INCL::Particle aParticle,
G4double  time,
G4INCL::Nucleus aNucleus 
)

Definition at line 55 of file G4INCLSurfaceAvatar.cc.

56 :IAvatar(time), theParticle(aParticle), theNucleus(n),
57 particlePIn(0.),
58 particlePOut(0.),
59 particleTOut(0.),
60 TMinusV(0.),
61 TMinusV2(0.),
62 particleMass(0.),
69 {
71 }
void setType(AvatarType t)
G4INCL::Particle * theParticle
G4INCL::Nucleus * theNucleus
@ SurfaceAvatarType

References G4INCL::IAvatar::setType(), and G4INCL::SurfaceAvatarType.

◆ ~SurfaceAvatar()

G4INCL::SurfaceAvatar::~SurfaceAvatar ( )
virtual

Definition at line 73 of file G4INCLSurfaceAvatar.cc.

74 {
75 }

Member Function Documentation

◆ dump()

std::string G4INCL::SurfaceAvatar::dump ( ) const
virtual

Implements G4INCL::IAvatar.

Definition at line 194 of file G4INCLSurfaceAvatar.cc.

194 {
195 std::stringstream ss;
196 ss << "(avatar " << theTime << " 'reflection" << '\n'
197 << "(list " << '\n'
198 << theParticle->dump()
199 << "))" << '\n';
200 return ss.str();
201 }
std::string dump() const

References G4INCL::Particle::dump(), theParticle, and G4INCL::IAvatar::theTime.

◆ fillFinalState()

void G4INCL::SurfaceAvatar::fillFinalState ( FinalState fs)

Definition at line 167 of file G4INCLSurfaceAvatar.cc.

167 {
169 }
virtual void fillFinalState(FinalState *fs)=0

References G4INCL::IChannel::fillFinalState(), and getChannel().

◆ getChannel()

G4INCL::IChannel * G4INCL::SurfaceAvatar::getChannel ( )
virtual

Implements G4INCL::IAvatar.

Definition at line 77 of file G4INCLSurfaceAvatar.cc.

77 {
79 INCL_DEBUG("Particle " << theParticle->getID() << " is a spectator, reflection" << '\n');
80 return new ReflectionChannel(theNucleus, theParticle);
81 }
82
83 // We forbid transmission of resonances below the Fermi energy. Emitting a
84 // delta particle below Tf can lead to negative excitation energies, since
85 // CDPP assumes that particles stay in the Fermi sea.
87 const G4double theFermiEnergy = theNucleus->getPotential()->getFermiEnergy(theParticle);
88 if(theParticle->getKineticEnergy()<theFermiEnergy) {
89 INCL_DEBUG("Particle " << theParticle->getID() << " is a resonance below Tf, reflection" << '\n'
90 << " Tf=" << theFermiEnergy << ", EKin=" << theParticle->getKineticEnergy() << '\n');
91 return new ReflectionChannel(theNucleus, theParticle);
92 }
93 }
94
95 // Don't try to make a cluster if the leading particle is too slow
96 const G4double transmissionProbability = getTransmissionProbability(theParticle);
97 const G4double TOut = TMinusV;
98 const G4double kOut = particlePOut;
99 const G4double cosR = cosRefractionAngle;
100
101 INCL_DEBUG("Transmission probability for particle " << theParticle->getID() << " = " << transmissionProbability << '\n');
102 /* Don't attempt to construct clusters when a projectile spectator is
103 * trying to escape during a nucleus-nucleus collision. The idea behind
104 * this is that projectile spectators will later be collected in the
105 * projectile remnant, and trying to clusterise them somewhat feels like
106 * G4double counting. Moreover, applying the clustering algorithm on escaping
107 * projectile spectators makes the code *really* slow if the projectile is
108 * large.
109 */
112 && transmissionProbability>1.E-4) {
113 Cluster *candidateCluster = 0;
114
115 candidateCluster = Clustering::getCluster(theNucleus, theParticle);
116 if(candidateCluster != 0 &&
117 Clustering::clusterCanEscape(theNucleus, candidateCluster)) {
118
119 INCL_DEBUG("Cluster algorithm succeeded. Candidate cluster:" << '\n' << candidateCluster->print() << '\n');
120
121 // Check if the cluster can penetrate the Coulomb barrier
122 const G4double clusterTransmissionProbability = getTransmissionProbability(candidateCluster);
123 const G4double x = Random::shoot();
124
125 INCL_DEBUG("Transmission probability for cluster " << candidateCluster->getID() << " = " << clusterTransmissionProbability << '\n');
126
127 if (x <= clusterTransmissionProbability) {
129 INCL_DEBUG("Cluster " << candidateCluster->getID() << " passes the Coulomb barrier, transmitting." << '\n');
130 return new TransmissionChannel(theNucleus, candidateCluster);
131 } else {
132 INCL_DEBUG("Cluster " << candidateCluster->getID() << " does not pass the Coulomb barrier. Falling back to transmission of the leading particle." << '\n');
133 delete candidateCluster;
134 }
135 } else {
136 delete candidateCluster;
137 }
138 }
139
140 // If we haven't transmitted a cluster (maybe cluster feature was
141 // disabled or maybe we just can't produce an acceptable cluster):
142
143 // Always transmit projectile spectators if no cluster was formed and if
144 // transmission is energetically allowed
145 if(theParticle->isProjectileSpectator() && transmissionProbability>0.) {
146 INCL_DEBUG("Particle " << theParticle->getID() << " is a projectile spectator, transmission" << '\n');
147 return new TransmissionChannel(theNucleus, theParticle, TOut);
148 }
149
150 // Transmit or reflect depending on the transmission probability
151 const G4double x = Random::shoot();
152
153 if(x <= transmissionProbability) { // Transmission
154 INCL_DEBUG("Particle " << theParticle->getID() << " passes the Coulomb barrier, transmitting." << '\n');
157 return new TransmissionChannel(theNucleus, theParticle, kOut, cosR);
158 } else {
159 return new TransmissionChannel(theNucleus, theParticle, TOut);
160 }
161 } else { // Reflection
162 INCL_DEBUG("Particle " << theParticle->getID() << " does not pass the Coulomb barrier, reflection." << '\n');
163 return new ReflectionChannel(theNucleus, theParticle);
164 }
165 }
#define INCL_DEBUG(x)
double G4double
Definition: G4Types.hh:83
void incrementEmittedClusters()
Definition: G4INCLBook.hh:79
G4bool getRefraction() const
True if we should use refraction.
G4double getFermiEnergy(const Particle *const p) const
Return the Fermi energy for a particle.
Store * getStore() const
G4bool isNucleusNucleusCollision() const
Is it a nucleus-nucleus collision?
NuclearPotential::INuclearPotential const * getPotential() const
Getter for thePotential.
void setNumberOfKaon(const G4int NK)
G4bool isNucleonorLambda() const
Is this a Nucleon or a Lambda?
G4double getKineticEnergy() const
Get the particle kinetic energy.
G4bool isTargetSpectator() const
G4bool isProjectileSpectator() const
G4bool isKaon() const
Is this a Kaon?
G4int getNumberOfKaon() const
Number of Kaon inside de nucleus.
G4bool isResonance() const
Is it a resonance?
long getID() const
Book & getBook()
Definition: G4INCLStore.hh:259
Config const * getConfig()
Definition: G4INCLStore.hh:273
G4double getTransmissionProbability(Particle const *const particle)
Calculate the transmission probability for the particle.
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 shoot()
Definition: G4INCLRandom.cc:93

References G4INCL::Clustering::clusterCanEscape(), cosRefractionAngle, G4INCL::Store::getBook(), G4INCL::Clustering::getCluster(), G4INCL::Store::getConfig(), G4INCL::NuclearPotential::INuclearPotential::getFermiEnergy(), G4INCL::Particle::getID(), G4INCL::Particle::getKineticEnergy(), G4INCL::Particle::getNumberOfKaon(), G4INCL::Nucleus::getPotential(), G4INCL::Config::getRefraction(), G4INCL::Nucleus::getStore(), getTransmissionProbability(), INCL_DEBUG, G4INCL::Book::incrementEmittedClusters(), G4INCL::Particle::isKaon(), G4INCL::Particle::isNucleonorLambda(), G4INCL::Nucleus::isNucleusNucleusCollision(), G4INCL::Particle::isProjectileSpectator(), G4INCL::Particle::isResonance(), G4INCL::Particle::isTargetSpectator(), particlePOut, G4INCL::Cluster::print(), G4INCL::Particle::setNumberOfKaon(), G4INCL::Random::shoot(), theNucleus, theParticle, and TMinusV.

Referenced by fillFinalState().

◆ getCosRefractionAngle()

G4double G4INCL::SurfaceAvatar::getCosRefractionAngle ( ) const
inline

Get the cosine of the refraction angle (precalculated by initializeRefractionVariables)

Definition at line 85 of file G4INCLSurfaceAvatar.hh.

85{ return cosRefractionAngle; }

References cosRefractionAngle.

◆ getFinalState()

FinalState * G4INCL::IAvatar::getFinalState ( )
inherited

Definition at line 90 of file G4INCLIAvatar.cc.

90 {
91 FinalState *fs = new FinalState;
93 return fs;
94 }
void fillFinalState(FinalState *fs)

References G4INCL::IAvatar::fillFinalState().

Referenced by G4INCL::INCL::makeCompoundNucleus().

◆ getID()

long G4INCL::IAvatar::getID ( ) const
inlineinherited

◆ getOutgoingMomentum()

G4double G4INCL::SurfaceAvatar::getOutgoingMomentum ( ) const
inline

Get the outgoing momentum (precalculated by initializeRefractionVariables)

Definition at line 88 of file G4INCLSurfaceAvatar.hh.

88{ return particlePOut; }

References particlePOut.

◆ getParticles()

ParticleList G4INCL::SurfaceAvatar::getParticles ( ) const
inlinevirtual

Implements G4INCL::IAvatar.

Definition at line 73 of file G4INCLSurfaceAvatar.hh.

73 {
74 ParticleList theParticleList;
75 theParticleList.push_back(theParticle);
76 return theParticleList;
77 }

References theParticle.

◆ getTime()

G4double G4INCL::IAvatar::getTime ( ) const
inlineinherited

◆ getTransmissionProbability()

G4double G4INCL::SurfaceAvatar::getTransmissionProbability ( Particle const *const  particle)

Calculate the transmission probability for the particle.

Definition at line 203 of file G4INCLSurfaceAvatar.cc.

203 {
204
205 particleMass = particle->getMass();
206 const G4double V = particle->getPotentialEnergy();
207
208 // Correction to the particle kinetic energy if using real masses
209 const G4int theA = theNucleus->getA();
210 const G4int theZ = theNucleus->getZ();
211 const G4int theS = theNucleus->getS();
212 const G4double correction = particle->getEmissionQValueCorrection(theA, theZ, theS);
213 particleTOut = particle->getKineticEnergy() + correction;
214
215 if (particleTOut <= V) // No transmission if total energy < 0
216 return 0.0;
217
220
221 // Momenta in and out
222 const G4double particlePIn2 = particle->getMomentum().mag2();
223 const G4double particlePOut2 = 2.*particleMass*TMinusV+TMinusV2;
224 particlePIn = std::sqrt(particlePIn2);
225 particlePOut = std::sqrt(particlePOut2);
226
227 if (0. > V) // Automatic transmission for repulsive potential
228 return 1.0;
229
230 // Compute the transmission probability
231 G4double theTransmissionProbability;
233 // Use the formula with refraction
235
237 return 0.; // total internal reflection
238
239 // Intermediate variables for calculation
241 const G4double y = (x - cosRefractionAngle) / (x + cosRefractionAngle);
242
243 theTransmissionProbability = 1. - y*y;
244 } else {
245 // Use the formula without refraction
246 // Intermediate variable for calculation
248
249 // The transmission probability for a potential step
250 theTransmissionProbability = 4.*particlePIn*particlePOut/(y*y);
251 }
252
253 // For neutral and negative particles, no Coulomb transmission
254 // Also, no Coulomb if the particle takes away all of the nuclear charge
255 const G4int particleZ = particle->getZ();
256 if (particleZ <= 0 || particleZ >= theZ)
257 return theTransmissionProbability;
258
259 // Nominal Coulomb barrier
260 const G4double theTransmissionBarrier = theNucleus->getTransmissionBarrier(particle);
261 if (TMinusV >= theTransmissionBarrier) // Above the Coulomb barrier
262 return theTransmissionProbability;
263
264 // Coulomb-penetration factor
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))
268 *(Math::arcCos(px)-px*std::sqrt(1.-px*px));
269 INCL_DEBUG("Coulomb barrier, logCoulombTransmission=" << logCoulombTransmission << '\n');
270 if (logCoulombTransmission > 35.) // Transmission is forbidden by Coulomb
271 return 0.;
272 theTransmissionProbability *= std::exp(-2.*logCoulombTransmission);
273
274 return theTransmissionProbability;
275 }
int G4int
Definition: G4Types.hh:85
G4double getTransmissionBarrier(Particle const *const p)
Get the transmission barrier.
G4int getS() const
Returns the strangeness number.
G4int getZ() const
Returns the charge number.
G4int getA() const
Returns the baryon number.
void initializeRefractionVariables(Particle const *const particle)
G4double arcCos(const G4double x)
Calculates arccos with some tolerance on illegal arguments.

References G4INCL::Math::arcCos(), cosIncidentAngle, cosRefractionAngle, G4INCL::Particle::getA(), G4INCL::Store::getConfig(), G4INCL::Particle::getEmissionQValueCorrection(), G4INCL::Particle::getKineticEnergy(), G4INCL::Particle::getMass(), G4INCL::Particle::getMomentum(), G4INCL::Particle::getPotentialEnergy(), G4INCL::Config::getRefraction(), G4INCL::Particle::getS(), G4INCL::Nucleus::getStore(), G4INCL::Nucleus::getTransmissionBarrier(), G4INCL::Particle::getZ(), INCL_DEBUG, initializeRefractionVariables(), internalReflection, G4INCL::ThreeVector::mag2(), particleMass, particlePIn, particlePOut, particleTOut, refractionIndexRatio, theNucleus, TMinusV, and TMinusV2.

Referenced by getChannel().

◆ getType()

AvatarType G4INCL::IAvatar::getType ( ) const
inlineinherited

◆ initializeRefractionVariables()

void G4INCL::SurfaceAvatar::initializeRefractionVariables ( Particle const *const  particle)
private

Definition at line 277 of file G4INCLSurfaceAvatar.cc.

277 {
278 cosIncidentAngle = particle->getCosRPAngle();
279 if(cosIncidentAngle>1.)
284 internalReflection = (std::fabs(sinCandidate)>1.);
288 } else {
289 sinRefractionAngle = sinCandidate;
291 }
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');
299 }

References cosIncidentAngle, cosRefractionAngle, G4INCL::Particle::getCosRPAngle(), INCL_DEBUG, internalReflection, particlePIn, particlePOut, refractionIndexRatio, sinIncidentAngle, and sinRefractionAngle.

Referenced by getTransmissionProbability().

◆ isACollision()

G4bool G4INCL::IAvatar::isACollision ( ) const
inlineinherited

Definition at line 91 of file G4INCLIAvatar.hh.

91{ return (type==CollisionAvatarType); };
@ CollisionAvatarType

References G4INCL::CollisionAvatarType.

Referenced by G4INCL::CascadeAction::afterAvatarDefaultAction().

◆ isADecay()

G4bool G4INCL::IAvatar::isADecay ( ) const
inlineinherited

Definition at line 92 of file G4INCLIAvatar.hh.

92{ return (type==DecayAvatarType); };
@ DecayAvatarType

References G4INCL::DecayAvatarType.

Referenced by G4INCL::CascadeAction::afterAvatarDefaultAction().

◆ postInteraction()

void G4INCL::SurfaceAvatar::postInteraction ( FinalState fs)
virtual

Implements G4INCL::IAvatar.

Definition at line 173 of file G4INCLSurfaceAvatar.cc.

173 {
174 ParticleList const &outgoing = fs->getOutgoingParticles();
175 if(!outgoing.empty()) { // Transmission
176// assert(outgoing.size()==1);
177 Particle *out = outgoing.front();
178 out->rpCorrelate();
179 if(out->isCluster()) {
180 Cluster *clusterOut = dynamic_cast<Cluster*>(out);
181 ParticleList const &components = clusterOut->getParticles();
182 for(ParticleIter i=components.begin(), e=components.end(); i!=e; ++i) {
183 if(!(*i)->isTargetSpectator())
185 }
186 out->setBiasCollisionVector(components.getParticleListBiasVector());
187 } else if(!theParticle->isTargetSpectator()) {
188// assert(out==theParticle);
190 }
191 }
192 }
void decrementCascading()
Definition: G4INCLBook.hh:78
ParticleList::const_iterator ParticleIter

References G4INCL::Book::decrementCascading(), G4INCL::Store::getBook(), G4INCL::FinalState::getOutgoingParticles(), G4INCL::ParticleList::getParticleListBiasVector(), G4INCL::Cluster::getParticles(), G4INCL::Nucleus::getStore(), G4INCL::Particle::isCluster(), G4INCL::Particle::isTargetSpectator(), G4INCL::Particle::rpCorrelate(), G4INCL::Particle::setBiasCollisionVector(), theNucleus, and theParticle.

◆ preInteraction()

void G4INCL::SurfaceAvatar::preInteraction ( )
virtual

Implements G4INCL::IAvatar.

Definition at line 171 of file G4INCLSurfaceAvatar.cc.

171{}

◆ setType()

void G4INCL::IAvatar::setType ( AvatarType  t)
inlineinherited

◆ toString()

std::string G4INCL::IAvatar::toString ( )
inherited

Definition at line 73 of file G4INCLIAvatar.cc.

73 {
74 std::stringstream entry;
75 std::stringstream particleString;
76 ParticleList const &pl = getParticles();
78 for(ParticleIter i=pl.begin(), e=pl.end(); i!=e; ++i) {
80 particleString << (*i)->getID() << " ";
81 }
82 if(numberOfParticles == 1) particleString << "-1";
83 entry << getID() << " "
84 << getType() << " "
85 << getTime() << " "
86 << particleString.str();
87 return entry.str();
88 }
static int numberOfParticles
long getID() const
virtual ParticleList getParticles() const =0
G4double getTime() const
AvatarType getType() const

References G4INCL::IAvatar::getID(), G4INCL::IAvatar::getParticles(), G4INCL::IAvatar::getTime(), G4INCL::IAvatar::getType(), and numberOfParticles.

Field Documentation

◆ cosIncidentAngle

G4double G4INCL::SurfaceAvatar::cosIncidentAngle
private

◆ cosRefractionAngle

G4double G4INCL::SurfaceAvatar::cosRefractionAngle
private

◆ ID

long G4INCL::IAvatar::ID
privateinherited

Definition at line 98 of file G4INCLIAvatar.hh.

Referenced by G4INCL::IAvatar::IAvatar().

◆ internalReflection

G4bool G4INCL::SurfaceAvatar::internalReflection
private

◆ nextID

G4ThreadLocal long G4INCL::IAvatar::nextID = 1
staticprivateinherited

Definition at line 100 of file G4INCLIAvatar.hh.

Referenced by G4INCL::IAvatar::IAvatar().

◆ particleMass

G4double G4INCL::SurfaceAvatar::particleMass
private

Definition at line 102 of file G4INCLSurfaceAvatar.hh.

Referenced by getTransmissionProbability().

◆ particlePIn

G4double G4INCL::SurfaceAvatar::particlePIn
private

◆ particlePOut

G4double G4INCL::SurfaceAvatar::particlePOut
private

◆ particleTOut

G4double G4INCL::SurfaceAvatar::particleTOut
private

Definition at line 99 of file G4INCLSurfaceAvatar.hh.

Referenced by getTransmissionProbability().

◆ refractionIndexRatio

G4double G4INCL::SurfaceAvatar::refractionIndexRatio
private

◆ sinIncidentAngle

G4double G4INCL::SurfaceAvatar::sinIncidentAngle
private

Definition at line 103 of file G4INCLSurfaceAvatar.hh.

Referenced by initializeRefractionVariables().

◆ sinRefractionAngle

G4double G4INCL::SurfaceAvatar::sinRefractionAngle
private

Definition at line 105 of file G4INCLSurfaceAvatar.hh.

Referenced by initializeRefractionVariables().

◆ theNucleus

G4INCL::Nucleus* G4INCL::SurfaceAvatar::theNucleus
private

Definition at line 95 of file G4INCLSurfaceAvatar.hh.

Referenced by getChannel(), getTransmissionProbability(), and postInteraction().

◆ theParticle

G4INCL::Particle* G4INCL::SurfaceAvatar::theParticle
private

Definition at line 94 of file G4INCLSurfaceAvatar.hh.

Referenced by dump(), getChannel(), getParticles(), and postInteraction().

◆ theTime

G4double G4INCL::IAvatar::theTime
protectedinherited

◆ TMinusV

G4double G4INCL::SurfaceAvatar::TMinusV
private

Definition at line 100 of file G4INCLSurfaceAvatar.hh.

Referenced by getChannel(), and getTransmissionProbability().

◆ TMinusV2

G4double G4INCL::SurfaceAvatar::TMinusV2
private

Definition at line 101 of file G4INCLSurfaceAvatar.hh.

Referenced by getTransmissionProbability().

◆ type

AvatarType G4INCL::IAvatar::type
privateinherited

Definition at line 99 of file G4INCLIAvatar.hh.


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