java.lang.Object
simpa.acc.api.utils.BeamMatrix
- Author:
- lbojtar This class calculates the beam co-variance matrix from a file containing the phase space coordinates of a beam. The input text file should contain 6 columns of numbers separated by spaces. These are: x,x'y,y',z,dp/p
-
Constructor Summary
ConstructorsConstructorDescriptionBeamMatrix
(String fileName) Creates an instance from a file containing beam parameters in the following order: x,x'y,y',z,dp/p It calculates the Twiss parameters of the beam, which can be get with the access methods. -
Method Summary
Modifier and TypeMethodDescriptionvoid
calcCovarianceMatrix
(double[][] data) double[][]
double
getEmittance
(PhaseSpacePlane plane) Calculates the 1 sigma RMS emittance in [ m rad] BE CAREFULL! THERE ARE SEVERAL EMITTANCE DEFINITIONS See: https://uspas.fnal.gov/materials/10MIT/Emittance.pdfdouble[]
getMeans()
double[]
getMeans
(double[][] data) static TwissParameters
getTwissParameters
(String phaseSpaceFile) Calculates the Twiss parameters from a beam phase space coordinates file,then print it to the stdout.void
printTwissParameters
(double[] twiss) Prints the twiss parameters to the console.
-
Constructor Details
-
BeamMatrix
Creates an instance from a file containing beam parameters in the following order: x,x'y,y',z,dp/p It calculates the Twiss parameters of the beam, which can be get with the access methods.- Parameters:
fileName
- Input file containing the phase space coordinates.- Throws:
FileNotFoundException
-
-
Method Details
-
getTwissParameters
Calculates the Twiss parameters from a beam phase space coordinates file,then print it to the stdout. This is a subset of Twiss parameters, only those which can be calculated from a single phase space file. It does not contain the dispersion and the phase advances. The input file should contain the phase space coordinates at a some longitudinal position.- Parameters:
phaseSpaceFile
- Input file containing the phase space coordinates for a bunch. If it contains a line with #LONGITUDINAL_POSITION="some value" then the TwissParametrs object will contain this number, otherwise it is set to zero.- Returns:
- Those Twiss parameters which can be calculated from a beam phase space file.
- Throws:
IOException
- When the file can't be read.
-
printTwissParameters
public void printTwissParameters(double[] twiss) Prints the twiss parameters to the console.- Parameters:
twiss
- The twiss parameters.
-
getEmittance
Calculates the 1 sigma RMS emittance in [ m rad] BE CAREFULL! THERE ARE SEVERAL EMITTANCE DEFINITIONS See: https://uspas.fnal.gov/materials/10MIT/Emittance.pdf- Parameters:
plane
- - plane- Returns:
- emmitance [ m rad]
-
getCovarianceMatrix
public double[][] getCovarianceMatrix() -
getMeans
public double[] getMeans() -
calcCovarianceMatrix
public void calcCovarianceMatrix(double[][] data) -
getMeans
public double[] getMeans(double[][] data)
-