Package cnuphys.swimZ
Class SwimZ
java.lang.Object
cnuphys.swimZ.SwimZ
This class holds the parameters and static methods for the swimZ
integration. The swimZ integration follows the method described for the
HERA-B magnet here: http://arxiv.org/pdf/physics/0511177v1.pdf
The state vector has five elements:
(x, y, tx, ty, q)
Where x and y are the transverse coordinates (meters), tx = px/pz, ty = py/pz,
and q = Q/|p| where Q is the integer charge (e.g. -1 for an electron)
UNITS
- x, y, and z are in cm
- p is in GeV/c
- B (mag field) is in kGauss
- Author:
- heddle
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
Argon radiation length in cmstatic final double
The speed of light in these units: (GeV/c)(1/kG)(1/cm) -
Constructor Summary
ConstructorsConstructorDescriptionSwimZ()
SwimZ constructor.Create a swimmer specific to a magnetic fieldSwimZ
(MagneticField magneticField) Create a swimmer specific to a magnetic field -
Method Summary
Modifier and TypeMethodDescriptionadaptiveRK
(int Q, double p, SwimZStateVector start, double zf, double stepSize, double[] hdata) Swim to a fixed z over short distances using RK adaptive stepsizeint
adaptiveRK
(int Q, double p, SwimZStateVector start, SwimZStateVector stop, double zf, double stepSize, double[] hdata) Swim to a fixed z using RK adaptive stepsizedouble
getEps()
Get the tolerance used by the CLAS_Toleance arraygetProbe()
Get the underlying field probeparabolicEstimate
(int Q, double p, SwimZStateVector start, double zf, double stepSize) Swim to a fixed z over short distances using a parabolic estimatevoid
parabolicEstimate
(int Q, double p, SwimZStateVector start, SwimZStateVector stop, double zf) Swim to a fixed z over short distances using a parabolic estimate, without intermediate pointssectorAdaptiveRK
(int sector, int Q, double p, SwimZStateVector start, double zf, double stepSize, double[] hdata) Swim to a fixed z over short distances using RK adaptive stepsizevoid
setAbsoluteTolerance
(double eps) Set the tolerance used by the CLAS_Tolerance array
-
Field Details
-
C
public static final double CThe speed of light in these units: (GeV/c)(1/kG)(1/cm)- See Also:
-
ARGONRADLEN
public static final double ARGONRADLENArgon radiation length in cm- See Also:
-
-
Constructor Details
-
SwimZ
public SwimZ()SwimZ constructor. Here we create a Swimmer that will use the given magnetic field.- Parameters:
field
- interface into a magnetic field
-
SwimZ
Create a swimmer specific to a magnetic field- Parameters:
magneticField
- the magnetic field
-
SwimZ
Create a swimmer specific to a magnetic field- Parameters:
magneticField
- the magnetic field
-
-
Method Details
-
getProbe
Get the underlying field probe- Returns:
- the probe
-
setAbsoluteTolerance
public void setAbsoluteTolerance(double eps) Set the tolerance used by the CLAS_Tolerance array- Parameters:
eps
- the baseline absolute tolerance.
-
getEps
public double getEps()Get the tolerance used by the CLAS_Toleance array- Returns:
- the tolerance used by the CLAS_Toleance array
-
adaptiveRK
public SwimZResult adaptiveRK(int Q, double p, SwimZStateVector start, double zf, double stepSize, double[] hdata) throws SwimZException Swim to a fixed z over short distances using RK adaptive stepsize- Parameters:
Q
- the integer charge of the particle (-1 for electron)p
- the momentum in GeV/cstart
- the starting state vectorzf
- the final z value (cm)stepSize
- the initial step sizerelTolerance
- the absolute tolerances on each state variable [x, y, tx, ty] (q = const). So it is an array with four entries, like [1.0e-4 cm, 1.0e-4 cm, 1.0e-5, 1.0e05]hdata
- An array with three elements. Upon return it will have the min, average, and max step size (in that order).- Returns:
- the swim result
- Throws:
SwimZException
-
sectorAdaptiveRK
public SwimZResult sectorAdaptiveRK(int sector, int Q, double p, SwimZStateVector start, double zf, double stepSize, double[] hdata) throws SwimZException Swim to a fixed z over short distances using RK adaptive stepsize- Parameters:
sector
- the sector [1..6]Q
- the integer charge of the particle (-1 for electron)p
- the momentum in GeV/cstart
- the starting state vectorzf
- the final z value (cm)stepSize
- the initial step sizerelTolerance
- the absolute tolerances on each state variable [x, y, tx, ty] (q = const). So it is an array with four entries, like [1.0e-4 cm, 1.0e-4 cm, 1.0e-5, 1.0e05]hdata
- An array with three elements. Upon return it will have the min, average, and max step size (in that order).- Returns:
- the swim result
- Throws:
SwimZException
-
adaptiveRK
public int adaptiveRK(int Q, double p, SwimZStateVector start, SwimZStateVector stop, double zf, double stepSize, double[] hdata) throws SwimZException Swim to a fixed z using RK adaptive stepsize- Parameters:
Q
- the integer charge of the particle (-1 for electron)p
- the momentum in Gev/cstart
- the starting state vectorstop
- will hold the final state vectorzf
- the final z valuestepSize
- the initial step sizehdata
- An array with three elements. Upon return it will have the min, average, and max step size (in that order).- Returns:
- the number of steps
- Throws:
SwimZException
-
parabolicEstimate
public void parabolicEstimate(int Q, double p, SwimZStateVector start, SwimZStateVector stop, double zf) throws SwimZException Swim to a fixed z over short distances using a parabolic estimate, without intermediate points- Parameters:
Q
- the integer charge of the particle (-1 for electron)p
- the momentum in GeV/cstart
- the starting state vectorstop
- at end, holds final state vectorzf
- the final z value (cm)- Throws:
SwimZException
-
parabolicEstimate
public SwimZResult parabolicEstimate(int Q, double p, SwimZStateVector start, double zf, double stepSize) throws SwimZException Swim to a fixed z over short distances using a parabolic estimate- Parameters:
Q
- the integer charge of the particle (-1 for electron)p
- the momentum in GeV/cstart
- the starting state vectorzf
- the final z value (cm)stepSize
- the step size- Returns:
- the swim result
- Throws:
SwimZException
-