#include <G4CascadParticle.hh>
Definition at line 47 of file G4CascadParticle.hh.
G4CascadParticle::G4CascadParticle | ( | ) |
Definition at line 43 of file G4CascadParticle.cc.
References G4cout, and G4endl.
00044 : verboseLevel(0), current_zone(-1), current_path(-1.), movingIn(false), 00045 reflectionCounter(0), reflected(false), generation(-1) { 00046 if (verboseLevel > 3) { 00047 G4cout << " >>> G4CascadParticle::G4CascadParticle" << G4endl; 00048 } 00049 }
G4CascadParticle::G4CascadParticle | ( | const G4InuclElementaryParticle & | particle, | |
const G4ThreeVector & | pos, | |||
G4int | izone, | |||
G4double | cpath, | |||
G4int | gen | |||
) | [inline] |
Definition at line 53 of file G4CascadParticle.hh.
00056 : verboseLevel(0), theParticle(particle), position(pos), 00057 current_zone(izone), current_path(cpath), movingIn(true), 00058 reflectionCounter(0), reflected(false), generation(gen) {}
void G4CascadParticle::fill | ( | const G4InuclElementaryParticle & | particle, | |
const G4ThreeVector & | pos, | |||
G4int | izone, | |||
G4double | cpath, | |||
G4int | gen | |||
) |
Definition at line 53 of file G4CascadParticle.cc.
References G4cout, and G4endl.
00055 { 00056 if (verboseLevel > 3) G4cout << " >>> G4CascadParticle::fill" << G4endl; 00057 00058 theParticle = particle; 00059 position = pos; 00060 current_zone = izone; 00061 current_path = cpath; 00062 movingIn = true; 00063 reflectionCounter = 0; 00064 reflected = false; 00065 generation = gen; 00066 }
G4double G4CascadParticle::getCurrentPath | ( | ) | const [inline] |
G4int G4CascadParticle::getCurrentZone | ( | ) | const [inline] |
Definition at line 96 of file G4CascadParticle.hh.
Referenced by G4IntraNucleiCascader::decayTrappedParticle(), G4NucleiModel::generateParticleFate(), G4NucleiModel::isProjectile(), G4NucleiModel::stillInside(), and G4NucleiModel::worthToPropagate().
G4int G4CascadParticle::getGeneration | ( | ) | const [inline] |
Definition at line 68 of file G4CascadParticle.hh.
Referenced by G4IntraNucleiCascader::decayTrappedParticle().
G4LorentzVector G4CascadParticle::getMomentum | ( | ) | const [inline] |
Definition at line 71 of file G4CascadParticle.hh.
References G4InuclParticle::getMomentum().
Referenced by getPathToTheNextZone(), and propagateAlongThePath().
00071 { // Can't return ref; temporary 00072 return theParticle.getMomentum(); 00073 }
G4int G4CascadParticle::getNumberOfReflections | ( | ) | const [inline] |
G4InuclElementaryParticle& G4CascadParticle::getParticle | ( | ) | [inline] |
const G4InuclElementaryParticle& G4CascadParticle::getParticle | ( | ) | const [inline] |
Definition at line 65 of file G4CascadParticle.hh.
Referenced by G4CollisionOutput::addOutgoingParticle(), G4IntraNucleiCascader::decayTrappedParticle(), G4NucleiModel::generateParticleFate(), G4ParticleLargerEkin::operator()(), G4ParticleLargerBeta::operator()(), G4IntraNucleiCascader::processSecondary(), G4IntraNucleiCascader::processTrappedParticle(), and G4NucleiModel::worthToPropagate().
Definition at line 69 of file G4CascadParticle.cc.
References G4cout, G4endl, getMomentum(), and G4InuclParticleNames::pp.
00070 { 00071 if (verboseLevel > 3) { 00072 G4cout << " >>> G4CascadParticle::getPathToTheNextZone rz_in " << rz_in 00073 << " rz_out " << rz_out << G4endl; 00074 } 00075 00076 const G4LorentzVector& mom = getMomentum(); 00077 00078 G4double path = -1.0; 00079 G4double rp = mom.vect().dot(position); 00080 G4double rr = position.mag2(); 00081 G4double pp = mom.vect().mag2(); 00082 00083 if (std::abs(pp) < 1e-9) { // Cut-off for "at rest" is 1 eV momentum 00084 if (verboseLevel > 3) G4cout << " at rest; path length is zero" << G4endl; 00085 return 0.; 00086 } 00087 00088 G4double ra = rr - rp * rp / pp; 00089 pp = std::sqrt(pp); 00090 G4double ds; 00091 G4double d2; 00092 00093 if (verboseLevel > 3) { 00094 G4cout << " current_zone " << current_zone << " rr " << rr 00095 << " rp " << rp << " pp " << pp << " ra " << ra << G4endl; 00096 } 00097 00098 if (current_zone == 0 || rp > 0.0) { 00099 d2 = rz_out * rz_out - ra; 00100 if (d2 > 0.0) { 00101 ds = 1.0; 00102 movingIn = false; 00103 } else { 00104 d2 = rz_in * rz_in - ra; 00105 ds = -1.0; 00106 movingIn = true; 00107 } 00108 } else { 00109 d2 = rz_in * rz_in - ra; 00110 if (d2 > 0.0) { 00111 ds = -1.0; 00112 movingIn = true; 00113 } else { 00114 d2 = rz_out * rz_out - ra; 00115 ds = 1.0; 00116 movingIn = false; 00117 } 00118 } 00119 00120 if (verboseLevel > 3) G4cout << " ds " << ds << " d2 " << d2 << G4endl; 00121 00122 if (d2 < 0.0 && d2 > -1e-6) d2 = 0.; // Account for round-off 00123 00124 if (d2 > 0.0) path = ds * std::sqrt(d2) - rp / pp; // Avoid FPE failure 00125 00126 return path; 00127 }
const G4ThreeVector& G4CascadParticle::getPosition | ( | ) | const [inline] |
Definition at line 79 of file G4CascadParticle.hh.
Referenced by G4IntraNucleiCascader::decayTrappedParticle(), and G4NucleiModel::generateParticleFate().
00079 { return position; }
void G4CascadParticle::incrementCurrentPath | ( | G4double | npath | ) | [inline] |
Definition at line 92 of file G4CascadParticle.hh.
Referenced by G4NucleiModel::generateParticleFate().
void G4CascadParticle::incrementReflectionCounter | ( | ) | [inline] |
void G4CascadParticle::initializePath | ( | G4double | npath | ) | [inline] |
Definition at line 91 of file G4CascadParticle.hh.
Referenced by G4IntraNucleiCascader::processSecondary().
G4bool G4CascadParticle::movingInsideNuclei | ( | ) | const [inline] |
void G4CascadParticle::print | ( | std::ostream & | os | ) | const |
Definition at line 145 of file G4CascadParticle.cc.
References G4endl.
Referenced by operator<<().
00145 { 00146 os << theParticle << G4endl 00147 << " zone " << current_zone << " current_path " << current_path 00148 << " reflectionCounter " << reflectionCounter << G4endl 00149 << " x " << position.x() << " y " << position.y() 00150 << " z " << position.z() << G4endl; 00151 }
void G4CascadParticle::propagateAlongThePath | ( | G4double | path | ) |
Definition at line 129 of file G4CascadParticle.cc.
References G4cout, G4endl, and getMomentum().
Referenced by G4NucleiModel::generateParticleFate().
00129 { 00130 if (verboseLevel > 3) { 00131 G4cout << " >>> G4CascadParticle::propagateAlongThePath" << G4endl; 00132 } 00133 00134 position += getMomentum().vect().unit()*path; 00135 }
G4bool G4CascadParticle::reflectedNow | ( | ) | const [inline] |
void G4CascadParticle::resetReflection | ( | ) | [inline] |
void G4CascadParticle::setGeneration | ( | G4int | gen | ) | [inline] |
Definition at line 69 of file G4CascadParticle.hh.
Referenced by G4IntraNucleiCascader::processSecondary().
void G4CascadParticle::setMovingInsideNuclei | ( | G4bool | isMovingIn = true |
) | [inline] |
Definition at line 98 of file G4CascadParticle.hh.
Referenced by G4IntraNucleiCascader::processSecondary().
void G4CascadParticle::updateParticleMomentum | ( | const G4LorentzVector & | mom | ) | [inline] |
Definition at line 75 of file G4CascadParticle.hh.
References G4InuclParticle::setMomentum().
00075 { 00076 theParticle.setMomentum(mom); 00077 }
void G4CascadParticle::updatePosition | ( | const G4ThreeVector & | pos | ) | [inline] |
Definition at line 80 of file G4CascadParticle.hh.
Referenced by G4NucleiModel::generateParticleFate(), and G4IntraNucleiCascader::processSecondary().
00080 { position = pos; }
void G4CascadParticle::updateZone | ( | G4int | izone | ) | [inline] |
Definition at line 95 of file G4CascadParticle.hh.
Referenced by G4IntraNucleiCascader::processSecondary().