java.lang.Object
simpa.core.api.track.Particle
Object that represents a particle.
-
Constructor Summary
ConstructorsConstructorDescriptionParticle(double x, double y, double z, double px, double py, double pz, double ax, double ay, double az, double charge, double mass) Constructs a particle with the given parameters.Particle(org.apache.commons.math3.geometry.euclidean.threed.Vector3D pos, org.apache.commons.math3.geometry.euclidean.threed.Vector3D dir, org.apache.commons.math3.geometry.euclidean.threed.Vector3D vp, double pInGeV, double charge, double mass) Constructor with a direction vector, the direction will be normalized, so its amplitude doesn't matter. -
Method Summary
Modifier and TypeMethodDescriptioncopy(Particle p, PotentialProvider pp) doubleGets the particle's charge.static Stringorg.apache.commons.math3.geometry.euclidean.threed.Vector3DCalculates and returns the kinetic momentum of the particle.doublegetMass()Gets the particle's mass.getName()Gets the name of the particle.org.apache.commons.math3.geometry.euclidean.threed.Vector3Dorg.apache.commons.math3.geometry.euclidean.threed.Vector3DdoublegetPx()Gets the particle's canonical momentum on the X axis.doublegetPy()Gets the particle's canonical momentum on the Y axis.doublegetPz()Gets the particle's canonical momentum on the Z axis.doublegetTime()Gets the lifetime of the particle.doublegetX()Gets the X position of the particle.doublegetY()Gets the Y position of the particle.doublegetZ()Gets the Z position of the particle.booleanisLost()booleanvoidreset(boolean reverse) Resets the terminated flag to false, so the particle already tracked can be reused.voidsetCharge(double charge) method for setting/updating the charge.voidsetMass(double mass) method for setting/updating the mass.voidSets the name for the particle.voidsetPreviousKineticMomentum(org.apache.commons.math3.geometry.euclidean.threed.Vector3D prevMom) voidsetPreviousPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D prevPos) voidsetTerminated(boolean terminated) voidsetTime(double time) toString()voidupdateMomentum(double px, double py, double pz, double ax, double ay, double az) Update the canonical momentum.voidupdatePosition(double xc, double yc, double zc)
-
Constructor Details
-
Particle
public Particle(org.apache.commons.math3.geometry.euclidean.threed.Vector3D pos, org.apache.commons.math3.geometry.euclidean.threed.Vector3D dir, org.apache.commons.math3.geometry.euclidean.threed.Vector3D vp, double pInGeV, double charge, double mass) Constructor with a direction vector, the direction will be normalized, so its amplitude doesn't matter.- Parameters:
pos- position vectordir- direction vectorvp- the vector potential at the positionpInGeV- Nominal momentum [GeV/c]charge- charge of the particle in Culombs.mass- mass of the particle in kilograms.
-
Particle
public Particle(double x, double y, double z, double px, double py, double pz, double ax, double ay, double az, double charge, double mass) Constructs a particle with the given parameters.- Parameters:
x- x position [m]y- y position [m]z- z position [m]px- x kinetic momentum [kg m/s]py- y kinetic momentum [kg m/s]pz- z kinetic momentum [kg m/s]ax- X component of the vector potential at the particle positionay- Y component of the vector potential at the particle positionaz- Z component of the vector potential at the particle positioncharge- The charge [coulomb]mass- The mass [kg]
-
-
Method Details
-
getX
public double getX()Gets the X position of the particle.- Returns:
- the X position of the particle.
-
getY
public double getY()Gets the Y position of the particle.- Returns:
- the Y position of the particle.
-
getZ
public double getZ()Gets the Z position of the particle.- Returns:
- the Z position of the particle.
-
getPx
public double getPx()Gets the particle's canonical momentum on the X axis.- Returns:
- the particle's canonical momentum on the X axis.
-
getPy
public double getPy()Gets the particle's canonical momentum on the Y axis.- Returns:
- the particle's canonical momentum on the Y axis.
-
getPz
public double getPz()Gets the particle's canonical momentum on the Z axis.- Returns:
- the particle's canonical momentum on the Z axis.
-
getCharge
public double getCharge()Gets the particle's charge.- Returns:
- the particle's charge.
-
setCharge
public void setCharge(double charge) method for setting/updating the charge.- Parameters:
charge- the desired charge.
-
getMass
public double getMass()Gets the particle's mass.- Returns:
- the particle's mass.
-
setMass
public void setMass(double mass) method for setting/updating the mass.- Parameters:
mass- the desired mass.
-
getHeader
- Returns:
- Header sting for the toString method.
-
toString
-
getName
Gets the name of the particle.- Returns:
- String of the particle name.
-
setName
Sets the name for the particle.- Parameters:
name- The desired name.
-
getTime
public double getTime()Gets the lifetime of the particle.- Returns:
- the lifetime of the particle
-
getKineticMomentum
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getKineticMomentum()Calculates and returns the kinetic momentum of the particle.- Returns:
- A vector of the kinetic momentum. [kg*m/s]
-
updatePosition
public void updatePosition(double xc, double yc, double zc) -
updateMomentum
public void updateMomentum(double px, double py, double pz, double ax, double ay, double az) Update the canonical momentum. We store in the particle object the vector potential too, in order to get the kinetic momentum if needed.- Parameters:
px- - Canonical momentum X componentpy- - Canonical momentum Y componentpz- - Canonical momentum Z componentax- - Vector potential X componentay- - Vector potential Y componentaz- - Vector potential Z component
-
setTime
public void setTime(double time) -
getPreviousPosition
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getPreviousPosition() -
setPreviousPosition
public void setPreviousPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D prevPos) -
setTerminated
public void setTerminated(boolean terminated) -
isTerminated
public boolean isTerminated() -
getPreviousKineticMomentum
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getPreviousKineticMomentum() -
setPreviousKineticMomentum
public void setPreviousKineticMomentum(org.apache.commons.math3.geometry.euclidean.threed.Vector3D prevMom) -
isLost
public boolean isLost() -
reset
public void reset(boolean reverse) Resets the terminated flag to false, so the particle already tracked can be reused. If the terminated flag before the reset call is true and the reverse parameter is also true, it reverses the vector potential in the canonical momentum.- Parameters:
reverse- If true it reverses the momentum of the particle and attach the string "-backward" to the name of the particle.
-
copy
-