Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getProbe()
- swim(int, double, double, double, double, double, double, double, double, double, AdaptiveSwimResult)
- swimS(int, double, double, double, double, double, double, double, double, double, double, AdaptiveSwimResult)
- sectorSwimZ(int, int, double, double, double, double, double, double, double, double, double, double, double, AdaptiveSwimResult)
- swimZ(int, double, double, double, double, double, double, double, double, double, double, double, AdaptiveSwimResult)
- swimRho(int, double, double, double, double, double, double, double, double, double, double, double, AdaptiveSwimResult)
- swimPlane(int, double, double, double, double, double, double, Plane, double, double, double, double, AdaptiveSwimResult)
- swimSphere(int, double, double, double, double, double, double, Sphere, double, double, double, double, AdaptiveSwimResult)
- swimCylinder(int, double, double, double, double, double, double, Cylinder, double, double, double, double, AdaptiveSwimResult)
- swimLine(int, double, double, double, double, double, double, Line, double, double, double, double, AdaptiveSwimResult)
Class AdaptiveSwimmer
java.lang.Object
cnuphys.adaptiveSwim.AdaptiveSwimmer
A swimmer for adaptive stepsize integrators. These swimmers are not thread safe. Every thread that needs an
AdaptiveSwimmer should create its own.
- Author:
- heddle
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
static final int
A swim was requested for a particle with extremely low momentumstatic final int
The swim was a successstatic final int
A target, such as a target rho or z, was not reached before the swim was stopped for some other reason -
Constructor Summary
ConstructorsConstructorDescriptionCreate a swimmer using the current active fieldAdaptiveSwimmer
(cnuphys.magfield.IMagField magneticField) Create a swimmer specific to a magnetic fieldAdaptiveSwimmer
(cnuphys.magfield.MagneticField magneticField) Create a swimmer specific to a magnetic field -
Method Summary
Modifier and TypeMethodDescriptioncnuphys.magfield.FieldProbe
getProbe()
Get the probe being used to swimvoid
sectorSwimZ
(int sector, int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double targetZ, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) Swims a charged particle in a sector coordinate system.void
swim
(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double sf, double h0, double eps, AdaptiveSwimResult result) Swim using the current active field.void
swimCylinder
(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Cylinder targetCylinder, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) Swim to an arbitrary infinitely long cylinder using the current active fieldvoid
swimLine
(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Line targetLine, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) Swim to an arbitrary infinitely long line using the current active fieldvoid
swimPlane
(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Plane targetPlane, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) Swim to a plane using the current active fieldvoid
swimRho
(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double targetRho, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) Swim to a fixed rho using the current active fieldvoid
swimS
(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) Swim to a definite pathlength.void
swimSphere
(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Sphere targetSphere, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) Swim to an arbitrary sphere using the current active fieldvoid
swimZ
(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double targetZ, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) Swim to a fixed z using the current active field
-
Field Details
-
SWIM_SUCCESS
public static final int SWIM_SUCCESSThe swim was a success- See Also:
-
SWIM_TARGET_MISSED
public static final int SWIM_TARGET_MISSEDA target, such as a target rho or z, was not reached before the swim was stopped for some other reason- See Also:
-
SWIM_BELOW_MIN_P
public static final int SWIM_BELOW_MIN_PA swim was requested for a particle with extremely low momentum- See Also:
-
MINMOMENTUM
public static final double MINMOMENTUM- See Also:
-
-
Constructor Details
-
AdaptiveSwimmer
public AdaptiveSwimmer()Create a swimmer using the current active field -
AdaptiveSwimmer
public AdaptiveSwimmer(cnuphys.magfield.MagneticField magneticField) Create a swimmer specific to a magnetic field- Parameters:
magneticField
- the magnetic field
-
AdaptiveSwimmer
public AdaptiveSwimmer(cnuphys.magfield.IMagField magneticField) Create a swimmer specific to a magnetic field- Parameters:
magneticField
- the magnetic field
-
-
Method Details
-
getProbe
public cnuphys.magfield.FieldProbe getProbe()Get the probe being used to swim- Returns:
- the probe
-
swim
public void swim(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException Swim using the current active field. This swimmer has no target. It will stop when the pathlength exceeds the maximum. For a more precise pathlength swim, use swimS.- Parameters:
charge
- in integer units of exo
- the x vertex position in metersyo
- the y vertex position in meterszo
- the z vertex position in metersmomentum
- the momentum in GeV/ctheta
- the initial polar angle in degreesphi
- the initial azimuthal angle in degreessf
- the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopperh0
- the initial stepsize in meterseps
- the overall fractional tolerance (e.g., 1.0e-5)result
- the container for some of the swimming results- Throws:
AdaptiveSwimException
-
swimS
public void swimS(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException Swim to a definite pathlength. If extreme accuracy is not needed, use swim instead.- Parameters:
charge
- in integer units of exo
- the x vertex position in metersyo
- the y vertex position in meterszo
- the z vertex position in metersmomentum
- the momentum in GeV/ctheta
- the initial polar angle in degreesphi
- the initial azimuthal angle in degreesaccuracy
- the requested accuracy for the target pathlength in meterssf
- the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopperh0
- the initial stepsize in meterseps
- the overall fractional tolerance (e.g., 1.0e-5)result
- the container for some of the swimming results- Throws:
AdaptiveSwimException
-
sectorSwimZ
public void sectorSwimZ(int sector, int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double targetZ, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException Swims a charged particle in a sector coordinate system. This swims to a fixed z value. THIS IS ONLY VALID IF THE FIELD IS A RotatedComnpositeField or RotatedCompositeProbe- Parameters:
sector
- the sector [1..6]charge
- in integer units of exo
- the x vertex position in metersyo
- the y vertex position in meterszo
- the z vertex position in metersmomentum
- the momentum in GeV/ctheta
- the initial polar angle in degreesphi
- the initial azimuthal angle in degreestargetZ
- the target z in metersaccuracy
- the requested accuracy for the target z in meterssf
- the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopperh0
- the initial stepsize in meterseps
- the overall fractional tolerance (e.g., 1.0e-5)result
- the container for some of the swimming results- Throws:
AdaptiveSwimException
-
swimZ
public void swimZ(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double targetZ, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException Swim to a fixed z using the current active field- Parameters:
charge
- in integer units of exo
- the x vertex position in metersyo
- the y vertex position in meterszo
- the z vertex position in metersmomentum
- the momentum in GeV/ctheta
- the initial polar angle in degreesphi
- the initial azimuthal angle in degreestargetZ
- the target z in metersaccuracy
- the requested accuracy for the target z in meterssf
- the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopperh0
- the initial stepsize in meterseps
- the overall fractional tolerance (e.g., 1.0e-5)result
- the container for some of the swimming results- Throws:
AdaptiveSwimException
-
swimRho
public void swimRho(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double targetRho, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException Swim to a fixed rho using the current active field- Parameters:
charge
- in integer units of exo
- the x vertex position in metersyo
- the y vertex position in meterszo
- the z vertex position in metersmomentum
- the momentum in GeV/ctheta
- the initial polar angle in degreesphi
- the initial azimuthal angle in degreestargetRho
- the target rho in metersaccuracy
- the requested accuracy for the target rho in meterssf
- the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopperh0
- the initial stepsize in meterseps
- the overall fractional tolerance (e.g., 1.0e-5)result
- the container for some of the swimming results- Throws:
AdaptiveSwimException
-
swimPlane
public void swimPlane(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Plane targetPlane, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException Swim to a plane using the current active field- Parameters:
charge
- in integer units of exo
- the x vertex position in metersyo
- the y vertex position in meterszo
- the z vertex position in metersmomentum
- the momentum in GeV/ctheta
- the initial polar angle in degreesphi
- the initial azimuthal angle in degreestargetPlane
- the target planeaccuracy
- the requested accuracy for the final distance to the plane in meterssf
- the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopperh0
- the initial stepsize in meterseps
- the overall fractional tolerance (e.g., 1.0e-5)result
- the container for some of the swimming results- Throws:
AdaptiveSwimException
-
swimSphere
public void swimSphere(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Sphere targetSphere, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException Swim to an arbitrary sphere using the current active field- Parameters:
charge
- in integer units of exo
- the x vertex position in metersyo
- the y vertex position in meterszo
- the z vertex position in metersmomentum
- the momentum in GeV/ctheta
- the initial polar angle in degreesphi
- the initial azimuthal angle in degreestargetSphere
- the target sphereaccuracy
- the requested accuracy for the target rho in meterssf
- the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopperh0
- the initial stepsize in meterseps
- the overall fractional tolerance (e.g., 1.0e-5)result
- the container for some of the swimming results- Throws:
AdaptiveSwimException
-
swimCylinder
public void swimCylinder(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Cylinder targetCylinder, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException Swim to an arbitrary infinitely long cylinder using the current active field- Parameters:
charge
- in integer units of exo
- the x vertex position in metersyo
- the y vertex position in meterszo
- the z vertex position in metersmomentum
- the momentum in GeV/ctheta
- the initial polar angle in degreesphi
- the initial azimuthal angle in degreestargetCylinder
- the target cylinderaccuracy
- the requested accuracy for the target rho in meterssf
- the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopperh0
- the initial stepsize in meterseps
- the overall fractional tolerance (e.g., 1.0e-5)result
- the container for some of the swimming results- Throws:
AdaptiveSwimException
-
swimLine
public void swimLine(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Line targetLine, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException Swim to an arbitrary infinitely long line using the current active field- Parameters:
charge
- in integer units of exo
- the x vertex position in metersyo
- the y vertex position in meterszo
- the z vertex position in metersmomentum
- the momentum in GeV/ctheta
- the initial polar angle in degreesphi
- the initial azimuthal angle in degreestargetLine
- the target lineaccuracy
- the requested accuracy for the target rho in meterssf
- the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopperh0
- the initial stepsize in meterseps
- the overall fractional tolerance (e.g., 1.0e-5)result
- the container for some of the swimming results- Throws:
AdaptiveSwimException
-