java.lang.Object
simpa.core.api.track.ObserverDisk
- All Implemented Interfaces:
OcTreeEntry
This class is used for getting the particle position and momentum during
tracking. It is also used for converting trajectory data from the global
Cartesian coordinate system to the local frame.
- Author:
- lbojtar
-
Constructor Summary
ConstructorsConstructorDescriptionObserverDisk
(org.apache.commons.math3.geometry.euclidean.threed.Vector3D center, LocalFrame localFrame, double radius, boolean backward) Constructs a disk with the given radius, center and normal vector. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.math3.geometry.euclidean.threed.Vector3D
Gets the center of the disk.double
Gets the radius of the disk.double
getDistance
(org.apache.commons.math3.geometry.euclidean.threed.Vector3D point) Gets the oriented distance of the point from the Plane (positive or negative depending which side of the point is of the disk.)org.apache.commons.math3.geometry.euclidean.threed.Vector3D
getIntersection
(org.apache.commons.math3.geometry.euclidean.threed.Vector3D p1, org.apache.commons.math3.geometry.euclidean.threed.Vector3D p2) Returns the intersection of this disk with the given line segment formed by the two points.org.apache.commons.math3.geometry.euclidean.threed.Vector3D
getPhaseSpaceCoordinates
(org.apache.commons.math3.geometry.euclidean.threed.Vector3D is, org.apache.commons.math3.geometry.euclidean.threed.Vector3D mom) Calculates the phase-space coordinates at the intersection pointorg.apache.commons.math3.geometry.euclidean.threed.Plane
getPlane()
Gets the plane of the disk.org.apache.commons.math3.geometry.euclidean.threed.Vector3D
getXAxis()
org.apache.commons.math3.geometry.euclidean.threed.Vector3D
getYAxis()
org.apache.commons.math3.geometry.euclidean.threed.Vector3D
getZAxis()
void
setCenter
(org.apache.commons.math3.geometry.euclidean.threed.Vector3D c) Sets the center of this ObserverDiskvoid
setPlane
(org.apache.commons.math3.geometry.euclidean.threed.Plane p) Set the plane for this ObserverDisk
-
Constructor Details
-
ObserverDisk
public ObserverDisk(org.apache.commons.math3.geometry.euclidean.threed.Vector3D center, LocalFrame localFrame, double radius, boolean backward) Constructs a disk with the given radius, center and normal vector. This is useful for calculating the phase space coordinates.- Parameters:
center
- - Center of the disk.localFrame
- - Local frame at the orbit point where the disk is placed.radius
- - Radius of the observation disk. This should be big enough to cover the aperture, but smaller than the diameter of the machine, otherwise the particle trajectory would traverse two times the observation disk.backward
- If true, the observer is placed at the first point of the orbit. This should be set true when tracking backward.
-
-
Method Details
-
getPlane
public org.apache.commons.math3.geometry.euclidean.threed.Plane getPlane()Gets the plane of the disk.- Returns:
- Plane
-
setPlane
public void setPlane(org.apache.commons.math3.geometry.euclidean.threed.Plane p) Set the plane for this ObserverDisk- Parameters:
p
- - Plane
-
getDiskRadius
public double getDiskRadius()Gets the radius of the disk.- Returns:
- -radius
-
getCenter
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getCenter()Gets the center of the disk.- Returns:
- -center
-
setCenter
public void setCenter(org.apache.commons.math3.geometry.euclidean.threed.Vector3D c) Sets the center of this ObserverDisk- Parameters:
c
- -center
-
getIntersection
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getIntersection(org.apache.commons.math3.geometry.euclidean.threed.Vector3D p1, org.apache.commons.math3.geometry.euclidean.threed.Vector3D p2) Returns the intersection of this disk with the given line segment formed by the two points. It can be null if the segment is not intersecting with the disk.- Parameters:
p1
- - first point of the line segmentp2
- - second point of the line segment- Returns:
- Vector3D - intersection point
-
getDistance
public double getDistance(org.apache.commons.math3.geometry.euclidean.threed.Vector3D point) Gets the oriented distance of the point from the Plane (positive or negative depending which side of the point is of the disk.)- Parameters:
point
- - Vector3D point- Returns:
- double distance
-
getXAxis
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getXAxis() -
getYAxis
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getYAxis() -
getZAxis
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getZAxis() -
getPhaseSpaceCoordinates
public PhaseSpaceCoordinates getPhaseSpaceCoordinates(org.apache.commons.math3.geometry.euclidean.threed.Vector3D is, org.apache.commons.math3.geometry.euclidean.threed.Vector3D mom) Calculates the phase-space coordinates at the intersection point- Parameters:
is
- - Intersection point with the planemom
- - The normalized kinetic momentum at the intersection- Returns:
- PhaseSpaceCoordinates
-
getLocation
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getLocation()- Specified by:
getLocation
in interfaceOcTreeEntry
-