Class InitialValues

java.lang.Object
cnuphys.adaptiveSwim.test.InitialValues

public class InitialValues extends Object
Hold the initial values of a swim
Author:
heddle
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The integer charge
    double
    The momentum in GeV/c
    double
    The azimuthal angle in degrees
    double
    The polar angle in degrees
    double
    The coordinate x of the vertex in meters
    double
    The y coordinate of the vertex in meters
    double
    The z coordinate of the vertex in meters
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    InitialValues(int charge, double xo, double yo, double zo, double p, double theta, double phi)
    Store the initial conditions of a swim
    Copy constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    static InitialValues[]
    getInitialValues(Random rand, int num, int charge, boolean randCharge, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double pmin, double pmax, double thetamin, double thetamax, double phimin, double phimax)
    For setting up an array of initial values for testing.
    static void
    randomInitVal(Random rand, InitialValues initVal, int charge, boolean randCharge, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double pmin, double pmax, double thetamin, double thetamax, double phimin, double phimax)
    For setting up an array of initial values for testing.
     
     

    Methods inherited from class java.lang.Object

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

    • charge

      public int charge
      The integer charge
    • xo

      public double xo
      The coordinate x of the vertex in meters
    • yo

      public double yo
      The y coordinate of the vertex in meters
    • zo

      public double zo
      The z coordinate of the vertex in meters
    • p

      public double p
      The momentum in GeV/c
    • theta

      public double theta
      The polar angle in degrees
    • phi

      public double phi
      The azimuthal angle in degrees
  • Constructor Details

    • InitialValues

      public InitialValues()
    • InitialValues

      public InitialValues(int charge, double xo, double yo, double zo, double p, double theta, double phi)
      Store the initial conditions of a swim
      Parameters:
      charge - The integer charge
      xo - The x coordinate of the vertex in meters
      yo - The y coordinate of the vertex in meters
      zo - The z coordinate of the vertex in meters
      p - The momentum in GeV/c
      theta - The polar angle in degrees
      phi - The azimuthal angle in degrees
    • InitialValues

      public InitialValues(InitialValues src)
      Copy constructor
      Parameters:
      src - the source initial values
  • Method Details

    • toStringRaw

      public String toStringRaw()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getInitialValues

      public static InitialValues[] getInitialValues(Random rand, int num, int charge, boolean randCharge, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double pmin, double pmax, double thetamin, double thetamax, double phimin, double phimax)
      For setting up an array of initial values for testing. In cases where the difference between a min val and a max val is < SMALL, the min val is used and the variable is no randomized.
      Parameters:
      rand - and random number generator
      num - the number to create
      charge - the integer charge
      randCharge - if true the charge will be 1 or -1 randomly
      xmin - minimum value of the x coordinate in meters
      xmax - maximum value of the x coordinate in meters
      ymin - minimum value of the y coordinate in meters
      ymax - maximum value of the y coordinate in meters
      zmin - minimum value of the z coordinate in meters
      zmax - maximum value of the z coordinate in meters
      pmin - minimum value of the momentum in GeV/c
      pmax - maximum value of the momentum in GeV/c
      thetamin - minimum value of the polar angle in degrees
      thetamax - maximum value of the polar angle in degrees
      phimin - minimum value of the azimuthal angle in degrees
      phimax - maximum value of the azimuthal angle in degrees
      Returns:
      an array of initial values
    • randomInitVal

      public static void randomInitVal(Random rand, InitialValues initVal, int charge, boolean randCharge, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double pmin, double pmax, double thetamin, double thetamax, double phimin, double phimax)
      For setting up an array of initial values for testing. In cases where the difference between a min val and a max val is < SMALL, the min val is used and the variable is no randomized.
      Parameters:
      rand - and random number generator
      initVal - the object to fill with random values
      charge - the integer charge
      randCharge - if true the charge will be 1 or -1 randomly
      xmin - minimum value of the x coordinate in meters
      xmax - maximum value of the x coordinate in meters
      ymin - minimum value of the y coordinate in meters
      ymax - maximum value of the y coordinate in meters
      zmin - minimum value of the z coordinate in meters
      zmax - maximum value of the z coordinate in meters
      pmin - minimum value of the momentum in GeV/c
      pmax - maximum value of the momentum in GeV/c
      thetamin - minimum value of the polar angle in degrees
      thetamax - maximum value of the polar angle in degrees
      phimin - minimum value of the azimuthal angle in degrees
      phimax - maximum value of the azimuthal angle in degrees