Module simpa.acc
Package simpa.acc.api

Record Class TwissParameters

java.lang.Object
java.lang.Record
simpa.acc.api.TwissParameters

public record TwissParameters(double longiPos, PhaseSpaceEllipse hEllipse, PhaseSpaceEllipse vEllipse, double muH, double muV, double dispH, double dispV, double dispPrimeH, double dispPrimeV, double dpOp) extends Record
Record to hold the Twiss parameters. The constructor should not be called directly, because this record likely to be extended. Use the builder() to construct an instance.
Author:
lbojtar
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    TwissParameters(double longiPos, PhaseSpaceEllipse hEllipse, PhaseSpaceEllipse vEllipse, double muH, double muV, double dispH, double dispV, double dispPrimeH, double dispPrimeV, double dpOp)
    Creates an instance of a TwissParameters record class.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    double
    Returns the value of the dispH record component.
    double
    Returns the value of the dispPrimeH record component.
    double
    Returns the value of the dispPrimeV record component.
    double
    Returns the value of the dispV record component.
    double
    Returns the value of the dpOp record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    static String
    getHeaderString(boolean withBeamSize)
    Header info, useful when writing this object into a file
    getPhaseSpaceCoordinates(double hEm, double hPhi, double vEm, double vPhi, double z, double dpOp)
    Gets the 5D phase space coordinates on the phase space ellipse defined by the given emittances, phase and the Twiss parameters of this instance.
    double
     
    double
     
    final int
    Returns a hash code value for this object.
    Returns the value of the hEllipse record component.
    double
    Returns the value of the longiPos record component.
    double
    muH()
    Returns the value of the muH record component.
    double
    muV()
    Returns the value of the muV record component.
    static void
    Prints the given Twiss parameters
    Returns a string representation of this record class.
    Returns the value of the vEllipse record component.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • TwissParameters

      public TwissParameters(double longiPos, PhaseSpaceEllipse hEllipse, PhaseSpaceEllipse vEllipse, double muH, double muV, double dispH, double dispV, double dispPrimeH, double dispPrimeV, double dpOp)
      Creates an instance of a TwissParameters record class.
      Parameters:
      longiPos - the value for the longiPos record component
      hEllipse - the value for the hEllipse record component
      vEllipse - the value for the vEllipse record component
      muH - the value for the muH record component
      muV - the value for the muV record component
      dispH - the value for the dispH record component
      dispV - the value for the dispV record component
      dispPrimeH - the value for the dispPrimeH record component
      dispPrimeV - the value for the dispPrimeV record component
      dpOp - the value for the dpOp record component
  • Method Details

    • builder

      public static TwissParameters.Builder builder()
    • getPhaseSpaceCoordinates

      public PhaseSpaceCoordinates getPhaseSpaceCoordinates(double hEm, double hPhi, double vEm, double vPhi, double z, double dpOp)
      Gets the 5D phase space coordinates on the phase space ellipse defined by the given emittances, phase and the Twiss parameters of this instance. The longitudinal z coordinate is zero, but z' which is the dpOp is taken into account. The phase space coordinates are calculated for example in the H plane as: x = a * sin(hPhi)+Cx x' = b * cos(hPhi)+Cy where a and b are the radiuses of the ellipse and Cx and Cy are the coordinates of the center point in the phase space.
      Parameters:
      hEm - Hor. emittance [pi*mm*mrad]
      hPhi - Angle for the H plane. [radians]
      vEm - Vert. emittance [pi*mm*mrad]
      vPhi - Angle for the H plane. [radians]
      z - Longitudinal position [m] phase space coordinate.
      dpOp - Relative momentum deviation from the reference momentum.
      Returns:
      The phase space coordinates.
    • printTwiss

      public static void printTwiss(TwissParameters twp) throws IOException
      Prints the given Twiss parameters
      Parameters:
      twp - The Twiss parameters
      Throws:
      IOException
    • getHeaderString

      public static String getHeaderString(boolean withBeamSize)
      Header info, useful when writing this object into a file
      Parameters:
      withBeamSize - If true, the beam size will be included in the header.
      Returns:
      The header string.
    • getSigmaH

      public double getSigmaH()
      Returns:
      The horizontal beam size in [m] .If the dpOp is not set, it will return infinity.
    • getSigmaV

      public double getSigmaV()
      Returns:
      The vertical beam size in [m] .If the dpOp is not set, it will return infinity.
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • longiPos

      public double longiPos()
      Returns the value of the longiPos record component.
      Returns:
      the value of the longiPos record component
    • hEllipse

      public PhaseSpaceEllipse hEllipse()
      Returns the value of the hEllipse record component.
      Returns:
      the value of the hEllipse record component
    • vEllipse

      public PhaseSpaceEllipse vEllipse()
      Returns the value of the vEllipse record component.
      Returns:
      the value of the vEllipse record component
    • muH

      public double muH()
      Returns the value of the muH record component.
      Returns:
      the value of the muH record component
    • muV

      public double muV()
      Returns the value of the muV record component.
      Returns:
      the value of the muV record component
    • dispH

      public double dispH()
      Returns the value of the dispH record component.
      Returns:
      the value of the dispH record component
    • dispV

      public double dispV()
      Returns the value of the dispV record component.
      Returns:
      the value of the dispV record component
    • dispPrimeH

      public double dispPrimeH()
      Returns the value of the dispPrimeH record component.
      Returns:
      the value of the dispPrimeH record component
    • dispPrimeV

      public double dispPrimeV()
      Returns the value of the dispPrimeV record component.
      Returns:
      the value of the dispPrimeV record component
    • dpOp

      public double dpOp()
      Returns the value of the dpOp record component.
      Returns:
      the value of the dpOp record component