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 SummaryFieldsModifier and TypeFieldDescriptionstatic final doubleArgon radiation length in cmstatic final doubleThe speed of light in these units: (GeV/c)(1/kG)(1/cm)
- 
Constructor SummaryConstructorsConstructorDescriptionSwimZ()SwimZ constructor.Create a swimmer specific to a magnetic fieldSwimZ(MagneticField magneticField) Create a swimmer specific to a magnetic field
- 
Method SummaryModifier 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 stepsizeintadaptiveRK(int Q, double p, SwimZStateVector start, SwimZStateVector stop, double zf, double stepSize, double[] hdata) Swim to a fixed z using RK adaptive stepsizedoublegetEps()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 estimatevoidparabolicEstimate(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 stepsizevoidsetAbsoluteTolerance(double eps) Set the tolerance used by the CLAS_Tolerance array
- 
Field Details- 
Cpublic static final double CThe speed of light in these units: (GeV/c)(1/kG)(1/cm)- See Also:
 
- 
ARGONRADLENpublic static final double ARGONRADLENArgon radiation length in cm- See Also:
 
 
- 
- 
Constructor Details- 
SwimZpublic SwimZ()SwimZ constructor. Here we create a Swimmer that will use the given magnetic field.- Parameters:
- field- interface into a magnetic field
 
- 
SwimZCreate a swimmer specific to a magnetic field- Parameters:
- magneticField- the magnetic field
 
- 
SwimZCreate a swimmer specific to a magnetic field- Parameters:
- magneticField- the magnetic field
 
 
- 
- 
Method Details- 
getProbeGet the underlying field probe- Returns:
- the probe
 
- 
setAbsoluteTolerancepublic void setAbsoluteTolerance(double eps) Set the tolerance used by the CLAS_Tolerance array- Parameters:
- eps- the baseline absolute tolerance.
 
- 
getEpspublic double getEps()Get the tolerance used by the CLAS_Toleance array- Returns:
- the tolerance used by the CLAS_Toleance array
 
- 
adaptiveRKpublic 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/c
- start- the starting state vector
- zf- the final z value (cm)
- stepSize- the initial step size
- relTolerance- 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
 
- 
sectorAdaptiveRKpublic 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/c
- start- the starting state vector
- zf- the final z value (cm)
- stepSize- the initial step size
- relTolerance- 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
 
- 
adaptiveRKpublic 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/c
- start- the starting state vector
- stop- will hold the final state vector
- zf- the final z value
- stepSize- the initial step size
- hdata- 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
 
- 
parabolicEstimatepublic 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/c
- start- the starting state vector
- stop- at end, holds final state vector
- zf- the final z value (cm)
- Throws:
- SwimZException
 
- 
parabolicEstimatepublic 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/c
- start- the starting state vector
- zf- the final z value (cm)
- stepSize- the step size
- Returns:
- the swim result
- Throws:
- SwimZException
 
 
-