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 SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionTwissParameters(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 SummaryModifier 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- 
TwissParameterspublic 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 the- longiPosrecord component
- hEllipse- the value for the- hEllipserecord component
- vEllipse- the value for the- vEllipserecord component
- muH- the value for the- muHrecord component
- muV- the value for the- muVrecord component
- dispH- the value for the- dispHrecord component
- dispV- the value for the- dispVrecord component
- dispPrimeH- the value for the- dispPrimeHrecord component
- dispPrimeV- the value for the- dispPrimeVrecord component
- dpOp- the value for the- dpOprecord component
 
 
- 
- 
Method Details- 
builder
- 
getPhaseSpaceCoordinatespublic 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.
 
- 
printTwissPrints the given Twiss parameters- Parameters:
- twp- The Twiss parameters
- Throws:
- IOException
 
- 
getHeaderStringHeader 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.
 
- 
getSigmaHpublic double getSigmaH()- Returns:
- The horizontal beam size in [m] .If the dpOp is not set, it will return infinity.
 
- 
getSigmaVpublic double getSigmaV()- Returns:
- The vertical beam size in [m] .If the dpOp is not set, it will return infinity.
 
- 
toStringReturns 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.
- 
hashCodepublic 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.
- 
equalsIndicates 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 '=='.
- 
longiPospublic double longiPos()Returns the value of thelongiPosrecord component.- Returns:
- the value of the longiPosrecord component
 
- 
hEllipseReturns the value of thehEllipserecord component.- Returns:
- the value of the hEllipserecord component
 
- 
vEllipseReturns the value of thevEllipserecord component.- Returns:
- the value of the vEllipserecord component
 
- 
muHpublic double muH()Returns the value of themuHrecord component.- Returns:
- the value of the muHrecord component
 
- 
muVpublic double muV()Returns the value of themuVrecord component.- Returns:
- the value of the muVrecord component
 
- 
dispHpublic double dispH()Returns the value of thedispHrecord component.- Returns:
- the value of the dispHrecord component
 
- 
dispVpublic double dispV()Returns the value of thedispVrecord component.- Returns:
- the value of the dispVrecord component
 
- 
dispPrimeHpublic double dispPrimeH()Returns the value of thedispPrimeHrecord component.- Returns:
- the value of the dispPrimeHrecord component
 
- 
dispPrimeVpublic double dispPrimeV()Returns the value of thedispPrimeVrecord component.- Returns:
- the value of the dispPrimeVrecord component
 
- 
dpOppublic double dpOp()Returns the value of thedpOprecord component.- Returns:
- the value of the dpOprecord component
 
 
-