Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::KinematicsUtils Class Reference

#include <G4INCLKinematicsUtils.hh>

Static Public Member Functions

static void transformToLocalEnergyFrame (Nucleus const *const n, Particle *const p)
 
static G4double getLocalEnergy (Nucleus const *const n, Particle *const p)
 
static ThreeVector makeBoostVector (Particle const *const p1, Particle const *const p2)
 
static G4double totalEnergyInCM (Particle const *const p1, Particle const *const p2)
 
static G4double squareTotalEnergyInCM (Particle const *const p1, Particle const *const p2)
 
static G4double momentumInCM (Particle const *const p1, Particle const *const p2)
 gives the momentum in the CM frame of two particles.
 
static G4double momentumInCM (const G4double E, const G4double M1, const G4double M2)
 
static G4double momentumInLab (Particle const *const p1, Particle const *const p2)
 gives the momentum in the lab frame of two particles.
 
static G4double momentumInLab (const G4double s, const G4double m1, const G4double m2)
 
static G4double sumTotalEnergies (const ParticleList &)
 
static ThreeVector sumMomenta (const ParticleList &)
 
static G4double energy (const ThreeVector &p, const G4double m)
 
static G4double invariantMass (const G4double E, const ThreeVector &p)
 
static G4double gammaFromKineticEnergy (const ParticleSpecies &p, const G4double EKin)
 

Detailed Description

Definition at line 49 of file G4INCLKinematicsUtils.hh.

Member Function Documentation

◆ energy()

G4double G4INCL::KinematicsUtils::energy ( const ThreeVector p,
const G4double  m 
)
static

Definition at line 151 of file G4INCLKinematicsUtils.cc.

151 {
152 return std::sqrt(p.mag2() + m*m);
153 }

◆ gammaFromKineticEnergy()

G4double G4INCL::KinematicsUtils::gammaFromKineticEnergy ( const ParticleSpecies p,
const G4double  EKin 
)
static

Definition at line 159 of file G4INCLKinematicsUtils.cc.

159 {
160 G4double mass;
161 if(p.theType==Composite)
162 mass = ParticleTable::getTableMass(p.theA, p.theZ);
163 else
164 mass = ParticleTable::getTableParticleMass(p.theType);
165 return (1.+EKin/mass);
166 }
double G4double
Definition: G4Types.hh:64
static NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
static ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.

◆ getLocalEnergy()

G4double G4INCL::KinematicsUtils::getLocalEnergy ( Nucleus const *const  n,
Particle *const  p 
)
static

Definition at line 51 of file G4INCLKinematicsUtils.cc.

51 {
52// assert(!p->isPion()); // No local energy for pions
53
54 G4double vloc = 0.0;
55 const G4double r = p->getPosition().mag();
56 const G4double mass = p->getMass();
57
58 // Local energy is constant outside the surface
59 if(r > n->getUniverseRadius()) {
60 WARN("Tried to evaluate local energy for a particle outside the maximum radius."
61 << std::endl << p->print() << std::endl
62 << "Maximum radius = " << n->getDensity()->getMaximumRadius() << std::endl
63 << "Universe radius = " << n->getUniverseRadius() << std::endl);
64 return 0.0;
65 }
66
67 G4double pfl0 = 0.0;
68 const G4double kinE = p->getKineticEnergy();
69 if(kinE <= n->getPotential()->getFermiEnergy(p->getType())) {
70 pfl0 = n->getPotential()->getFermiMomentum(p);
71 } else {
72 const G4double tf0 = p->getPotentialEnergy() - n->getPotential()->getSeparationEnergy(p);
73 if(tf0<0.0) return 0.0;
74 pfl0 = std::sqrt(tf0*(tf0 + 2.0*mass));
75 }
76 const G4double pl = pfl0*n->getDensity()->getMaxTFromR(r);
77 vloc = std::sqrt(pl*pl + mass*mass) - mass;
78
79 return vloc;
80 }
#define WARN(x)

Referenced by transformToLocalEnergyFrame().

◆ invariantMass()

G4double G4INCL::KinematicsUtils::invariantMass ( const G4double  E,
const ThreeVector p 
)
static

Definition at line 155 of file G4INCLKinematicsUtils.cc.

155 {
156 return std::sqrt(E*E - p.mag2());
157 }

◆ makeBoostVector()

ThreeVector G4INCL::KinematicsUtils::makeBoostVector ( Particle const *const  p1,
Particle const *const  p2 
)
static

Definition at line 82 of file G4INCLKinematicsUtils.cc.

82 {
83 const G4double totalEnergy = p1->getEnergy() + p2->getEnergy();
84 return ((p1->getMomentum() + p2->getMomentum())/totalEnergy);
85 }

Referenced by G4INCL::InteractionAvatar::preInteraction(), and squareTotalEnergyInCM().

◆ momentumInCM() [1/2]

G4double G4INCL::KinematicsUtils::momentumInCM ( const G4double  E,
const G4double  M1,
const G4double  M2 
)
static

Definition at line 112 of file G4INCLKinematicsUtils.cc.

112 {
113 return 0.5*std::sqrt((E*E - std::pow(M1 + M2, 2))
114 *(E*E - std::pow(M1 - M2, 2)))/E;
115 }

◆ momentumInCM() [2/2]

G4double G4INCL::KinematicsUtils::momentumInCM ( Particle const *const  p1,
Particle const *const  p2 
)
static

gives the momentum in the CM frame of two particles.

The formula is the following:

\[ p_{CM}^2 = \frac{z^2 - m_1^2 m_2^2}{2 z + m_1^2 + m_2^2} \]

where $z$ is the scalar product of the momentum four-vectors:

\[ z = E_1 E_2 - \vec{p}_1\cdot\vec{p}_2 \]

Parameters
p1pointer to particle 1
p2pointer to particle 2
Returns
the absolute value of the momentum of any of the two particles in the CM frame, in MeV/c.

Definition at line 100 of file G4INCLKinematicsUtils.cc.

100 {
101 const G4double m1sq = std::pow(p1->getMass(),2);
102 const G4double m2sq = std::pow(p2->getMass(),2);
103 const G4double z = p1->getEnergy()*p2->getEnergy() - p1->getMomentum().dot(p2->getMomentum());
104 G4double pcm2 = (z*z-m1sq*m2sq)/(2*z+m1sq+m2sq);
105 if(pcm2 < 0.0) {
106 ERROR("KinematicsUtils::momentumInCM: pcm2 == " << pcm2 << " < 0.0" << std::endl);
107 pcm2 = 0.0;
108 }
109 return std::sqrt(pcm2);
110 }
#define ERROR(x)

Referenced by G4INCL::DeltaDecayChannel::computeDecayTime(), G4INCL::Nucleus::decayOutgoingDeltas(), G4INCL::DeltaDecayChannel::getFinalState(), G4INCL::DeltaProductionChannel::getFinalState(), and G4INCL::RecombinationChannel::getFinalState().

◆ momentumInLab() [1/2]

G4double G4INCL::KinematicsUtils::momentumInLab ( const G4double  s,
const G4double  m1,
const G4double  m2 
)
static

Definition at line 117 of file G4INCLKinematicsUtils.cc.

117 {
118 const G4double m1sq = m1*m1;
119 const G4double m2sq = m2*m2;
120 G4double plab2 = (s*s-2*s*(m1sq+m2sq)+(m1sq-m2sq)*(m1sq-m2sq))/(4*m2sq);
121 if(plab2 < 0.0) {
122 ERROR("KinematicsUtils::momentumInLab: plab2 == " << plab2 << " < 0.0; m1sq == " << m1sq << "; m2sq == " << m2sq << "; s == " << s << std::endl);
123 plab2 = 0.0;
124 }
125 return std::sqrt(plab2);
126 }

◆ momentumInLab() [2/2]

G4double G4INCL::KinematicsUtils::momentumInLab ( Particle const *const  p1,
Particle const *const  p2 
)
static

gives the momentum in the lab frame of two particles.

Assumes particle 1 carries all the momentum and particle 2 is at rest.

The formula is the following:

\[ p_{lab}^2 = \frac{s^2 - 2 s (m_1^2 + m_2^2) + {(m_1^2 - m_2^2)}^2}{4 m_2^2} \]

Parameters
p1pointer to particle 1
p2pointer to particle 2
Returns
the absolute value of the momentum of particle 1 in the lab frame, in MeV/c

Definition at line 128 of file G4INCLKinematicsUtils.cc.

128 {
129 const G4double m1 = p1->getMass();
130 const G4double m2 = p2->getMass();
131 const G4double s = squareTotalEnergyInCM(p1, p2);
132 return KinematicsUtils::momentumInLab(s, m1, m2);
133 }
static G4double squareTotalEnergyInCM(Particle const *const p1, Particle const *const p2)
static G4double momentumInLab(Particle const *const p1, Particle const *const p2)
gives the momentum in the lab frame of two particles.

Referenced by G4INCL::CrossSections::deltaProduction(), G4INCL::DeltaProductionChannel::getFinalState(), G4INCL::ElasticChannel::getFinalState(), momentumInLab(), and G4INCL::CrossSections::recombination().

◆ squareTotalEnergyInCM()

G4double G4INCL::KinematicsUtils::squareTotalEnergyInCM ( Particle const *const  p1,
Particle const *const  p2 
)
static

Definition at line 91 of file G4INCLKinematicsUtils.cc.

91 {
93 if(beta2 > 1.0) {
94 ERROR("KinematicsUtils::squareTotalEnergyInCM: beta2 == " << beta2 << " > 1.0" << std::endl);
95 beta2 = 0.0;
96 }
97 return (1.0 - beta2)*std::pow(p1->getEnergy() + p2->getEnergy(), 2);
98 }
static ThreeVector makeBoostVector(Particle const *const p1, Particle const *const p2)
G4double mag2() const

Referenced by G4INCL::StandardPropagationModel::generateBinaryCollisionAvatar(), G4INCL::BinaryCollisionAvatar::getChannel(), G4INCL::ElasticChannel::getFinalState(), momentumInLab(), G4INCL::CrossSections::recombination(), and totalEnergyInCM().

◆ sumMomenta()

ThreeVector G4INCL::KinematicsUtils::sumMomenta ( const ParticleList pl)
static

Definition at line 143 of file G4INCLKinematicsUtils.cc.

143 {
144 ThreeVector p(0.0, 0.0, 0.0);
145 for(ParticleIter i = pl.begin(); i != pl.end(); ++i) {
146 p += (*i)->getMomentum();
147 }
148 return p;
149 }
std::list< G4INCL::Particle * >::const_iterator ParticleIter

◆ sumTotalEnergies()

G4double G4INCL::KinematicsUtils::sumTotalEnergies ( const ParticleList pl)
static

Definition at line 135 of file G4INCLKinematicsUtils.cc.

135 {
136 G4double E = 0.0;
137 for(ParticleIter i = pl.begin(); i != pl.end(); ++i) {
138 E += (*i)->getEnergy();
139 }
140 return E;
141 }

◆ totalEnergyInCM()

◆ transformToLocalEnergyFrame()

void G4INCL::KinematicsUtils::transformToLocalEnergyFrame ( Nucleus const *const  n,
Particle *const  p 
)
static

Definition at line 44 of file G4INCLKinematicsUtils.cc.

44 {
45 const G4double localEnergy = KinematicsUtils::getLocalEnergy(n, p);
46 const G4double localTotalEnergy = p->getEnergy() - localEnergy;
47 p->setEnergy(localTotalEnergy);
48 p->adjustMomentumFromEnergy();
49 }
static G4double getLocalEnergy(Nucleus const *const n, Particle *const p)

Referenced by G4INCL::StandardPropagationModel::generateBinaryCollisionAvatar(), and G4INCL::InteractionAvatar::preInteractionLocalEnergy().


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