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 TypeMethodDescriptiondoubleGet the Euclidean distance between the last point of two results.doublefinalDeltaZ(double zTarg) Used for testing z swim.A final location stringdoubleget the final phi in degreesdoubleget the final rho in metersdoubleGet the final path length of the swimintGet the final sector of the swimdoubleget the final theta in degreesintGet the initial sector of the swimGet the initial valuesdouble[]Gets the last trajectory point if the trajectory was saved.intgetNStep()Get the number of steps of the swimintGet 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.booleanDoes this result hold a trajectory?A string containing the initial valiesvoidprintOut(PrintStream ps, String message) Print the result to a print stream, such as System.out.voidprintOut(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.voidsetFinalS(double finalS) Set the final path length of the swimvoidSet the initial valuesvoidsetInitialValues(int q, double xo, double yo, double zo, double p, double theta, double phi) Set the initial valuesvoidsetNStep(int nStep) Set the number of steps of the swimvoidsetStatus(int status) Set the status of the swimvoidsetTrajectory(SwimTrajectory traj) Used to compare to old swimmervoidsetUf(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:
trueif there is a trajectory
-
getTrajectory
-
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
-
setInitialValies
-
setTrajectory
Used to compare to old swimmer- Parameters:
traj- trajectory (probably from old swimmer)
-
getInitialValues
-
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
-
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.
-