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 aTwissParameters
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic TwissParameters.Builder
builder()
double
dispH()
Returns the value of thedispH
record component.double
Returns the value of thedispPrimeH
record component.double
Returns the value of thedispPrimeV
record component.double
dispV()
Returns the value of thedispV
record component.double
dpOp()
Returns the value of thedpOp
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 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.double
double
final int
hashCode()
Returns a hash code value for this object.hEllipse()
Returns the value of thehEllipse
record component.double
longiPos()
Returns the value of thelongiPos
record component.double
muH()
Returns the value of themuH
record component.double
muV()
Returns the value of themuV
record component.static void
Prints the given Twiss parameterstoString()
Returns a string representation of this record class.vEllipse()
Returns the value of thevEllipse
record 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 aTwissParameters
record class.- Parameters:
longiPos
- the value for thelongiPos
record componenthEllipse
- the value for thehEllipse
record componentvEllipse
- the value for thevEllipse
record componentmuH
- the value for themuH
record componentmuV
- the value for themuV
record componentdispH
- the value for thedispH
record componentdispV
- the value for thedispV
record componentdispPrimeH
- the value for thedispPrimeH
record componentdispPrimeV
- the value for thedispPrimeV
record componentdpOp
- the value for thedpOp
record 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 thelongiPos
record component.- Returns:
- the value of the
longiPos
record component
-
hEllipse
Returns the value of thehEllipse
record component.- Returns:
- the value of the
hEllipse
record component
-
vEllipse
Returns the value of thevEllipse
record component.- Returns:
- the value of the
vEllipse
record component
-
muH
public double muH()Returns the value of themuH
record component.- Returns:
- the value of the
muH
record component
-
muV
public double muV()Returns the value of themuV
record component.- Returns:
- the value of the
muV
record component
-
dispH
public double dispH()Returns the value of thedispH
record component.- Returns:
- the value of the
dispH
record component
-
dispV
public double dispV()Returns the value of thedispV
record component.- Returns:
- the value of the
dispV
record component
-
dispPrimeH
public double dispPrimeH()Returns the value of thedispPrimeH
record component.- Returns:
- the value of the
dispPrimeH
record component
-
dispPrimeV
public double dispPrimeV()Returns the value of thedispPrimeV
record component.- Returns:
- the value of the
dispPrimeV
record component
-
dpOp
public double dpOp()Returns the value of thedpOp
record component.- Returns:
- the value of the
dpOp
record component
-