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 -
Constructor Summary
ConstructorsConstructorDescriptionTwissParameters(double longiPos, PhaseSpaceEllipse hEllipse, PhaseSpaceEllipse vEllipse, double muH, double muV, double dispH, double dispV, double dispPrimeH, double dispPrimeV, double dpOp) Creates an instance of aTwissParametersrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic TwissParameters.Builderbuilder()doubledispH()Returns the value of thedispHrecord component.doubleReturns the value of thedispPrimeHrecord component.doubleReturns the value of thedispPrimeVrecord component.doubledispV()Returns the value of thedispVrecord component.doubledpOp()Returns the value of thedpOprecord component.final booleanIndicates whether some other object is "equal to" this one.static StringgetHeaderString(boolean withBeamSize) Header info, useful when writing this object into a filegetPhaseSpaceCoordinates(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.doubledoublefinal inthashCode()Returns a hash code value for this object.hEllipse()Returns the value of thehEllipserecord component.doublelongiPos()Returns the value of thelongiPosrecord component.doublemuH()Returns the value of themuHrecord component.doublemuV()Returns the value of themuVrecord component.static voidPrints the given Twiss parameterstoString()Returns a string representation of this record class.vEllipse()Returns the value of thevEllipserecord component.
-
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 aTwissParametersrecord class.- Parameters:
longiPos- the value for thelongiPosrecord componenthEllipse- the value for thehEllipserecord componentvEllipse- the value for thevEllipserecord componentmuH- the value for themuHrecord componentmuV- the value for themuVrecord componentdispH- the value for thedispHrecord componentdispV- the value for thedispVrecord componentdispPrimeH- the value for thedispPrimeHrecord componentdispPrimeV- the value for thedispPrimeVrecord componentdpOp- the value for thedpOprecord component
-
-
Method Details
-
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
Prints the given Twiss parameters- Parameters:
twp- The Twiss parameters- Throws:
IOException
-
getHeaderString
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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
longiPos
public double longiPos()Returns the value of thelongiPosrecord component.- Returns:
- the value of the
longiPosrecord component
-
hEllipse
Returns the value of thehEllipserecord component.- Returns:
- the value of the
hEllipserecord component
-
vEllipse
Returns the value of thevEllipserecord component.- Returns:
- the value of the
vEllipserecord component
-
muH
public double muH()Returns the value of themuHrecord component.- Returns:
- the value of the
muHrecord component
-
muV
public double muV()Returns the value of themuVrecord component.- Returns:
- the value of the
muVrecord component
-
dispH
public double dispH()Returns the value of thedispHrecord component.- Returns:
- the value of the
dispHrecord component
-
dispV
public double dispV()Returns the value of thedispVrecord component.- Returns:
- the value of the
dispVrecord component
-
dispPrimeH
public double dispPrimeH()Returns the value of thedispPrimeHrecord component.- Returns:
- the value of the
dispPrimeHrecord component
-
dispPrimeV
public double dispPrimeV()Returns the value of thedispPrimeVrecord component.- Returns:
- the value of the
dispPrimeVrecord component
-
dpOp
public double dpOp()Returns the value of thedpOprecord component.- Returns:
- the value of the
dpOprecord component
-