Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4INCL::SurfaceAvatar Class Reference

#include <G4INCLSurfaceAvatar.hh>

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

Public Member Functions

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

Additional Inherited Members

- Protected Attributes inherited from G4INCL::IAvatar
G4double theTime
 

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 60 of file G4INCLSurfaceAvatar.hh.

Constructor & Destructor Documentation

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

Definition at line 54 of file G4INCLSurfaceAvatar.cc.

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

55  :IAvatar(time), theParticle(aParticle), theNucleus(n),
56  particlePIn(0.),
57  particlePOut(0.),
58  particleTOut(0.),
59  TMinusV(0.),
60  TMinusV2(0.),
61  particleMass(0.),
62  sinIncidentAngle(0.),
63  cosIncidentAngle(0.),
64  sinRefractionAngle(0.),
65  cosRefractionAngle(0.),
66  refractionIndexRatio(0.),
67  internalReflection(false)
68  {
70  }
void setType(AvatarType t)
const G4int n
G4INCL::SurfaceAvatar::~SurfaceAvatar ( )
virtual

Definition at line 72 of file G4INCLSurfaceAvatar.cc.

72  {
73 
74  }

Member Function Documentation

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

Implements G4INCL::IAvatar.

Definition at line 192 of file G4INCLSurfaceAvatar.cc.

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

192  {
193  std::stringstream ss;
194  ss << "(avatar " << theTime << " 'reflection" << std::endl
195  << "(list " << std::endl
196  << theParticle->dump()
197  << "))" << std::endl;
198  return ss.str();
199  }
std::string dump() const
G4INCL::IChannel * G4INCL::SurfaceAvatar::getChannel ( )
virtual

Implements G4INCL::IAvatar.

Definition at line 76 of file G4INCLSurfaceAvatar.cc.

References G4INCL::Clustering::clusterCanEscape(), G4INCL::Store::getBook(), G4INCL::Clustering::getCluster(), G4INCL::Store::getConfig(), G4INCL::NuclearPotential::INuclearPotential::getFermiEnergy(), G4INCL::Particle::getID(), G4INCL::Particle::getKineticEnergy(), G4INCL::Nucleus::getPotential(), G4INCL::Config::getRefraction(), G4INCL::Nucleus::getStore(), getTransmissionProbability(), INCL_DEBUG, G4INCL::Book::incrementEmittedClusters(), G4INCL::Particle::isNucleon(), G4INCL::Nucleus::isNucleusNucleusCollision(), G4INCL::Particle::isProjectileSpectator(), G4INCL::Particle::isResonance(), G4INCL::Particle::isTargetSpectator(), G4INCL::Cluster::print(), G4INCL::Random::shoot(), and test::x.

Referenced by getFinalState().

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

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

Definition at line 83 of file G4INCLSurfaceAvatar.hh.

83 { return cosRefractionAngle; }
G4INCL::FinalState * G4INCL::SurfaceAvatar::getFinalState ( )

Definition at line 165 of file G4INCLSurfaceAvatar.cc.

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

165  {
166  return getChannel()->getFinalState();
167  }
G4INCL::IChannel * getChannel()
virtual G4INCL::FinalState * getFinalState()=0
G4double G4INCL::SurfaceAvatar::getOutgoingMomentum ( ) const
inline

Get the outgoing momentum (precalculated by initializeRefractionVariables)

Definition at line 86 of file G4INCLSurfaceAvatar.hh.

86 { return particlePOut; }
ParticleList G4INCL::SurfaceAvatar::getParticles ( ) const
inlinevirtual

Implements G4INCL::IAvatar.

Definition at line 71 of file G4INCLSurfaceAvatar.hh.

71  {
72  ParticleList theParticleList;
73  theParticleList.push_back(theParticle);
74  return theParticleList;
75  }
UnorderedVector< Particle * > ParticleList
G4double G4INCL::SurfaceAvatar::getTransmissionProbability ( Particle const *const  particle)

Calculate the transmission probability for the particle.

Definition at line 201 of file G4INCLSurfaceAvatar.cc.

References 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::Nucleus::getStore(), G4INCL::Nucleus::getTransmissionBarrier(), G4INCL::Particle::getZ(), INCL_DEBUG, G4INCL::ThreeVector::mag2(), and test::x.

Referenced by getChannel().

201  {
202 
203  particleMass = particle->getMass();
204  const G4double V = particle->getPotentialEnergy();
205 
206  // Correction to the particle kinetic energy if using real masses
207  const G4int theA = theNucleus->getA();
208  const G4int theZ = theNucleus->getZ();
209  const G4double correction = particle->getEmissionQValueCorrection(theA, theZ);
210  particleTOut = particle->getKineticEnergy() + correction;
211 
212  if (particleTOut <= V) // No transmission if total energy < 0
213  return 0.0;
214 
215  TMinusV = particleTOut-V;
216  TMinusV2 = TMinusV*TMinusV;
217 
218  // Momenta in and out
219  const G4double particlePIn2 = particle->getMomentum().mag2();
220  const G4double particlePOut2 = 2.*particleMass*TMinusV+TMinusV2;
221  particlePIn = std::sqrt(particlePIn2);
222  particlePOut = std::sqrt(particlePOut2);
223 
224  // Compute the transmission probability
225  G4double theTransmissionProbability;
226  if(theNucleus->getStore()->getConfig()->getRefraction()) {
227  // Use the formula with refraction
228  initializeRefractionVariables(particle);
229 
230  if(internalReflection)
231  return 0.; // total internal reflection
232 
233  // Intermediate variables for calculation
234  const G4double x = refractionIndexRatio*cosIncidentAngle;
235  const G4double y = (x - cosRefractionAngle) / (x + cosRefractionAngle);
236 
237  theTransmissionProbability = 1. - y*y;
238  } else {
239  // Use the formula without refraction
240 
241  // Intermediate variable for calculation
242  const G4double y = particlePIn+particlePOut;
243 
244  // The transmission probability for a potential step
245  theTransmissionProbability = 4.*particlePIn*particlePOut/(y*y);
246  }
247 
248  // For neutral and negative particles, no Coulomb transmission
249  // Also, no Coulomb if the particle takes away all of the nuclear charge
250  const G4int particleZ = particle->getZ();
251  if (particleZ <= 0 || particleZ >= theZ)
252  return theTransmissionProbability;
253 
254  // Nominal Coulomb barrier
255  const G4double theTransmissionBarrier = theNucleus->getTransmissionBarrier(particle);
256  if (TMinusV >= theTransmissionBarrier) // Above the Coulomb barrier
257  return theTransmissionProbability;
258 
259  // Coulomb-penetration factor
260  const G4double px = std::sqrt(TMinusV/theTransmissionBarrier);
261  const G4double logCoulombTransmission =
262  particleZ*(theZ-particleZ)/137.03*std::sqrt(2.*particleMass/TMinusV/(1.+TMinusV/2./particleMass))
263  *(std::acos(px)-px*std::sqrt(1.-px*px));
264  INCL_DEBUG("Coulomb barrier, logCoulombTransmission=" << logCoulombTransmission << std::endl);
265  if (logCoulombTransmission > 35.) // Transmission is forbidden by Coulomb
266  return 0.;
267  theTransmissionProbability *= std::exp(-2.*logCoulombTransmission);
268 
269  return theTransmissionProbability;
270  }
G4int getA() const
Returns the baryon number.
Config const * getConfig()
Definition: G4INCLStore.hh:251
Store * getStore() const
int G4int
Definition: G4Types.hh:78
G4int getZ() const
Returns the charge number.
G4double getTransmissionBarrier(Particle const *const p)
Get the transmission barrier.
double G4double
Definition: G4Types.hh:76
#define INCL_DEBUG(x)
G4bool getRefraction() const
True if we should use refraction.
FinalState * G4INCL::SurfaceAvatar::postInteraction ( FinalState fs)
virtual

Implements G4INCL::IAvatar.

Definition at line 171 of file G4INCLSurfaceAvatar.cc.

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

171  {
172  ParticleList outgoing = fs->getOutgoingParticles();
173  if(!outgoing.empty()) { // Transmission
174 // assert(outgoing.size()==1);
175  Particle *out = outgoing.front();
176  out->rpCorrelate();
177  if(out->isCluster()) {
178  Cluster *clusterOut = dynamic_cast<Cluster*>(out);
179  ParticleList const components = clusterOut->getParticles();
180  for(ParticleIter i=components.begin(), e=components.end(); i!=e; ++i) {
181  if(!(*i)->isTargetSpectator())
182  theNucleus->getStore()->getBook().decrementCascading();
183  }
184  } else if(!theParticle->isTargetSpectator()) {
185 // assert(out==theParticle);
186  theNucleus->getStore()->getBook().decrementCascading();
187  }
188  }
189  return fs;
190  }
G4bool isTargetSpectator() const
Store * getStore() const
UnorderedVector< Particle * > ParticleList
Book & getBook()
Definition: G4INCLStore.hh:237
void decrementCascading()
Definition: G4INCLBook.hh:77
ParticleList::const_iterator ParticleIter
void G4INCL::SurfaceAvatar::preInteraction ( )
virtual

Implements G4INCL::IAvatar.

Definition at line 169 of file G4INCLSurfaceAvatar.cc.

169 {}

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