Module simpa.acc

Class BeamMatrix

java.lang.Object
simpa.acc.api.utils.BeamMatrix

public class BeamMatrix extends Object
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

    Constructors
    Constructor
    Description
    BeamMatrix(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 Type
    Method
    Description
    void
    calcCovarianceMatrix(double[][] data)
     
    double[][]
     
    double
    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
    double[]
     
    double[]
    getMeans(double[][] data)
     
    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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BeamMatrix

      public BeamMatrix(String fileName) throws FileNotFoundException
      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

      public static TwissParameters getTwissParameters(String phaseSpaceFile) throws IOException
      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

      public 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.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)