#include <G4INCLThreeVector.hh>
Public Member Functions | |
ThreeVector () | |
ThreeVector (G4double ax, G4double ay, G4double az) | |
G4double | getX () const |
G4double | getY () const |
G4double | getZ () const |
G4double | perp () const |
G4double | perp2 () const |
G4double | mag () const |
G4double | mag2 () const |
G4double | theta () const |
G4double | phi () const |
G4double | dot (const ThreeVector &v) const |
ThreeVector | vector (const ThreeVector &v) const |
void | setX (G4double ax) |
Set the x coordinate. | |
void | setY (G4double ay) |
Set the y coordinate. | |
void | setZ (G4double az) |
Set the z coordinate. | |
void | operator+= (const ThreeVector &v) |
ThreeVector | operator- () const |
Unary minus operator. | |
void | operator-= (const ThreeVector &v) |
template<typename T> | |
void | operator *= (const T c) |
template<typename T> | |
void | operator/= (const T c) |
ThreeVector | operator- (const ThreeVector &v) const |
ThreeVector | operator+ (const ThreeVector &v) const |
ThreeVector | operator/ (const G4double C) const |
ThreeVector | operator * (const G4double C) const |
void | rotate (const G4double angle, const ThreeVector &axis) |
Rotate the vector by a given angle around a given axis. | |
std::string | print () const |
std::string | dump () const |
Definition at line 53 of file G4INCLThreeVector.hh.
G4INCL::ThreeVector::ThreeVector | ( | ) | [inline] |
Definition at line 55 of file G4INCLThreeVector.hh.
Referenced by operator *(), operator+(), operator-(), operator/(), and vector().
G4double G4INCL::ThreeVector::dot | ( | const ThreeVector & | v | ) | const [inline] |
Dot product.
Definition at line 96 of file G4INCLThreeVector.hh.
Referenced by G4INCL::Particle::boost(), G4INCL::ClusteringModelIntercomparison::clusterCanEscape(), G4INCL::BinaryCollisionAvatar::getChannel(), G4INCL::ClusteringModelIntercomparison::getCluster(), G4INCL::ReflectionChannel::getFinalState(), G4INCL::Particle::getInvariantMass(), G4INCL::Particle::getLongitudinalPosition(), G4INCL::StandardPropagationModel::getTime(), G4INCL::Particle::lorentzContract(), G4INCL::KinematicsUtils::momentumInCM(), and rotate().
std::string G4INCL::ThreeVector::dump | ( | ) | const [inline] |
Definition at line 188 of file G4INCLThreeVector.hh.
Referenced by G4INCL::Particle::dump().
00188 { 00189 std::stringstream ss; 00190 ss <<"(vector3 " << x << " " << y << " " << z << ")"; 00191 return ss.str(); 00192 }
G4double G4INCL::ThreeVector::getX | ( | ) | const [inline] |
Definition at line 63 of file G4INCLThreeVector.hh.
Referenced by G4INCL::Cluster::boost(), G4INCL::Nucleus::fillEventInfo(), G4INCL::ReflectionChannel::getFinalState(), G4INCL::ElasticChannel::getFinalState(), G4INCL::DeltaProductionChannel::getFinalState(), and G4INCL::DeltaDecayChannel::getFinalState().
G4double G4INCL::ThreeVector::getY | ( | ) | const [inline] |
Definition at line 64 of file G4INCLThreeVector.hh.
Referenced by G4INCL::Cluster::boost(), G4INCL::Nucleus::fillEventInfo(), G4INCL::ReflectionChannel::getFinalState(), G4INCL::ElasticChannel::getFinalState(), G4INCL::DeltaProductionChannel::getFinalState(), and G4INCL::DeltaDecayChannel::getFinalState().
G4double G4INCL::ThreeVector::getZ | ( | ) | const [inline] |
Definition at line 65 of file G4INCLThreeVector.hh.
Referenced by G4INCL::ProjectileRemnant::addMostDynamicalSpectators(), G4INCL::Cluster::boost(), G4INCL::Nucleus::fillEventInfo(), G4INCL::ReflectionChannel::getFinalState(), G4INCL::ElasticChannel::getFinalState(), G4INCL::DeltaProductionChannel::getFinalState(), and G4INCL::DeltaDecayChannel::getFinalState().
G4double G4INCL::ThreeVector::mag | ( | ) | const [inline] |
Get the length of the vector.
Definition at line 72 of file G4INCLThreeVector.hh.
Referenced by G4INCL::InteractionAvatar::bringParticleInside(), G4INCL::Nucleus::decayOutgoingDeltas(), G4INCL::CoulombNonRelativistic::distortOut(), G4INCL::Nucleus::fillEventInfo(), G4INCL::StandardPropagationModel::generateBinaryCollisionAvatar(), G4INCL::Particle::getBeta(), G4INCL::PauliStandard::getBlockingProbability(), G4INCL::ClusteringModelIntercomparison::getCluster(), G4INCL::DeltaProductionChannel::getFinalState(), G4INCL::DeltaDecayChannel::getFinalState(), G4INCL::KinematicsUtils::getLocalEnergy(), G4INCL::Nucleus::getSurfaceRadius(), G4INCL::StandardPropagationModel::shootComposite(), and G4INCL::StandardPropagationModel::shootParticle().
G4double G4INCL::ThreeVector::mag2 | ( | ) | const [inline] |
Get the square of the length.
Definition at line 77 of file G4INCLThreeVector.hh.
Referenced by G4INCL::ProjectileRemnant::addMostDynamicalSpectators(), G4INCL::Particle::adjustEnergyFromMomentum(), G4INCL::Particle::adjustMomentumFromEnergy(), G4INCL::Particle::boost(), G4INCL::InteractionAvatar::bringParticleInside(), G4INCL::ClusteringModelIntercomparison::clusterCanEscape(), G4INCL::KinematicsUtils::energy(), G4INCL::Cluster::freezeInternalMotion(), G4INCL::PauliStandard::getBlockingProbability(), G4INCL::BinaryCollisionAvatar::getChannel(), G4INCL::ReflectionChannel::getFinalState(), G4INCL::PionNucleonChannel::getFinalState(), G4INCL::ElasticChannel::getFinalState(), G4INCL::Particle::getLongitudinalPosition(), G4INCL::StandardPropagationModel::getTime(), G4INCL::KinematicsUtils::invariantMass(), G4INCL::Particle::lorentzContract(), G4INCL::Particle::Particle(), G4INCL::Cluster::putParticlesOffShell(), G4INCL::KinematicsUtils::squareTotalEnergyInCM(), and G4INCL::Nucleus::useFusionKinematics().
ThreeVector G4INCL::ThreeVector::operator * | ( | const G4double | C | ) | const [inline] |
Definition at line 166 of file G4INCLThreeVector.hh.
References ThreeVector().
00166 { 00167 return ThreeVector(x*C, y*C, z*C); 00168 }
void G4INCL::ThreeVector::operator *= | ( | const T | c | ) | [inline] |
ThreeVector G4INCL::ThreeVector::operator+ | ( | const ThreeVector & | v | ) | const [inline] |
Definition at line 155 of file G4INCLThreeVector.hh.
References ThreeVector(), x, y, and z.
00155 { 00156 return ThreeVector(x+v.x, y+v.y, z+v.z); 00157 }
void G4INCL::ThreeVector::operator+= | ( | const ThreeVector & | v | ) | [inline] |
ThreeVector G4INCL::ThreeVector::operator- | ( | const ThreeVector & | v | ) | const [inline] |
Definition at line 151 of file G4INCLThreeVector.hh.
References ThreeVector(), x, y, and z.
00151 { 00152 return ThreeVector(x-v.x, y-v.y, z-v.z); 00153 }
ThreeVector G4INCL::ThreeVector::operator- | ( | ) | const [inline] |
Unary minus operator.
Definition at line 127 of file G4INCLThreeVector.hh.
References ThreeVector().
00127 { 00128 return ThreeVector(-x,-y,-z); 00129 }
void G4INCL::ThreeVector::operator-= | ( | const ThreeVector & | v | ) | [inline] |
ThreeVector G4INCL::ThreeVector::operator/ | ( | const G4double | C | ) | const [inline] |
Divides all components of the vector with a constant number.
Definition at line 162 of file G4INCLThreeVector.hh.
References ThreeVector().
00162 { 00163 return ThreeVector(x/C, y/C, z/C); 00164 }
void G4INCL::ThreeVector::operator/= | ( | const T | c | ) | [inline] |
G4double G4INCL::ThreeVector::perp | ( | ) | const [inline] |
Definition at line 67 of file G4INCLThreeVector.hh.
Referenced by G4INCL::DeltaDecayChannel::getFinalState(), and theta().
G4double G4INCL::ThreeVector::perp2 | ( | ) | const [inline] |
Definition at line 68 of file G4INCLThreeVector.hh.
Referenced by G4INCL::ElasticChannel::getFinalState(), and G4INCL::DeltaProductionChannel::getFinalState().
G4double G4INCL::ThreeVector::phi | ( | ) | const [inline] |
Phi angle
Definition at line 89 of file G4INCLThreeVector.hh.
Referenced by G4INCL::Nucleus::fillEventInfo().
std::string G4INCL::ThreeVector::print | ( | ) | const [inline] |
Definition at line 182 of file G4INCLThreeVector.hh.
Referenced by G4INCL::Particle::print(), and G4INCL::Cluster::print().
00182 { 00183 std::stringstream ss; 00184 ss <<"(x = " << x << " y = " << y << " z = " << z <<")"; 00185 return ss.str(); 00186 }
void G4INCL::ThreeVector::rotate | ( | const G4double | angle, | |
const ThreeVector & | axis | |||
) | [inline] |
Rotate the vector by a given angle around a given axis.
angle | the rotation angle | |
axis | the rotation axis, which must be a unit vector |
Definition at line 175 of file G4INCLThreeVector.hh.
References dot(), and vector().
Referenced by G4INCL::Particle::rotate().
00175 { 00176 // Use Rodrigues' formula 00177 const G4double cos = std::cos(angle); 00178 const G4double sin = std::sin(angle); 00179 (*this) = (*this) * cos + axis.vector(*this) * sin + axis * (axis.dot(*this)*(1.-cos)); 00180 }
void G4INCL::ThreeVector::setX | ( | G4double | ax | ) | [inline] |
Set the x coordinate.
Definition at line 112 of file G4INCLThreeVector.hh.
Referenced by G4INCL::Cluster::internalBoostToCM().
void G4INCL::ThreeVector::setY | ( | G4double | ay | ) | [inline] |
Set the y coordinate.
Definition at line 115 of file G4INCLThreeVector.hh.
Referenced by G4INCL::Cluster::internalBoostToCM().
void G4INCL::ThreeVector::setZ | ( | G4double | az | ) | [inline] |
Set the z coordinate.
Definition at line 118 of file G4INCLThreeVector.hh.
Referenced by G4INCL::Cluster::internalBoostToCM().
G4double G4INCL::ThreeVector::theta | ( | ) | const [inline] |
Theta angle
Definition at line 82 of file G4INCLThreeVector.hh.
References perp().
Referenced by G4INCL::Nucleus::fillEventInfo().
00082 { 00083 return x == 0.0 && y == 0.0 && z == 0.0 ? 0.0 : std::atan2(perp(),z); 00084 }
ThreeVector G4INCL::ThreeVector::vector | ( | const ThreeVector & | v | ) | const [inline] |
Vector product.
Definition at line 103 of file G4INCLThreeVector.hh.
References ThreeVector(), x, y, and z.
Referenced by G4INCL::Particle::getAngularMomentum(), and rotate().
00103 { 00104 return ThreeVector( 00105 y*v.z - z*v.y, 00106 z*v.x - x*v.z, 00107 x*v.y - y*v.x 00108 ); 00109 }