34#define INCLXX_IN_GEANT4_MODE 1
43 namespace KinematicsUtils {
46 return a+b*std::pow(x, c)+d*std::log(x)+e*std::log(x)*std::log(x);
52 if(coefficients.size() == 6){
53 Ethreshold = coefficients[5];
55 if(pLab > Ethreshold){
60 if(pLab < Ethreshold){
66 sigma =
fiveParFit(coefficients[0],coefficients[1],coefficients[2],coefficients[3],coefficients[4], pLab);
88 if(r > n->getUniverseRadius()) {
89 INCL_WARN(
"Tried to evaluate local energy for a particle outside the maximum radius."
90 <<
'\n' << p->
print() <<
'\n'
91 <<
"Maximum radius = " << n->getDensity()->getMaximumRadius() <<
'\n'
92 <<
"Universe radius = " << n->getUniverseRadius() <<
'\n');
99 if(kinE <= n->getPotential()->getFermiEnergy(t)) {
100 pfl0 = n->getPotential()->getFermiMomentum(p);
103 if(tf0<0.0)
return 0.0;
104 pfl0 = std::sqrt(tf0*(tf0 + 2.0*mass));
107 const G4double reflectionRadius = n->getDensity()->getMaxRFromP(p->
getType(), pReflection);
109 const G4double nominalReflectionRadius = n->getDensity()->getMaxRFromP(p->
getType(), pNominal);
110 const G4double pl = pfl0*n->getDensity()->getMinPFromR(t, r*nominalReflectionRadius/reflectionRadius);
111 vloc = std::sqrt(pl*pl + mass*mass) - mass;
128 INCL_ERROR(
"squareTotalEnergyInCM: beta2 == " << beta2 <<
" > 1.0" <<
'\n');
138 G4double pcm2 = (z*z-m1sq*m2sq)/(2*z+m1sq+m2sq);
140 INCL_ERROR(
"momentumInCM: pcm2 == " << pcm2 <<
" < 0.0" <<
'\n');
143 return std::sqrt(pcm2);
147 return 0.5*std::sqrt((E*E - std::pow(M1 + M2, 2))
148 *(E*E - std::pow(M1 - M2, 2)))/E;
154 G4double plab2 = (s*s-2*s*(m1sq+m2sq)+(m1sq-m2sq)*(m1sq-m2sq))/(4*m2sq);
156 INCL_ERROR(
"momentumInLab: plab2 == " << plab2 <<
" < 0.0; m1sq == " << m1sq <<
"; m2sq == " << m2sq <<
"; s == " << s <<
'\n');
159 return std::sqrt(plab2);
172 E += (*i)->getEnergy();
180 p += (*i)->getMomentum();
186 return std::sqrt(p.
mag2() + m*m);
194 return E*E - p.
mag2();
203 return (1.+EKin/mass);
G4double getEnergy() const
G4double getPotentialEnergy() const
Get the particle potential energy.
const G4INCL::ThreeVector & getPosition() const
G4double getKineticEnergy() const
Get the particle kinetic energy.
G4double getReflectionMomentum() const
Return the reflection momentum.
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
const G4INCL::ThreeVector & getMomentum() const
G4INCL::ParticleType getType() const
void setEnergy(G4double energy)
std::string print() const
G4double getMass() const
Get the cached particle mass.
G4double dot(const ThreeVector &v) const
G4double squareTotalEnergyInCM(Particle const *const p1, Particle const *const p2)
G4double invariantMass(const G4double E, const ThreeVector &p)
ThreeVector sumMomenta(const ParticleList &)
G4double fiveParFit(const G4double a, const G4double b, const G4double c, const G4double d, const G4double e, const G4double x)
G4double gammaFromKineticEnergy(const ParticleSpecies &p, const G4double EKin)
G4double squareInvariantMass(const G4double E, const ThreeVector &p)
G4double sumTotalEnergies(const ParticleList &)
G4double energy(const ThreeVector &p, const G4double m)
G4double compute_xs(const std::vector< G4double > coefficients, const G4double pLab)
ThreeVector makeBoostVector(Particle const *const p1, Particle const *const p2)
G4double totalEnergyInCM(Particle const *const p1, Particle const *const p2)
void transformToLocalEnergyFrame(Nucleus const *const n, Particle *const p)
G4double momentumInLab(Particle const *const p1, Particle const *const p2)
gives the momentum in the lab frame of two particles.
G4double momentumInCM(Particle const *const p1, Particle const *const p2)
gives the momentum in the CM frame of two particles.
G4double getLocalEnergy(Nucleus const *const n, Particle *const p)
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
G4ThreadLocal ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.
ParticleList::const_iterator ParticleIter