Package cnuphys.adaptiveSwim
Class AdaptiveSwimResult
java.lang.Object
cnuphys.adaptiveSwim.AdaptiveSwimResult
-
Constructor Summary
ConstructorsConstructorDescriptionAdaptiveSwimResult
(boolean saveTrajectory) Create a container for the swim results for default of 6D state vectorAdaptiveSwimResult
(int dim, boolean saveTrajectory) Create a container for the swim results -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the Euclidean distance between the last point of two results.double
finalDeltaZ
(double zTarg) Used for testing z swim.A final location stringdouble
get the final phi in degreesdouble
get the final rho in metersdouble
Get the final path length of the swimint
Get the final sector of the swimdouble
get the final theta in degreesint
Get the initial sector of the swimGet the initial valuesdouble[]
Gets the last trajectory point if the trajectory was saved.int
getNStep()
Get the number of steps of the swimint
Get the status of the swimGet the trajectorydouble[]
getUf()
Get the final state vector, usually [x, y, x, px/p, py/p, pz/p] where x, y, z are in meters.boolean
Does this result hold a trajectory?A string containing the initial valiesvoid
printOut
(PrintStream ps, String message) Print the result to a print stream, such as System.out.void
printOut
(PrintStream ps, String message, boolean printTrajectory) Print the result to a print stream, such as System.outretrace()
Get the "initial values" that allows a retrace.void
setFinalS
(double finalS) Set the final path length of the swimvoid
Set the initial valuesvoid
setInitialValues
(int q, double xo, double yo, double zo, double p, double theta, double phi) Set the initial valuesvoid
setNStep
(int nStep) Set the number of steps of the swimvoid
setStatus
(int status) Set the status of the swimvoid
setTrajectory
(SwimTrajectory traj) Used to compare to old swimmervoid
setUf
(double[] uf) Set the final state vector, usually [x, y, x, px/p, py/p, pz/p] where x, y, z are in meterstoString()
-
Constructor Details
-
AdaptiveSwimResult
public AdaptiveSwimResult(boolean saveTrajectory) Create a container for the swim results for default of 6D state vector- Parameters:
saveTrajectory
- if true, we will save the trajectory
-
AdaptiveSwimResult
public AdaptiveSwimResult(int dim, boolean saveTrajectory) Create a container for the swim results- Parameters:
dim
- the dimension of the system (probably 6)saveTrajectory
- if true, we will save the trajectory
-
-
Method Details
-
hasTrajectory
public boolean hasTrajectory()Does this result hold a trajectory?- Returns:
true
if there is a trajectory
-
getTrajectory
Get the trajectory- Returns:
- the trajectory (might be
null
-
getUf
public double[] getUf()Get the final state vector, usually [x, y, x, px/p, py/p, pz/p] where x, y, z are in meters. This final vector is never augmented. To get the augmented, assume the trajectory was created, use getLastTrajectoryPoint.- Returns:
- the final state vector, always with six elements.
-
getLastTrajectoryPoint
public double[] getLastTrajectoryPoint()Gets the last trajectory point if the trajectory was saved. This should be augmented with pathlength and bdl in indices 6 and 7. Otherwise return the usual six element final state vector.- Returns:
- last trajectory point
-
setUf
public void setUf(double[] uf) Set the final state vector, usually [x, y, x, px/p, py/p, pz/p] where x, y, z are in meters- Parameters:
uf
- the final state vector
-
getNStep
public int getNStep()Get the number of steps of the swim- Returns:
- the number of steps
-
setNStep
public void setNStep(int nStep) Set the number of steps of the swim- Parameters:
nStep
- the number of steps
-
getFinalS
public double getFinalS()Get the final path length of the swim- Returns:
- the final path length in meters
-
setFinalS
public void setFinalS(double finalS) Set the final path length of the swim- Parameters:
finalS
- the final path length in meters
-
setStatus
public void setStatus(int status) Set the status of the swim- Parameters:
status
- the status of the swim
-
getStatus
public int getStatus()Get the status of the swim- Returns:
- the status
-
setInitialValues
public void setInitialValues(int q, double xo, double yo, double zo, double p, double theta, double phi) Set the initial values- Parameters:
q
- The integer chargexo
- The x coordinate of the vertex in metersyo
- The y coordinate of the vertex in meterszo
- The z coordinate of the vertex in metersp
- The momentum in GeV/ctheta
- The polar angle in degreesphi
- The azimuthal angle in degrees
-
initialValuesString
A string containing the initial valies- Returns:
-
setInitialValies
Set the initial values- Parameters:
iv
- the source
-
setTrajectory
Used to compare to old swimmer- Parameters:
traj
- trajectory (probably from old swimmer)
-
getInitialValues
Get the initial values- Returns:
- the initial values
-
printOut
Print the result to a print stream, such as System.out. Do not print the trajectory.- Parameters:
ps
- the print streammessage
- a header message
-
printOut
Print the result to a print stream, such as System.out- Parameters:
ps
- the print streammessage
- a header messageprintTrajectory
- if true, will print the trajectory (if there is one)
-
toString
-
finalLocationString
A final location string- Returns:
- a location string
-
getFinalSector
public int getFinalSector()Get the final sector of the swim- Returns:
- the final CLAS sector [1..6]
-
getInitialSector
public int getInitialSector()Get the initial sector of the swim- Returns:
- the final CLAS sector [1..6], or -1 if the initial values were not cached
-
getFinalTheta
public double getFinalTheta()get the final theta in degrees- Returns:
- the final theta in degrees
-
getFinalRho
public double getFinalRho()get the final rho in meters- Returns:
- the final rho in meters
-
getFinalPhi
public double getFinalPhi()get the final phi in degrees- Returns:
- the final phi in degrees
-
finalDeltaZ
public double finalDeltaZ(double zTarg) Used for testing z swim.- Parameters:
zTarg
- the target z (m)- Returns:
- the signed difference zFinal - zTarg
-
retrace
Get the "initial values" that allows a retrace. This is used mostly for testing. Assumes the initial values have been set,- Returns:
- the "initial values" that allows a retrace.
-
delDifference
Get the Euclidean distance between the last point of two results. Used for comparisons.- Parameters:
res
- the other result- Returns:
- the Euclidean distance between the last points.
-