Package cnuphys.swim
Class BeamLineStopper
java.lang.Object
cnuphys.swim.BeamLineStopper
- All Implemented Interfaces:
- IStopper
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiondoubleGet the final path length in metersvoidsetFinalT(double finalPathLength) Set the final path length in metersbooleanstopIntegration(double t, double[] y) Given the current state of the integration, should we stop?static double[]SwimToBeamLine(int charge, double xo, double yo, double zo, double pTot, double theta, double phi, double maxS, double stepSize, double distBetweenSaves, double xB, double yB) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface cnuphys.rk4.IStopperterminateIntegration
- 
Constructor Details- 
BeamLineStopperpublic BeamLineStopper(double xB, double yB) 
 
- 
- 
Method Details- 
stopIntegrationpublic boolean stopIntegration(double t, double[] y) Description copied from interface:IStopperGiven the current state of the integration, should we stop? This allows the integration to stop, for example, if some distance from the origin has been exceeded or if the independent variable passes some threshold. It won't be precise, because the check may not happen on every step, but it should be close.- Specified by:
- stopIntegrationin interface- IStopper
- Parameters:
- t- the current value of the independent variable (typically pathlength)
- y- the current state vector (typically [x, y, z, vx, vy, vz])
- Returns:
- trueif we should stop now.
 
- 
getFinalTpublic double getFinalT()Get the final path length in meters
- 
setFinalTpublic void setFinalT(double finalPathLength) Set the final path length in meters
- 
SwimToBeamLinepublic static double[] SwimToBeamLine(int charge, double xo, double yo, double zo, double pTot, double theta, double phi, double maxS, double stepSize, double distBetweenSaves, double xB, double yB) - Parameters:
- charge-
- charge- the charge: -1 for electron, 1 for proton, etc
- xo- the x vertex position in meters
- yo- the y vertex position in meters
- zo- the z vertex position in meters
- pTot- momentum in GeV/c
- theta- initial polar angle in degrees
- phi- initial azimuthal angle in degrees
- maxS- max path length in meters. This determines the max number of steps based on the step size. If a stopper is used, the integration might terminate before all the steps are taken. A reasonable value for CLAS is 8. meters
- stepSize- the uniform step size in meters.
- distBetweenSaves- this distance is in meters. It should be bigger than stepSize. It is approximately the distance between "saves" where the point is saved in a trajectory for later drawing.
- xB- max x distance to be considered on beam line (m)
- yB- max y distance to be considered on beam line (m)
- Returns:
- final state vector
 
 
-