Class ESSElementFactory

java.lang.Object
xal.extension.jels.smf.ESSElementFactory

public final class ESSElementFactory extends Object
Factory class for creation of ESS specific AcceleratorNode elements, primarily designed to be used by importers from external accelerator formats to OpenXAL.
Author:
Blaz Kranjc
  • Method Details

    • createESSBend

      public static Bend createESSBend(String name, double alpha, double k, double rho, double entryAngle, double exitAngle, double quadComp, ApertureBucket aper, MagnetMainSupply ps, int orientation, double gap, double position)
      Creates the Bend node with specified properties. Default values for upstream and downstream edge face Fringe-field factor are used.
      Parameters:
      name - Name of the bend magnets.
      alpha - Bend angle in degrees.
      k - beta*gamma*Er/(e0*c).
      rho - Curvature radius in meter.
      entryAngle - Entry angle in degrees.
      exitAngle - Exit angle in degrees.
      quadComp - Quadrupole component error of the dipole.
      aper - Aperture details.
      ps - Power supply for magnet. Can be null.
      position - Position of the magnet in the accelerator.
      Returns:
      Bend object.
    • createESSBend

      public static Bend createESSBend(String name, double alpha, double k, double rho, double entryAngle, double exitAngle, double enterK1, double enterK2, double exitK1, double exitK2, double quadComp, ApertureBucket aper, MagnetMainSupply ps, int orientation, double gap, double position)
      Creates the Bend node with specified properties.
      Parameters:
      name - Name of the bend magnets.
      alpha - Bend angle in degrees.
      k - beta*gamma*Er/(e0*c).
      rho - Curvature radius in meter.
      entryAngle - Entry angle in degrees.
      exitAngle - Exit angle in degrees.
      enterK1 - First upstream edge face Fringe-field factor.
      enterK2 - Second upstream edge face Fringe-field factor.
      exitK1 - First downstream edge face Fringe-field factor.
      exitK2 - Second downstream edge face Fringe-field factor.
      quadComp - Quadrupole component error of the dipole.
      aper - Aperture details.
      ps - Power supply for magnet. Can be null.
      position - Position of the magnet in the accelerator.
      Returns:
      Bend object.
    • createESSCorrector

      public static DipoleCorr createESSCorrector(String name, int orientation, double length, ApertureBucket aper, MagnetMainSupply ps, double position)
      Creates the DipoleCorrector node with specified properties.
      Parameters:
      name - Name of the corrector.
      orientation - Orientation of the corrector.
      length - Length of the corrector in meters.
      aper - Aperture details.
      ps - Power supply for the magnet. Can be null.
      position - Position of the corrector in the accelerator.
      Returns:
      Dipole correctors.
    • createESSRfGap

      public static ESSRfGap createESSRfGap(String name, boolean isFirst, double ampFactor, ApertureBucket aper, double length, double position)
      Creates the RfGap node with specified properties.
      Parameters:
      name - Name of the RF gap.
      isFirst - Is this the first gap in cavity.
      ampFactor - Amplification factor.
      aper - Aperture details.
      length - Length of gap in meters.
      position - Position of RF gap.
      Returns:
      RfGap object.
    • createRfFieldMap

      public static ESSRfCavity createRfFieldMap(String name, double length, double frequency, double amplitude, double rfphase, String fieldFile, String fieldMapPath, ApertureBucket aper, double position, int dimensions, int numberOfPoints)
      Creates the field map node with specified properties.
      Parameters:
      name - Name of the field map.
      length - Length of the fieldmap.
      frequency - Frequency at the start of the element.
      amplitude -
      rfphase - RF phase.
      fieldFile - File containing the filed profile.
      fieldMapPath -
      aper - Aperture details.
      position - Position of the field map.
      dimensions -
      numberOfPoints -
      Returns:
      RfFieldMap object.
    • createESSRfCavity

      public static ESSRfCavity createESSRfCavity(String name, double length, AcceleratorNode node, double phiS, double amplitude, double frequency, double position)
      Creates the RfCavity node with specified properties. TTF and STF coefficients are not overwritten.
      Parameters:
      name - Name of the RF cavity.
      length - Length of the cavity in meters.
      node - Node to include in the cavity.
      phiS - Phase [deg].
      amplitude - Amplitude [MV].
      frequency - Frequency at the start of the element [MHz].
      position - Position of the cavity.
      Returns:
      RfCavity object.
    • createESSRfCavity

      public static ESSRfCavity createESSRfCavity(String name, double length, AcceleratorNode[] nodes, double phiS, double amplitude, double frequency, double position)
      Creates the RfCavity node with specified properties. TTF and STF coefficients are not overwritten.
      Parameters:
      name - Name of the RF cavity.
      length - Length of the cavity in meters.
      nodes - Nodes to include in the cavity.
      phiS - Phase [deg].
      amplitude - Amplitude [MV].
      frequency - Frequency at the start of the element [MHz].
      position - Position of the cavity.
      Returns:
      RfCavity object.
    • createESSDTLTank

      public static ESSDTLTank createESSDTLTank(String name, double length, AcceleratorNode[] nodes, double phiS, double amplitude, double frequency, double position)
      Creates the RfCavity node with specified properties. TTF and STF coefficients are not overwritten.
      Parameters:
      name - Name of the RF cavity.
      length - Length of the cavity in meters.
      nodes - Nodes to include in the cavity.
      phiS - Phase [deg].
      amplitude - Amplitude [MV].
      frequency - Frequency at the start of the element [MHz].
      position - Position of the cavity.
      Returns:
      RfCavity object.
    • createMagFieldMap

      public static MagFieldMap createMagFieldMap(String name, double length, double amplitude, String fieldPath, String fieldFile, ApertureBucket aper, MagnetMainSupply ps, double position, int dimensions, int numberOfPoints)
      Creates the field map node with specified properties.
      Parameters:
      name - Name of the field map.
      length - Length of the fieldmap.
      amplitude - Magnetic field amplitude.
      fieldPath - Path of the file containing the field profile.
      fieldFile - File containing the field profile.
      aper - Aperture details.
      ps -
      position - Position of the field map.
      dimensions -
      numberOfPoints -
      Returns:
      RfFieldMap object.