Package cnuphys.swim

Class BeamLineStopper

java.lang.Object
cnuphys.swim.BeamLineStopper
All Implemented Interfaces:
IStopper

public class BeamLineStopper extends Object implements IStopper
  • Constructor Summary

    Constructors
    Constructor
    Description
    BeamLineStopper(double xB, double yB)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Get the final path length in meters
    void
    setFinalT(double finalPathLength)
    Set the final path length in meters
    boolean
    stopIntegration(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.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface cnuphys.rk4.IStopper

    terminateIntegration
  • Constructor Details

    • BeamLineStopper

      public BeamLineStopper(double xB, double yB)
  • Method Details

    • stopIntegration

      public boolean stopIntegration(double t, double[] y)
      Description copied from interface: IStopper
      Given 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:
      stopIntegration in 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:
      true if we should stop now.
    • getFinalT

      public double getFinalT()
      Get the final path length in meters
      Specified by:
      getFinalT in interface IStopper
      Returns:
      the final path length in meters
    • setFinalT

      public void setFinalT(double finalPathLength)
      Set the final path length in meters
      Specified by:
      setFinalT in interface IStopper
      Parameters:
      finalPathLength - the final path length in meters
    • SwimToBeamLine

      public 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