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

#include <G4INCLReflectionChannel.hh>

Inheritance diagram for G4INCL::ReflectionChannel:
G4INCL::IChannel

Public Member Functions

void fillFinalState (FinalState *fs)
 
FinalStategetFinalState ()
 
 ReflectionChannel (Nucleus *n, Particle *p)
 
virtual ~ReflectionChannel ()
 

Private Attributes

NucleustheNucleus
 
ParticletheParticle
 

Static Private Attributes

static const G4double positionScalingFactor = 0.99
 Scaling factor for excessively tangential reflection. More...
 
static const G4double sinMinReflectionAngleSquaredOverFour = std::pow(std::sin(2.*Math::pi/200.),2.)
 Sine^2 of the smallest acceptable reflection angle / 4. More...
 

Detailed Description

Definition at line 48 of file G4INCLReflectionChannel.hh.

Constructor & Destructor Documentation

◆ ReflectionChannel()

G4INCL::ReflectionChannel::ReflectionChannel ( Nucleus n,
Particle p 
)

◆ ~ReflectionChannel()

G4INCL::ReflectionChannel::~ReflectionChannel ( )
virtual

Definition at line 54 of file G4INCLReflectionChannel.cc.

55 {
56 }

Member Function Documentation

◆ fillFinalState()

void G4INCL::ReflectionChannel::fillFinalState ( FinalState fs)
virtual

Implements G4INCL::IChannel.

Definition at line 58 of file G4INCLReflectionChannel.cc.

58 {
59 fs->setTotalEnergyBeforeInteraction(theParticle->getEnergy() - theParticle->getPotentialEnergy());
60
61 const ThreeVector &oldMomentum = theParticle->getMomentum();
62 const ThreeVector thePosition = theParticle->getPosition();
63 G4double pspr = thePosition.dot(oldMomentum);
64 if(pspr>=0) { // This means that the particle is trying to leave; perform a reflection
65 const G4double x2cour = thePosition.mag2();
66 const ThreeVector newMomentum = oldMomentum - (thePosition * (2.0 * pspr/x2cour));
67 const G4double deltaP2 = (newMomentum-oldMomentum).mag2();
68 theParticle->setMomentum(newMomentum);
69 const G4double minDeltaP2 = sinMinReflectionAngleSquaredOverFour * newMomentum.mag2();
70 if(deltaP2 < minDeltaP2) { // Avoid extremely small reflection angles
72 INCL_DEBUG("Reflection angle for particle " << theParticle->getID() << " was too tangential: " << '\n'
73 << " " << deltaP2 << "=deltaP2<minDeltaP2=" << minDeltaP2 << '\n'
74 << " Resetting the particle position to ("
75 << thePosition.getX() << ", "
76 << thePosition.getY() << ", "
77 << thePosition.getZ() << ")" << '\n');
78 }
80 } else { // The particle momentum is already directed towards the inside of the nucleus; do nothing
81 // ...but make sure this only happened because of the frozen propagation
82// assert(theParticle->getPosition().dot(theParticle->getPropagationVelocity())>0.);
83 }
84
86 fs->addModifiedParticle(theParticle);
87 }
#define INCL_DEBUG(x)
double G4double
Definition: G4Types.hh:83
void updatePotentialEnergy(Particle *p) const
Update the particle potential energy.
G4double getEnergy() const
G4double getPotentialEnergy() const
Get the particle potential energy.
const G4INCL::ThreeVector & getPosition() const
const G4INCL::ThreeVector & getMomentum() const
virtual void setMomentum(const G4INCL::ThreeVector &momentum)
void thawPropagation()
Unfreeze particle propagation.
virtual void setPosition(const G4INCL::ThreeVector &position)
long getID() const
static const G4double sinMinReflectionAngleSquaredOverFour
Sine^2 of the smallest acceptable reflection angle / 4.
static const G4double positionScalingFactor
Scaling factor for excessively tangential reflection.
G4double dot(const ThreeVector &v) const

References G4INCL::FinalState::addModifiedParticle(), G4INCL::ThreeVector::dot(), G4INCL::Particle::getEnergy(), G4INCL::Particle::getID(), G4INCL::Particle::getMomentum(), G4INCL::Particle::getPosition(), G4INCL::Particle::getPotentialEnergy(), G4INCL::ThreeVector::getX(), G4INCL::ThreeVector::getY(), G4INCL::ThreeVector::getZ(), INCL_DEBUG, G4INCL::ThreeVector::mag2(), positionScalingFactor, G4INCL::Particle::setMomentum(), G4INCL::Particle::setPosition(), G4INCL::FinalState::setTotalEnergyBeforeInteraction(), sinMinReflectionAngleSquaredOverFour, G4INCL::Particle::thawPropagation(), theNucleus, theParticle, and G4INCL::Nucleus::updatePotentialEnergy().

◆ getFinalState()

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

Definition at line 50 of file G4INCLIChannel.cc.

50 {
51 FinalState *fs = new FinalState;
53 return fs;
54 }
virtual void fillFinalState(FinalState *fs)=0

References G4INCL::IChannel::fillFinalState().

Field Documentation

◆ positionScalingFactor

const G4double G4INCL::ReflectionChannel::positionScalingFactor = 0.99
staticprivate

Scaling factor for excessively tangential reflection.

Definition at line 67 of file G4INCLReflectionChannel.hh.

Referenced by fillFinalState().

◆ sinMinReflectionAngleSquaredOverFour

const G4double G4INCL::ReflectionChannel::sinMinReflectionAngleSquaredOverFour = std::pow(std::sin(2.*Math::pi/200.),2.)
staticprivate

Sine^2 of the smallest acceptable reflection angle / 4.

Particles impinging almost tangentially on the surface generate a large number of reflections. If the impinging angle is larger than a certain limit, we move the particle a bit towards the inside of the nucleus. The limit angle is arbitrarily chosen to correspond to 100 reflections per orbit. The position scaling factor is given by the positionScalingFactor member.

Definition at line 65 of file G4INCLReflectionChannel.hh.

Referenced by fillFinalState().

◆ theNucleus

Nucleus* G4INCL::ReflectionChannel::theNucleus
private

Definition at line 68 of file G4INCLReflectionChannel.hh.

Referenced by fillFinalState().

◆ theParticle

Particle* G4INCL::ReflectionChannel::theParticle
private

Definition at line 69 of file G4INCLReflectionChannel.hh.

Referenced by fillFinalState().


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