Package xal.smf.impl

Class Quadrupole

All Implemented Interfaces:
Comparable, ElementType, MagnetType, DataListener
Direct Known Subclasses:
TrimmedQuadrupole

public class Quadrupole extends Electromagnet
Quadrupole implements an Electromagnet Quadrupole supplied by a single power supply. Unlike many other beam line elements, Quadrupole represents more than one official type (QH and QV) as specified by the naming convention. In order to support this feature we override the getType(), update() and isKindOf() methods. The vertical and horizontal reference to a quadrupole isn't of consequence to behavior since the field of the quadrupole (including its sign) and its length characterizes the quadrupole.
Author:
Nikolay Malitsky, Christopher K. Allen, Tom Pelaia, Blaz Kranjc
  • Field Details

  • Constructor Details

    • Quadrupole

      public Quadrupole(String strID, ChannelFactory channelFactory)
      Primary Constructor
      Parameters:
      strID - the unique node identifier
    • Quadrupole

      public Quadrupole(String strID)
      Constructor
      Parameters:
      strID - the unique node identifier
  • Method Details

    • getType

      public String getType()
      Override to provide the correct type signature per instance. This is necessary since the Quadrupole class can represent more than one official type (QH or QV).
      Specified by:
      getType in class AcceleratorNode
      Returns:
      The official type consistent with the naming convention.
    • update

      public void update(DataAdaptor adaptor)
      Update the instance with data from the data adaptor. Overrides the default implementation to set the quadrupole type since a quadrupole type can be either "QH" or "QV".
      Specified by:
      update in interface DataListener
      Overrides:
      update in class Electromagnet
      Parameters:
      adaptor - The data provider.
    • isPole

      public boolean isPole(String compPole)
      Determine whether this magnet is of the pole specified.
      Specified by:
      isPole in interface MagnetType
      Overrides:
      isPole in class Magnet
      Parameters:
      compPole - The pole against which this magnet is being compared.
      Returns:
      true if this magnet matches the specified pole.
    • getOrientation

      public int getOrientation()
      Get the orientation of the magnet as defined by MagnetType. The orientation of the quad is determined by its type: QH or QV
      Specified by:
      getOrientation in interface MagnetType
      Overrides:
      getOrientation in class Magnet
      Returns:
      One of HORIZONTAL or VERTICAL
    • isKindOf

      public boolean isKindOf(String type)
      Determine if this node is of the specified type. Override the default method since a quadrupole could represent either a vertical or horizontal type. Must also handle inheritance checking so we must or the direct type comparison with the inherited type checking.
      Specified by:
      isKindOf in interface ElementType
      Overrides:
      isKindOf in class AcceleratorNode
      Parameters:
      type - The type against which to compare this quadrupole's type.
      Returns:
      true if the node is a match and false otherwise.