Class AdaptiveSwimmer

java.lang.Object
cnuphys.adaptiveSwim.AdaptiveSwimmer

public class AdaptiveSwimmer extends Object
A swimmer for adaptive stepsize integrators. These swimmers are not thread safe. Every thread that needs an AdaptiveSwimmer should create its own.
Author:
heddle
  • Field Summary Link icon

    Fields
    Modifier and Type
    Field
    Description
    static final double
     
    static final int
    A swim was requested for a particle with extremely low momentum
    static final int
    The swim was a success
    static final int
    A target, such as a target rho or z, was not reached before the swim was stopped for some other reason
  • Constructor Summary Link icon

    Constructors
    Constructor
    Description
    Create a swimmer using the current active field
    AdaptiveSwimmer(cnuphys.magfield.IMagField magneticField)
    Create a swimmer specific to a magnetic field
    AdaptiveSwimmer(cnuphys.magfield.MagneticField magneticField)
    Create a swimmer specific to a magnetic field
  • Method Summary Link icon

    Modifier and Type
    Method
    Description
    cnuphys.magfield.FieldProbe
    Get the probe being used to swim
    void
    sectorSwimZ(int sector, int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double targetZ, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result)
    Swims a charged particle in a sector coordinate system.
    void
    swim(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double sf, double h0, double eps, AdaptiveSwimResult result)
    Swim using the current active field.
    void
    swimCylinder(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Cylinder targetCylinder, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result)
    Swim to an arbitrary infinitely long cylinder using the current active field
    void
    swimLine(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Line targetLine, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result)
    Swim to an arbitrary infinitely long line using the current active field
    void
    swimPlane(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Plane targetPlane, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result)
    Swim to a plane using the current active field
    void
    swimRho(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double targetRho, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result)
    Swim to a fixed rho using the current active field
    void
    swimS(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result)
    Swim to a definite pathlength.
    void
    swimSphere(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Sphere targetSphere, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result)
    Swim to an arbitrary sphere using the current active field
    void
    swimZ(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double targetZ, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result)
    Swim to a fixed z using the current active field

    Methods inherited from class java.lang.Object Link icon

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details Link icon

    • SWIM_SUCCESS Link icon

      public static final int SWIM_SUCCESS
      The swim was a success
      See Also:
    • SWIM_TARGET_MISSED Link icon

      public static final int SWIM_TARGET_MISSED
      A target, such as a target rho or z, was not reached before the swim was stopped for some other reason
      See Also:
    • SWIM_BELOW_MIN_P Link icon

      public static final int SWIM_BELOW_MIN_P
      A swim was requested for a particle with extremely low momentum
      See Also:
    • MINMOMENTUM Link icon

      public static final double MINMOMENTUM
      See Also:
  • Constructor Details Link icon

    • AdaptiveSwimmer Link icon

      public AdaptiveSwimmer()
      Create a swimmer using the current active field
    • AdaptiveSwimmer Link icon

      public AdaptiveSwimmer(cnuphys.magfield.MagneticField magneticField)
      Create a swimmer specific to a magnetic field
      Parameters:
      magneticField - the magnetic field
    • AdaptiveSwimmer Link icon

      public AdaptiveSwimmer(cnuphys.magfield.IMagField magneticField)
      Create a swimmer specific to a magnetic field
      Parameters:
      magneticField - the magnetic field
  • Method Details Link icon

    • getProbe Link icon

      public cnuphys.magfield.FieldProbe getProbe()
      Get the probe being used to swim
      Returns:
      the probe
    • swim Link icon

      public void swim(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException
      Swim using the current active field. This swimmer has no target. It will stop when the pathlength exceeds the maximum. For a more precise pathlength swim, use swimS.
      Parameters:
      charge - in integer units of e
      xo - the x vertex position in meters
      yo - the y vertex position in meters
      zo - the z vertex position in meters
      momentum - the momentum in GeV/c
      theta - the initial polar angle in degrees
      phi - the initial azimuthal angle in degrees
      sf - the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopper
      h0 - the initial stepsize in meters
      eps - the overall fractional tolerance (e.g., 1.0e-5)
      result - the container for some of the swimming results
      Throws:
      AdaptiveSwimException
    • swimS Link icon

      public void swimS(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException
      Swim to a definite pathlength. If extreme accuracy is not needed, use swim instead.
      Parameters:
      charge - in integer units of e
      xo - the x vertex position in meters
      yo - the y vertex position in meters
      zo - the z vertex position in meters
      momentum - the momentum in GeV/c
      theta - the initial polar angle in degrees
      phi - the initial azimuthal angle in degrees
      accuracy - the requested accuracy for the target pathlength in meters
      sf - the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopper
      h0 - the initial stepsize in meters
      eps - the overall fractional tolerance (e.g., 1.0e-5)
      result - the container for some of the swimming results
      Throws:
      AdaptiveSwimException
    • sectorSwimZ Link icon

      public void sectorSwimZ(int sector, int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double targetZ, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException
      Swims a charged particle in a sector coordinate system. This swims to a fixed z value. THIS IS ONLY VALID IF THE FIELD IS A RotatedComnpositeField or RotatedCompositeProbe
      Parameters:
      sector - the sector [1..6]
      charge - in integer units of e
      xo - the x vertex position in meters
      yo - the y vertex position in meters
      zo - the z vertex position in meters
      momentum - the momentum in GeV/c
      theta - the initial polar angle in degrees
      phi - the initial azimuthal angle in degrees
      targetZ - the target z in meters
      accuracy - the requested accuracy for the target z in meters
      sf - the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopper
      h0 - the initial stepsize in meters
      eps - the overall fractional tolerance (e.g., 1.0e-5)
      result - the container for some of the swimming results
      Throws:
      AdaptiveSwimException
    • swimZ Link icon

      public void swimZ(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double targetZ, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException
      Swim to a fixed z using the current active field
      Parameters:
      charge - in integer units of e
      xo - the x vertex position in meters
      yo - the y vertex position in meters
      zo - the z vertex position in meters
      momentum - the momentum in GeV/c
      theta - the initial polar angle in degrees
      phi - the initial azimuthal angle in degrees
      targetZ - the target z in meters
      accuracy - the requested accuracy for the target z in meters
      sf - the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopper
      h0 - the initial stepsize in meters
      eps - the overall fractional tolerance (e.g., 1.0e-5)
      result - the container for some of the swimming results
      Throws:
      AdaptiveSwimException
    • swimRho Link icon

      public void swimRho(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, double targetRho, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException
      Swim to a fixed rho using the current active field
      Parameters:
      charge - in integer units of e
      xo - the x vertex position in meters
      yo - the y vertex position in meters
      zo - the z vertex position in meters
      momentum - the momentum in GeV/c
      theta - the initial polar angle in degrees
      phi - the initial azimuthal angle in degrees
      targetRho - the target rho in meters
      accuracy - the requested accuracy for the target rho in meters
      sf - the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopper
      h0 - the initial stepsize in meters
      eps - the overall fractional tolerance (e.g., 1.0e-5)
      result - the container for some of the swimming results
      Throws:
      AdaptiveSwimException
    • swimPlane Link icon

      public void swimPlane(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Plane targetPlane, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException
      Swim to a plane using the current active field
      Parameters:
      charge - in integer units of e
      xo - the x vertex position in meters
      yo - the y vertex position in meters
      zo - the z vertex position in meters
      momentum - the momentum in GeV/c
      theta - the initial polar angle in degrees
      phi - the initial azimuthal angle in degrees
      targetPlane - the target plane
      accuracy - the requested accuracy for the final distance to the plane in meters
      sf - the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopper
      h0 - the initial stepsize in meters
      eps - the overall fractional tolerance (e.g., 1.0e-5)
      result - the container for some of the swimming results
      Throws:
      AdaptiveSwimException
    • swimSphere Link icon

      public void swimSphere(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Sphere targetSphere, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException
      Swim to an arbitrary sphere using the current active field
      Parameters:
      charge - in integer units of e
      xo - the x vertex position in meters
      yo - the y vertex position in meters
      zo - the z vertex position in meters
      momentum - the momentum in GeV/c
      theta - the initial polar angle in degrees
      phi - the initial azimuthal angle in degrees
      targetSphere - the target sphere
      accuracy - the requested accuracy for the target rho in meters
      sf - the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopper
      h0 - the initial stepsize in meters
      eps - the overall fractional tolerance (e.g., 1.0e-5)
      result - the container for some of the swimming results
      Throws:
      AdaptiveSwimException
    • swimCylinder Link icon

      public void swimCylinder(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Cylinder targetCylinder, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException
      Swim to an arbitrary infinitely long cylinder using the current active field
      Parameters:
      charge - in integer units of e
      xo - the x vertex position in meters
      yo - the y vertex position in meters
      zo - the z vertex position in meters
      momentum - the momentum in GeV/c
      theta - the initial polar angle in degrees
      phi - the initial azimuthal angle in degrees
      targetCylinder - the target cylinder
      accuracy - the requested accuracy for the target rho in meters
      sf - the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopper
      h0 - the initial stepsize in meters
      eps - the overall fractional tolerance (e.g., 1.0e-5)
      result - the container for some of the swimming results
      Throws:
      AdaptiveSwimException
    • swimLine Link icon

      public void swimLine(int charge, double xo, double yo, double zo, double momentum, double theta, double phi, Line targetLine, double accuracy, double sf, double h0, double eps, AdaptiveSwimResult result) throws AdaptiveSwimException
      Swim to an arbitrary infinitely long line using the current active field
      Parameters:
      charge - in integer units of e
      xo - the x vertex position in meters
      yo - the y vertex position in meters
      zo - the z vertex position in meters
      momentum - the momentum in GeV/c
      theta - the initial polar angle in degrees
      phi - the initial azimuthal angle in degrees
      targetLine - the target line
      accuracy - the requested accuracy for the target rho in meters
      sf - the final (max) value of the independent variable (pathlength) unless the integration is terminated by the stopper
      h0 - the initial stepsize in meters
      eps - the overall fractional tolerance (e.g., 1.0e-5)
      result - the container for some of the swimming results
      Throws:
      AdaptiveSwimException