java.lang.Object
simpa.acc.api.utils.AccCalculatorUtils
Utilities specific for calculating in the accelerator library.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic doublegetBrhoFromGevOc(double gevOc) static doublegetGamma(double pInGev, double m0) static doublegetKineticEnergy(double pInGev, double m0) static doublegetMomentumFromEKin(double evKin, double m0) static doublegetMomentumFromGeVoC(double pInGev) Convert momentum from [GeV/c] to [kg*m/s]static doublegetMomentumInEVoC(double mom) Get the norm of the momentum in [eV/c]static doublegetTotalEnergy(double pInGev, double m0) static doublegetVelocity(double pInGev, double m0) static org.apache.commons.math3.geometry.euclidean.threed.Vector3DinterpolateMomentum(org.apache.commons.math3.geometry.euclidean.threed.Vector3D point, org.apache.commons.math3.geometry.euclidean.threed.Vector3D kinMom, org.apache.commons.math3.geometry.euclidean.threed.Vector3D prevKinMom, org.apache.commons.math3.geometry.euclidean.threed.Vector3D pos, org.apache.commons.math3.geometry.euclidean.threed.Vector3D prevPos) Interpolates the kinetic momentum using two position and momentum pairs
-
Constructor Details
-
AccCalculatorUtils
public AccCalculatorUtils()
-
-
Method Details
-
getGamma
public static double getGamma(double pInGev, double m0) -
getTotalEnergy
public static double getTotalEnergy(double pInGev, double m0) - Parameters:
pInGev- -Momentum in [GeV/c]m0- -Rest mass in [kg]- Returns:
- - Total energy in [kg*m^2/s^2]
-
getMomentumFromGeVoC
public static double getMomentumFromGeVoC(double pInGev) Convert momentum from [GeV/c] to [kg*m/s]- Parameters:
pInGev- -momentum in [GeV/c]- Returns:
- - momentum in [kg*m/s]
-
getVelocity
public static double getVelocity(double pInGev, double m0) - Parameters:
pInGev- - Momentum in GeV/c- Returns:
- - The velocity of a particle [m/s].
-
getKineticEnergy
public static double getKineticEnergy(double pInGev, double m0) - Parameters:
pInGev- - momentum in[GeV/c]m0- - mass [kg]- Returns:
- -Kinetic energy [eV]
-
getMomentumFromEKin
public static double getMomentumFromEKin(double evKin, double m0) - Parameters:
evKin- - kinetic energy [eV]m0- - rest mass [kg]- Returns:
- - Momentum in [eV/c]
-
getMomentumInEVoC
public static double getMomentumInEVoC(double mom) Get the norm of the momentum in [eV/c]- Parameters:
mom- - momentum in [kg*m/s]- Returns:
- - momentum in [eV/c]
-
getBrhoFromGevOc
public static double getBrhoFromGevOc(double gevOc) -
interpolateMomentum
public static org.apache.commons.math3.geometry.euclidean.threed.Vector3D interpolateMomentum(org.apache.commons.math3.geometry.euclidean.threed.Vector3D point, org.apache.commons.math3.geometry.euclidean.threed.Vector3D kinMom, org.apache.commons.math3.geometry.euclidean.threed.Vector3D prevKinMom, org.apache.commons.math3.geometry.euclidean.threed.Vector3D pos, org.apache.commons.math3.geometry.euclidean.threed.Vector3D prevPos) Interpolates the kinetic momentum using two position and momentum pairs- Parameters:
point- A point the momentum is calculated for.kinMom- Current kinetic momentum.prevKinMom- Previous kinetic momentum.pos- Current position.prevPos- Previous position- Returns:
- The interpolated momentum for the given point.
-