Geant4-11
Functions
G4INCL::KinematicsUtils Namespace Reference

Functions

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

Function Documentation

◆ energy()

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

Definition at line 158 of file G4INCLKinematicsUtils.cc.

158 {
159 return std::sqrt(p.mag2() + m*m);
160 }
static constexpr double m
Definition: G4SIunits.hh:109
G4double mag2() const

References m, and G4INCL::ThreeVector::mag2().

Referenced by G4PenelopeCrossSection::AddCrossSectionPoint(), G4WaterStopping::AddData(), G4PenelopeCrossSection::AddShellCrossSectionPoint(), G4ForwardXrayTR::AngleDensity(), G4ForwardXrayTR::AngleInterval(), G4VXTRenergyLoss::AngleSpectralXTRdEdx(), G4ANuElNucleusCcModel::ApplyYourself(), G4ANuElNucleusNcModel::ApplyYourself(), G4ANuMuNucleusCcModel::ApplyYourself(), G4ANuMuNucleusNcModel::ApplyYourself(), G4NeutrinoElectronCcModel::ApplyYourself(), G4NuElNucleusCcModel::ApplyYourself(), G4NuElNucleusNcModel::ApplyYourself(), G4NuMuNucleusCcModel::ApplyYourself(), G4NuMuNucleusNcModel::ApplyYourself(), G4AugerTransition::AugerTransitionEnergy(), G4eIonisationSpectrum::AverageEnergy(), G4ShellVacancy::AverageNOfIonisations(), RunAction::BeginOfRunAction(), G4DecayProducts::Boost(), G4VXTRenergyLoss::BuildAngleTable(), G4PolarizedCompton::BuildAsymmetryTable(), G4PolarizedAnnihilation::BuildAsymmetryTables(), G4KokoulinMuonNuclearXS::BuildCrossSectionTable(), G4PenelopeIonisationXSHandler::BuildDeltaTable(), G4VCrossSectionHandler::BuildMeanFreePathForMaterials(), G4LossTableBuilder::BuildRangeTable(), G4IonParametrisedLossModel::BuildRangeVector(), G4hRDEnergyLoss::BuildRangeVector(), G4PenelopeIonisationXSHandler::BuildXSTable(), G4PenelopeBremsstrahlungModel::BuildXSTable(), G4GDecay3::CalculateMomentumMagnitudes(), G4NeutrinoNucleusModel::CalculateQEratioA(), G4PenelopeRayleighModelMI::CalculateQSquared(), G4OpRayleigh::CalculateRayleighMeanFreePaths(), G4BinaryCascade::Capture(), G4Fancy3DNucleus::ChooseFermiMomenta(), G4IonChuFluctuationModel::ChuFluctuationModel(), G4PolarizedAnnihilation::ComputeAsymmetry(), G4PolarizedIonisation::ComputeAsymmetry(), G4PolarizedCompton::ComputeAsymmetry(), G4AnnihiToMuPair::ComputeCrossSectionPerAtom(), G4LivermorePhotoElectricModel::ComputeCrossSectionPerAtom(), G4PEEffectFluoModel::ComputeCrossSectionPerAtom(), G4LivermoreIonisationModel::ComputeCrossSectionPerAtom(), G4PenelopeAnnihilationModel::ComputeCrossSectionPerAtom(), G4PenelopeGammaConversionModel::ComputeCrossSectionPerAtom(), G4PenelopePhotoElectricModel::ComputeCrossSectionPerAtom(), G4PenelopeRayleighModel::ComputeCrossSectionPerAtom(), G4PenelopeRayleighModelMI::ComputeCrossSectionPerAtom(), G4IonParametrisedLossModel::ComputeCrossSectionPerAtom(), G4BraggIonModel::ComputeCrossSectionPerElectron(), G4BraggModel::ComputeCrossSectionPerElectron(), G4ICRU73QOModel::ComputeCrossSectionPerElectron(), G4eeToHadronsModel::ComputeCrossSectionPerElectron(), G4eeToHadronsMultiModel::ComputeCrossSectionPerElectron(), G4PenelopeAnnihilationModel::ComputeCrossSectionPerElectron(), G4IonParametrisedLossModel::ComputeLossForStep(), G4PolarizedIonisation::ComputeSaturationFactor(), G4PenelopeIonisationXSHandler::ComputeShellCrossSectionsElectron(), G4PenelopeIonisationXSHandler::ComputeShellCrossSectionsPositron(), G4RToEConvForGamma::ComputeValue(), G4IonParametrisedLossModel::CorrectionsAlongStep(), G4ParticleHPThermalScattering::create_E_isoAng_from_energy(), G4VPhononProcess::CreateSecondary(), G4DNAChemistryManager::CreateWaterMolecule(), G4PhysChemIO::FormattedText::CreateWaterMolecule(), G4PhysChemIO::G4Analysis::CreateWaterMolecule(), G4LivermorePhotoElectricModel::CrossSectionPerVolume(), G4PEEffectFluoModel::CrossSectionPerVolume(), G4PenelopeRayleighModelMI::CrossSectionPerVolume(), G4PenelopeComptonModel::CrossSectionPerVolume(), G4PenelopeBremsstrahlungModel::CrossSectionPerVolume(), G4PenelopeIonisationModel::CrossSectionPerVolume(), G4AnnihiToMuPair::CrossSectionPerVolume(), G4XDeltaDeltaTable::CrossSectionTable(), G4XNDeltaTable::CrossSectionTable(), G4XDeltaDeltastarTable::CrossSectionTable(), G4XDeltaNstarTable::CrossSectionTable(), G4XNDeltastarTable::CrossSectionTable(), G4XNNstarTable::CrossSectionTable(), G4VEmProcess::CurrentSetup(), G4MuonDecayChannelWithSpin::DecayIt(), G4PenelopeComptonModel::DifferentialCrossSection(), G4IonFluctuations::Factor(), G4PhysicsVector::FindBin(), G4PixeShellDataSet::FindValue(), G4ShellEMDataSet::FindValue(), G4EMDataSet::FindValue(), G4CompositeDataSet::FindValue(), G4DataSet::FindValue(), G4VCrossSectionHandler::FindValue(), G4PixeCrossSectionHandler::FindValue(), DNA::Penetration::Terrisol1990::Get3DStdDeviation(), G4ParticleHPFFFissionFS::GetAFissionFragment(), G4VXTRenergyLoss::GetAngleVector(), G4ElNeutrinoNucleusTotXsc::GetANuElTotCsXsc(), G4MuNeutrinoNucleusTotXsc::GetANuMuTotCsXsc(), G4INCL::ClusteringModelIntercomparison::getCluster(), G4eIonisationCrossSectionHandler::GetCrossSectionAboveThresholdForElement(), G4HadronicProcessStore::GetCrossSectionPerAtom(), G4HadronicProcessStore::GetCrossSectionPerVolume(), G4PenelopeIonisationXSHandler::GetDensityCorrection(), G4DNARelativisticIonisationModel::GetEjectedElectronDirection(), G4DNARelativisticIonisationModel::GetEjectedElectronEnergy(), G4ESTARStopping::GetElectronicDEDX(), G4ASTARStopping::GetElectronicDEDX(), G4PSTARStopping::GetElectronicDEDX(), G4WaterStopping::GetElectronicDEDX(), G4PAIxSection::GetElectronRange(), G4NeutrinoElectronCcXsc::GetElementCrossSection(), G4NeutrinoElectronNcXsc::GetElementCrossSection(), G4ElNeutrinoNucleusTotXsc::GetEnergyIndex(), G4MuNeutrinoNucleusTotXsc::GetEnergyIndex(), G4NeutrinoNucleusModel::GetEnergyIndex(), G4PhotonEvaporation::GetFinalLevelEnergy(), G4ParticleHPChannel::GetFSCrossSection(), GIDI_settings_group::getGroupIndexFromEnergy(), G4PenelopeCrossSection::GetHardCrossSection(), G4MuNeutrinoNucleusTotXsc::GetIsoCrossSection(), G4ElNeutrinoNucleusTotXsc::GetIsoCrossSection(), G4NuclearLevelData::GetLevelEnergy(), G4NuclearLevelData::GetLowEdgeLevelEnergy(), G4AnnihiToMuPair::GetMeanFreePath(), G4PenelopeCrossSection::GetNormalizedShellCrossSection(), G4ElNeutrinoNucleusTotXsc::GetNuElTotCsXsc(), G4NeutrinoNucleusModel::GetNuMuOnePionProb(), G4NeutrinoNucleusModel::GetNuMuQeTotRat(), G4MuNeutrinoNucleusTotXsc::GetNuMuTotCsXsc(), G4NeutrinoNucleusModel::GetOnePionIndex(), DNA::Penetration::Terrisol1990::GetPenetration(), G4PenelopeRayleighModel::GetPMaxTable(), G4PenelopeRayleighModelMI::GetPMaxTable(), G4PenelopeBremsstrahlungModel::GetPositronXSCorrection(), G4ParticleHPFissionERelease::GetPromptNeutronKinetic(), DNA::Penetration::Terrisol1990::GetRmean(), G4SandiaTable::GetSandiaCofForMaterial(), G4SandiaTable::GetSandiaCofPerAtom(), G4SandiaTable::GetSandiaCofWater(), G4PenelopePhotoElectricModel::GetShellCrossSection(), G4PenelopeCrossSection::GetShellCrossSection(), G4PenelopeCrossSection::GetSoftStoppingPower(), G4VXTRenergyLoss::GetStackFactor(), G4GammaXTRadiator::GetStackFactor(), G4GaussXTRadiator::GetStackFactor(), G4RegularXTRadiator::GetStackFactor(), G4StrawTubeXTRadiator::GetStackFactor(), G4TransparentRegXTRadiator::GetStackFactor(), G4XTRGammaRadModel::GetStackFactor(), G4XTRRegularRadModel::GetStackFactor(), G4XTRTransparentRegRadModel::GetStackFactor(), G4AtomicShells::GetTotalBindingEnergy(), G4AtomicShells_XDB_EADL::GetTotalBindingEnergy(), G4PenelopeCrossSection::GetTotalCrossSection(), G4VarNtp::getTotalEnergy(), G4ParticleHPFissionERelease::GetTotalEnergy(), G4ParticleHPChannel::GetWeightedXsec(), G4ParticleHPChannel::GetXsec(), G4ParticleHPIsoData::GetXsec(), G4ParticleHPElasticFS::Init(), G4ParticleHPAngular::Init(), G4ParticleHPDiscreteTwoBody::Init(), G4DNABornExcitationModel2::Initialise(), G4PhysicsFreeVector::InsertValues(), G4TransitionRadiation::IntegralOverAngle(), G4NeutrinoElectronNcModel::IsApplicable(), G4NeutronElectronElModel::IsApplicable(), G4ANuElNucleusCcModel::IsApplicable(), G4ANuElNucleusNcModel::IsApplicable(), G4ANuMuNucleusCcModel::IsApplicable(), G4ANuMuNucleusNcModel::IsApplicable(), G4NeutrinoElectronCcModel::IsApplicable(), G4NeutrinoNucleusModel::IsApplicable(), G4NuElNucleusCcModel::IsApplicable(), G4NuElNucleusNcModel::IsApplicable(), G4NuMuNucleusCcModel::IsApplicable(), G4NuMuNucleusNcModel::IsApplicable(), G4DecayProducts::IsChecked(), G4NeutrinoElectronCcXsc::IsElementApplicable(), G4NeutrinoElectronNcXsc::IsElementApplicable(), G4PenelopeComptonModel::KleinNishinaCrossSection(), G4eIonisationParameters::LoadData(), G4ParticleHPMadlandNixSpectrum::Madland(), G4BaryonPartialWidth::MassDependentWidth(), G4BaryonWidth::MassDependentWidth(), MCGIDI_energy_free(), MCGIDI_energy_initialize(), MCGIDI_energy_new(), MCGIDI_energy_parseEvaporationFromTOM(), MCGIDI_energy_parseFromTOM(), MCGIDI_energy_parseGeneralEvaporationFromTOM(), MCGIDI_energy_parseMadlandNixFromTOM(), MCGIDI_energy_parseNBodyPhaseSpaceFromTOM(), MCGIDI_energy_parseSimpleMaxwellianFissionFromTOM(), MCGIDI_energy_parseWattFromTOM(), MCGIDI_energy_parseWeightedFunctionalsFromTOM(), MCGIDI_energy_parseWeightFromTOM(), MCGIDI_energy_release(), MCGIDI_energy_sampleEnergy(), MCGIDI_energy_sampleWeightedFunctional(), G4hImpactIonisation::MicroscopicCrossSection(), G4PixeCrossSectionHandler::MicroscopicCrossSection(), G4LevelManager::NearestLevel(), G4LevelManager::NearestLevelEnergy(), G4LevelManager::NearestLevelIndex(), G4LevelManager::NearestLowEdgeLevelEnergy(), G4LevelManager::NearestLowEdgeLevelIndex(), G4ICRU49NuclearStoppingModel::NuclearStoppingPower(), G4hICRU49Nuclear::NuclearStoppingPower(), G4hZiegler1985Nuclear::NuclearStoppingPower(), G4VXTRenergyLoss::OneBoundaryXTRNdensity(), G4VXTRenergyLoss::OneInterfaceXTRdEdx(), G4PenelopeComptonModel::OscillatorTotalCrossSection(), G4INCL::Particle::Particle(), G4KL3DecayChannel::PhaseSpace(), G4GammaGeneralProcess::PostStepGetPhysicalInteractionLength(), G4IonDEDXHandler::PrintDEDXTable(), G4IonParametrisedLossModel::PrintDEDXTable(), G4eIonisationSpectrum::Probability(), G4INCL::ProjectileRemnant::ProjectileRemnant(), G4INCL::Cluster::putParticlesOffShell(), G4AdjointBremsstrahlungModel::RapidSampleSecondaries(), G4ParticleHPThermalScattering::readAnE_isoAng(), G4ParticleHPThermalScattering::readAnE_P_E_isoAng(), G4PenelopePhotoElectricModel::ReadDataFile(), G4ParticleHPNBodyPhaseSpace::Sample(), G4ParticleHPLegendreStore::Sample(), G4NeutrinoElectronCcModel::SampleCosCMS(), G4SauterGavrilaAngularDistribution::SampleDirection(), G4Generator2BS::SampleDirection(), G4PenelopePhotoElectricModel::SampleElectronDirection(), G4NeutrinoElectronNcModel::SampleElectronTkin(), G4eIonisationSpectrum::SampleEnergy(), G4PenelopeBremsstrahlungFS::SampleGammaEnergy(), G4AntiNuclElastic::SampleInvariantT(), G4NeutrinoNucleusModel::SampleQkr(), G4PolarizedIonisationModel::SampleSecondaries(), G4BraggIonModel::SampleSecondaries(), G4BraggModel::SampleSecondaries(), G4ICRU73QOModel::SampleSecondaries(), G4KleinNishinaModel::SampleSecondaries(), G4MollerBhabhaModel::SampleSecondaries(), G4PEEffectFluoModel::SampleSecondaries(), G4eeToHadronsMultiModel::SampleSecondaries(), G4IonParametrisedLossModel::SampleSecondaries(), G4GammaTransition::SampleTransition(), G4NeutrinoNucleusModel::SampleXkr(), G4INCL::InteractionAvatar::ViolationEMomentumFunctor::scaleParticleMomenta(), G4PenelopePhotoElectricModel::SelectRandomShell(), G4ContinuousGainOfEnergy::SetDynamicMassCharge(), G4VXTRenergyLoss::SetEnergy(), G4INCL::Particle::setEnergy(), G4ParticleHPAngularP::SetEnergy(), G4ParticleHPLegendreTable::SetEnergy(), G4ParticleHPLegendreStore::SetEnergy(), G4INCL::Particle::setFrozenEnergy(), G4hImpactIonisation::SetHighEnergyForAntiProtonParametrisation(), G4hImpactIonisation::SetHighEnergyForProtonParametrisation(), G4hImpactIonisation::SetLowEnergyForAntiProtonParametrisation(), G4hImpactIonisation::SetLowEnergyForProtonParametrisation(), G4hImpactIonisation::SetPixeProjectileMaxEnergy(), G4hImpactIonisation::SetPixeProjectileMinEnergy(), G4ParticleChangeForGamma::SetProposedKineticEnergy(), G4ParticleChangeForLoss::SetProposedKineticEnergy(), G4AtimaEnergyLossModel::sezi_p_se(), G4INCL::StandardPropagationModel::shootParticle(), G4ForwardXrayTR::SpectralAngleTRdensity(), G4ForwardXrayTR::SpectralDensity(), G4VXTRenergyLoss::SpectralXTRdEdx(), G4GaussXTRadiator::SpectralXTRdEdx(), G4RegularXTRadiator::SpectralXTRdEdx(), G4TransparentRegXTRadiator::SpectralXTRdEdx(), G4XTRRegularRadModel::SpectralXTRdEdx(), G4XTRTransparentRegRadModel::SpectralXTRdEdx(), G4AugerData::StartShellEnergy(), G4hBetheBlochModel::TheValue(), G4hIonEffChargeSquare::TheValue(), G4hNuclearStoppingModel::TheValue(), G4IonChuFluctuationModel::TheValue(), G4IonYangFluctuationModel::TheValue(), G4QAOLowEnergyLoss::TheValue(), G4PhaseSpaceDecayChannel::ThreeBodyDecayIt(), G4GeneralPhaseSpaceDecay::ThreeBodyDecayIt(), G4AblaInterface::toG4Particle(), G4INCLXXInterface::toG4Particle(), G4ParticleChange::UpdateStepForAlongStep(), G4ParticleChangeForTransport::UpdateStepForAlongStep(), G4VCrossSectionHandler::ValueForMaterial(), G4PixeCrossSectionHandler::ValueForMaterial(), G4ParticleHPWattSpectrum::Watt(), G4VXTRenergyLoss::XTRNAngleSpectralDensity(), G4VXTRenergyLoss::XTRNSpectralDensity(), and G4IonYangFluctuationModel::YangFluctuationModel().

◆ gammaFromKineticEnergy()

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

Definition at line 170 of file G4INCLKinematicsUtils.cc.

170 {
171 G4double mass;
172 if(p.theType==Composite)
174 else
176 return (1.+EKin/mass);
177 }
double G4double
Definition: G4Types.hh:83
G4ThreadLocal NuclearMassFn getTableMass
Static pointer to the mass function for nuclei.
G4ThreadLocal ParticleMassFn getTableParticleMass
Static pointer to the mass function for particles.

References G4INCL::Composite, G4INCL::ParticleTable::getTableMass, G4INCL::ParticleTable::getTableParticleMass, G4INCL::ParticleSpecies::theA, G4INCL::ParticleSpecies::theS, G4INCL::ParticleSpecies::theType, and G4INCL::ParticleSpecies::theZ.

◆ getLocalEnergy()

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

Definition at line 53 of file G4INCLKinematicsUtils.cc.

53 {
54// assert(!p->isMeson()); // No local energy for mesons
55
56 G4double vloc = 0.0;
57 const G4double r = p->getPosition().mag();
58 const G4double mass = p->getMass();
59
60 // Local energy is constant outside the surface
61 if(r > n->getUniverseRadius()) {
62 INCL_WARN("Tried to evaluate local energy for a particle outside the maximum radius."
63 << '\n' << p->print() << '\n'
64 << "Maximum radius = " << n->getDensity()->getMaximumRadius() << '\n'
65 << "Universe radius = " << n->getUniverseRadius() << '\n');
66 return 0.0;
67 }
68
69 G4double pfl0 = 0.0;
70 const ParticleType t = p->getType();
71 const G4double kinE = p->getKineticEnergy();
72 if(kinE <= n->getPotential()->getFermiEnergy(t)) {
73 pfl0 = n->getPotential()->getFermiMomentum(p);
74 } else {
75 const G4double tf0 = p->getPotentialEnergy() - n->getPotential()->getSeparationEnergy(p);
76 if(tf0<0.0) return 0.0;
77 pfl0 = std::sqrt(tf0*(tf0 + 2.0*mass));
78 }
79 const G4double pReflection = p->getReflectionMomentum()/pfl0;
80 const G4double reflectionRadius = n->getDensity()->getMaxRFromP(p->getType(), pReflection);
81 const G4double pNominal = p->getMomentum().mag()/pfl0;
82 const G4double nominalReflectionRadius = n->getDensity()->getMaxRFromP(p->getType(), pNominal);
83 const G4double pl = pfl0*n->getDensity()->getMinPFromR(t, r*nominalReflectionRadius/reflectionRadius);
84 vloc = std::sqrt(pl*pl + mass*mass) - mass;
85
86 return vloc;
87 }
#define INCL_WARN(x)
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 G4INCL::ThreeVector & getMomentum() const
G4INCL::ParticleType getType() const
std::string print() const
G4double getMass() const
Get the cached particle mass.
G4double mag() const

References G4INCL::Particle::getKineticEnergy(), G4INCL::Particle::getMass(), G4INCL::Particle::getMomentum(), G4INCL::Particle::getPosition(), G4INCL::Particle::getPotentialEnergy(), G4INCL::Particle::getReflectionMomentum(), G4INCL::Particle::getType(), INCL_WARN, G4INCL::ThreeVector::mag(), CLHEP::detail::n, and G4INCL::Particle::print().

Referenced by G4INCL::InteractionAvatar::ViolationEMomentumFunctor::scaleParticleMomenta(), G4INCL::InteractionAvatar::ViolationEEnergyFunctor::setParticleEnergy(), and transformToLocalEnergyFrame().

◆ invariantMass()

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

Definition at line 162 of file G4INCLKinematicsUtils.cc.

162 {
163 return std::sqrt(squareInvariantMass(E, p));
164 }
G4double squareInvariantMass(const G4double E, const ThreeVector &p)

References squareInvariantMass().

Referenced by G4INCL::ClusteringModelIntercomparison::findClusterStartingFrom().

◆ makeBoostVector()

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

Definition at line 89 of file G4INCLKinematicsUtils.cc.

89 {
90 const G4double totalEnergy = p1->getEnergy() + p2->getEnergy();
91 return ((p1->getMomentum() + p2->getMomentum())/totalEnergy);
92 }

References G4INCL::Particle::getEnergy(), and G4INCL::Particle::getMomentum().

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

◆ momentumInCM() [1/2]

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

Definition at line 119 of file G4INCLKinematicsUtils.cc.

119 {
120 return 0.5*std::sqrt((E*E - std::pow(M1 + M2, 2))
121 *(E*E - std::pow(M1 - M2, 2)))/E;
122 }

◆ momentumInCM() [2/2]

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

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 107 of file G4INCLKinematicsUtils.cc.

107 {
108 const G4double m1sq = std::pow(p1->getMass(),2);
109 const G4double m2sq = std::pow(p2->getMass(),2);
110 const G4double z = p1->getEnergy()*p2->getEnergy() - p1->getMomentum().dot(p2->getMomentum());
111 G4double pcm2 = (z*z-m1sq*m2sq)/(2*z+m1sq+m2sq);
112 if(pcm2 < 0.0) {
113 INCL_ERROR("momentumInCM: pcm2 == " << pcm2 << " < 0.0" << '\n');
114 pcm2 = 0.0;
115 }
116 return std::sqrt(pcm2);
117 }
#define INCL_ERROR(x)

References G4INCL::ThreeVector::dot(), G4INCL::Particle::getEnergy(), G4INCL::Particle::getMass(), G4INCL::Particle::getMomentum(), and INCL_ERROR.

Referenced by G4INCL::DeltaDecayChannel::computeDecayTime(), G4INCL::PhaseSpaceRauboldLynch::computeMaximumWeightNaive(), G4INCL::Nucleus::computeOneNucleonRecoilKinematics(), G4INCL::PhaseSpaceRauboldLynch::computeWeight(), G4INCL::Nucleus::decayOutgoingDeltas(), G4INCL::Nucleus::decayOutgoingPionResonances(), G4INCL::Nucleus::decayOutgoingSigmaZero(), G4INCL::CrossSectionsMultiPionsAndResonances::etaNToPiN(), G4INCL::DeltaDecayChannel::fillFinalState(), G4INCL::DeltaProductionChannel::fillFinalState(), G4INCL::NKbToLpiChannel::fillFinalState(), G4INCL::NKbToNKbChannel::fillFinalState(), G4INCL::NKbToSpiChannel::fillFinalState(), G4INCL::NKElasticChannel::fillFinalState(), G4INCL::NKToNKChannel::fillFinalState(), G4INCL::NpiToLKChannel::fillFinalState(), G4INCL::NpiToSKChannel::fillFinalState(), G4INCL::NYElasticChannel::fillFinalState(), G4INCL::PionResonanceDecayChannel::fillFinalState(), G4INCL::RecombinationChannel::fillFinalState(), G4INCL::SigmaZeroDecayChannel::fillFinalState(), G4INCL::StrangeAbsorbtionChannel::fillFinalState(), G4INCL::PhaseSpaceKopylov::generate(), G4INCL::NKbElasticChannel::KaonMomentum(), G4INCL::CrossSectionsMultiPionsAndResonances::omegaNToPiN(), G4INCL::ClusterDecay::anonymous_namespace{G4INCLClusterDecay.cc}::threeBodyDecay(), and G4INCL::ClusterDecay::anonymous_namespace{G4INCLClusterDecay.cc}::twoBodyDecay().

◆ momentumInLab() [1/2]

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

Definition at line 124 of file G4INCLKinematicsUtils.cc.

124 {
125 const G4double m1sq = m1*m1;
126 const G4double m2sq = m2*m2;
127 G4double plab2 = (s*s-2*s*(m1sq+m2sq)+(m1sq-m2sq)*(m1sq-m2sq))/(4*m2sq);
128 if(plab2 < 0.0) {
129 INCL_ERROR("momentumInLab: plab2 == " << plab2 << " < 0.0; m1sq == " << m1sq << "; m2sq == " << m2sq << "; s == " << s << '\n');
130 plab2 = 0.0;
131 }
132 return std::sqrt(plab2);
133 }
static constexpr double s
Definition: G4SIunits.hh:154
static constexpr double m2
Definition: G4SIunits.hh:110

References INCL_ERROR, m2, and s.

◆ momentumInLab() [2/2]

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

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 135 of file G4INCLKinematicsUtils.cc.

135 {
136 const G4double m1 = p1->getMass();
137 const G4double m2 = p2->getMass();
138 const G4double s = squareTotalEnergyInCM(p1, p2);
139 return momentumInLab(s, m1, m2);
140 }
G4double squareTotalEnergyInCM(Particle const *const p1, Particle const *const p2)
G4double momentumInLab(Particle const *const p1, Particle const *const p2)
gives the momentum in the lab frame of two particles.

References G4INCL::Particle::getMass(), m2, momentumInLab(), s, and squareTotalEnergyInCM().

Referenced by G4INCL::CrossSectionsINCL46::elasticNNLegacy(), G4INCL::CrossSectionsMultiPionsAndResonances::etaNElastic(), G4INCL::CrossSectionsMultiPionsAndResonances::etaNToPiN(), G4INCL::CrossSectionsMultiPionsAndResonances::etaNToPiPiN(), G4INCL::DeltaProductionChannel::fillFinalState(), G4INCL::ElasticChannel::fillFinalState(), G4INCL::EtaNElasticChannel::fillFinalState(), G4INCL::EtaNToPiNChannel::fillFinalState(), G4INCL::NNToMissingStrangenessChannel::fillFinalState(), G4INCL::NpiToMissingStrangenessChannel::fillFinalState(), G4INCL::NKbElasticChannel::KaonMomentum(), G4INCL::NKbToLpiChannel::KaonMomentum(), G4INCL::NKbToNKbChannel::KaonMomentum(), G4INCL::NKbToSpiChannel::KaonMomentum(), G4INCL::NpiToLKChannel::KaonMomentum(), G4INCL::NpiToSKChannel::KaonMomentum(), momentumInLab(), G4INCL::CrossSectionsINCL46::NDeltaToNN(), G4INCL::CrossSectionsStrangeness::NKbelastic(), G4INCL::CrossSectionsStrangeness::NKbToNKb(), G4INCL::CrossSectionsStrangeness::NKbToNKb2pi(), G4INCL::CrossSectionsStrangeness::NKbToNKbpi(), G4INCL::CrossSectionsStrangeness::NKbToS2pi(), G4INCL::CrossSectionsStrangeness::NKbToSpi(), G4INCL::CrossSectionsStrangeness::NKelastic(), G4INCL::CrossSectionsStrangeness::NKToNK(), G4INCL::CrossSectionsStrangeness::NKToNK2pi(), G4INCL::CrossSectionsStrangeness::NKToNKpi(), G4INCL::CrossSectionsStrangeness::NLToNS(), G4INCL::CrossSectionsMultiPions::NNElastic(), G4INCL::CrossSectionsMultiPions::NNElasticFixed(), G4INCL::CrossSectionsMultiPions::NNOnePiOrDelta(), G4INCL::CrossSectionsMultiPions::NNThreePi(), G4INCL::CrossSectionsStrangeness::NNToMissingStrangeness(), G4INCL::CrossSectionsINCL46::NNToNDelta(), G4INCL::CrossSectionsStrangeness::NNToNLK(), G4INCL::CrossSectionsStrangeness::NNToNSK(), G4INCL::CrossSectionsMultiPions::NNTotFixed(), G4INCL::CrossSectionsMultiPions::NNTwoPi(), G4INCL::CrossSectionsStrangeness::NpiToLK2pi(), G4INCL::CrossSectionsStrangeness::NpiToLKpi(), G4INCL::CrossSectionsStrangeness::NpiToMissingStrangeness(), G4INCL::CrossSectionsStrangeness::NpiToNKKb(), G4INCL::CrossSectionsStrangeness::NpiToSK2pi(), G4INCL::CrossSectionsStrangeness::NpiToSKpi(), G4INCL::CrossSectionsStrangeness::NSToNL(), G4INCL::CrossSectionsStrangeness::NSToNS(), G4INCL::CrossSectionsStrangeness::NYelastic(), G4INCL::CrossSectionsMultiPionsAndResonances::omegaNElastic(), G4INCL::CrossSectionsMultiPionsAndResonances::omegaNInelastic(), G4INCL::CrossSectionsMultiPionsAndResonances::omegaNToPiN(), G4INCL::CrossSectionsStrangeness::p_kmToL_pp_pm(), G4INCL::CrossSectionsStrangeness::p_kmToL_pz(), G4INCL::CrossSectionsStrangeness::p_pimToLK0(), G4INCL::CrossSectionsStrangeness::p_pimToSmKp(), G4INCL::CrossSectionsStrangeness::p_pimToSzKz(), G4INCL::CrossSectionsStrangeness::p_pipToSpKp(), G4INCL::CrossSectionsStrangeness::p_pizToSzKp(), G4INCL::CrossSectionsMultiPions::piMinuspIne(), G4INCL::CrossSectionsMultiPions::piMinuspOnePi(), G4INCL::CrossSectionsMultiPionsAndResonances::piMinuspToEtaN(), G4INCL::CrossSectionsMultiPionsAndResonances::piMinuspToOmegaN(), G4INCL::CrossSectionsMultiPions::piMinuspTwoPi(), G4INCL::CrossSectionsMultiPions::piNIne(), G4INCL::CrossSectionsMultiPions::piNOnePi(), G4INCL::CrossSectionsMultiPions::piNToxPiN(), G4INCL::CrossSectionsMultiPions::piNTwoPi(), G4INCL::CrossSectionsMultiPions::piPluspIne(), G4INCL::CrossSectionsMultiPions::piPluspOnePi(), and G4INCL::CrossSectionsMultiPions::piPluspTwoPi().

◆ squareInvariantMass()

G4double G4INCL::KinematicsUtils::squareInvariantMass ( const G4double  E,
const ThreeVector p 
)

Definition at line 166 of file G4INCLKinematicsUtils.cc.

166 {
167 return E*E - p.mag2();
168 }

References G4INCL::ThreeVector::mag2().

Referenced by invariantMass().

◆ squareTotalEnergyInCM()

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

◆ sumMomenta()

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

Definition at line 150 of file G4INCLKinematicsUtils.cc.

150 {
151 ThreeVector p(0.0, 0.0, 0.0);
152 for(ParticleIter i=pl.begin(), e=pl.end(); i!=e; ++i) {
153 p += (*i)->getMomentum();
154 }
155 return p;
156 }
ParticleList::const_iterator ParticleIter

◆ sumTotalEnergies()

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

Definition at line 142 of file G4INCLKinematicsUtils.cc.

142 {
143 G4double E = 0.0;
144 for(ParticleIter i=pl.begin(), e=pl.end(); i!=e; ++i) {
145 E += (*i)->getEnergy();
146 }
147 return E;
148 }

◆ totalEnergyInCM()

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

Definition at line 94 of file G4INCLKinematicsUtils.cc.

94 {
95 return std::sqrt(squareTotalEnergyInCM(p1,p2));
96 }

References squareTotalEnergyInCM().

Referenced by G4INCL::CrossSectionsMultiPionsAndResonances::etaNToPiN(), G4INCL::DeltaProductionChannel::fillFinalState(), G4INCL::EtaNToPiPiNChannel::fillFinalState(), G4INCL::NDeltaEtaProductionChannel::fillFinalState(), G4INCL::NDeltaOmegaProductionChannel::fillFinalState(), G4INCL::NDeltaToDeltaLKChannel::fillFinalState(), G4INCL::NDeltaToDeltaSKChannel::fillFinalState(), G4INCL::NDeltaToNLKChannel::fillFinalState(), G4INCL::NDeltaToNNKKbChannel::fillFinalState(), G4INCL::NDeltaToNSKChannel::fillFinalState(), G4INCL::NKbToL2piChannel::fillFinalState(), G4INCL::NKbToNKb2piChannel::fillFinalState(), G4INCL::NKbToNKbpiChannel::fillFinalState(), G4INCL::NKbToS2piChannel::fillFinalState(), G4INCL::NKToNK2piChannel::fillFinalState(), G4INCL::NKToNKpiChannel::fillFinalState(), G4INCL::NLToNSChannel::fillFinalState(), G4INCL::NNEtaToMultiPionsChannel::fillFinalState(), G4INCL::NNOmegaToMultiPionsChannel::fillFinalState(), G4INCL::NNToMissingStrangenessChannel::fillFinalState(), G4INCL::NNToMultiPionsChannel::fillFinalState(), G4INCL::NNToNLK2piChannel::fillFinalState(), G4INCL::NNToNLKChannel::fillFinalState(), G4INCL::NNToNLKpiChannel::fillFinalState(), G4INCL::NNToNNEtaChannel::fillFinalState(), G4INCL::NNToNNKKbChannel::fillFinalState(), G4INCL::NNToNNOmegaChannel::fillFinalState(), G4INCL::NNToNSK2piChannel::fillFinalState(), G4INCL::NNToNSKChannel::fillFinalState(), G4INCL::NNToNSKpiChannel::fillFinalState(), G4INCL::NpiToLK2piChannel::fillFinalState(), G4INCL::NpiToLKpiChannel::fillFinalState(), G4INCL::NpiToMissingStrangenessChannel::fillFinalState(), G4INCL::NpiToNKKbChannel::fillFinalState(), G4INCL::NpiToSK2piChannel::fillFinalState(), G4INCL::NpiToSKpiChannel::fillFinalState(), G4INCL::NSToNLChannel::fillFinalState(), G4INCL::NSToNSChannel::fillFinalState(), G4INCL::OmegaNToPiPiNChannel::fillFinalState(), G4INCL::PiNToEtaChannel::fillFinalState(), G4INCL::PiNToMultiPionsChannel::fillFinalState(), G4INCL::RecombinationChannel::fillFinalState(), G4INCL::StrangeAbsorbtionChannel::fillFinalState(), G4INCL::CrossSectionsStrangeness::NDeltaToNNKKb(), G4INCL::CrossSectionsMultiPions::NNOnePi(), G4INCL::CrossSectionsMultiPions::NNOnePiOrDelta(), G4INCL::CrossSectionsMultiPions::NNThreePi(), G4INCL::CrossSectionsINCL46::NNToNDelta(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNDeltaEta(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNDeltaOmega(), G4INCL::CrossSectionsStrangeness::NNToNLK2pi(), G4INCL::CrossSectionsStrangeness::NNToNLKpi(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNEta(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNEtaExclu(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNEtaFourPi(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNEtaOnePi(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNEtaOnePiOrDelta(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNEtaThreePi(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNEtaTwoPi(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNEtaxPi(), G4INCL::CrossSectionsStrangeness::NNToNNKKb(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNOmega(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNOmegaExclu(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNOmegaFourPi(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNOmegaOnePi(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNOmegaOnePiOrDelta(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNOmegaThreePi(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNOmegaTwoPi(), G4INCL::CrossSectionsMultiPionsAndResonances::NNToNNOmegaxPi(), G4INCL::CrossSectionsStrangeness::NNToNSK2pi(), G4INCL::CrossSectionsStrangeness::NNToNSKpi(), G4INCL::CrossSectionsMultiPions::NNTwoPi(), G4INCL::CrossSectionsMultiPionsAndResonances::omegaNToPiN(), G4INCL::CrossSectionsMultiPionsAndResonances::piMinuspToEtaN(), G4INCL::CrossSectionsMultiPionsAndResonances::piMinuspToOmegaN(), G4INCL::CrossSectionsINCL46::piNToDelta(), G4INCL::CrossSectionsMultiPions::piNToDelta(), and G4INCL::CrossSectionsMultiPions::piNTot().

◆ transformToLocalEnergyFrame()

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

Definition at line 45 of file G4INCLKinematicsUtils.cc.

45 {
46// assert(!p->isMeson()); // No local energy for mesons
47 const G4double localEnergy = getLocalEnergy(n, p);
48 const G4double localTotalEnergy = p->getEnergy() - localEnergy;
49 p->setEnergy(localTotalEnergy);
51 }
G4double getEnergy() const
const ThreeVector & adjustMomentumFromEnergy()
Rescale the momentum to match the total energy.
void setEnergy(G4double energy)
G4double getLocalEnergy(Nucleus const *const n, Particle *const p)

References G4INCL::Particle::adjustMomentumFromEnergy(), G4INCL::Particle::getEnergy(), getLocalEnergy(), CLHEP::detail::n, and G4INCL::Particle::setEnergy().

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