Package xal.model.alg

Class TwissTracker

java.lang.Object
xal.model.alg.Tracker
xal.model.alg.TwissTracker
All Implemented Interfaces:
Remote, IAlgorithm, IArchive, IContextAware
Direct Known Subclasses:
TwissTrackerPmq

public class TwissTracker extends Tracker

Tracking algorithm for TwissProbe objects. The TwissProbe's primary state object, a BunchDescriptor object containing three sets of Twiss parameters (one for each phase plane), is advanced using the linear dynamics portion of any beamline element (IElement exposing object) Moreover, currently the dynamics are not coupled between phase planes. The values of the Twiss parameter propagated according to formula 2.54 from S.Y. Lee's book.

NOTES:

· There is necessarily no coupling between the phase planes from hardware elements. There can be, however, coupling from space charge effects
· Something else?

Author:
Christopher K. Allen
  • Field Details

    • TBL_LBL_TWISSTRACKER

      protected static final String TBL_LBL_TWISSTRACKER
      EditContext table name containing EnvelopeTracker parameters
      See Also:
    • TBL_PRIM_KEY_NAME

      protected static final String TBL_PRIM_KEY_NAME
      Table record primary key name
      See Also:
    • LABEL_OPTIONS

      protected static final String LABEL_OPTIONS
      data node label for EnvelopeTracker settings
      See Also:
    • ATTR_SCHEFF

      protected static final String ATTR_SCHEFF
      label for simulating space charge effects
      See Also:
    • ATTR_USESPACECHARGE

      protected static final String ATTR_USESPACECHARGE
      label for simulating space charge effects
      See Also:
    • ATTR_EMITGROWTH

      protected static final String ATTR_EMITGROWTH
      label for emittance growth flag
      See Also:
    • ATTR_STEPSIZE

      protected static final String ATTR_STEPSIZE
      label for maxstepsize *
      See Also:
    • TYPE_ID

      public static final String TYPE_ID
      string type identifier for algorithm
    • VERSION

      public static final int VERSION
      current algorithm version
      See Also:
    • CLS_PROBE_TYPE

      public static final Class<TwissProbe> CLS_PROBE_TYPE
      probe type recognized by this algorithm
  • Constructor Details

    • TwissTracker

      public TwissTracker()
      Creates a new instance of EnvelopeTracker
    • TwissTracker

      protected TwissTracker(String strType, int intVersion, Class<? extends IProbe> clsProbeType)
      Creates a new, empty, instance of EnvelopeTracker. This method is a protected constructor meant only for child classes.
      Parameters:
      strType - string type identifier of algorithm
      intVersion - version of algorithm
      clsProbeType - class object for probe handled by this algorithm.
    • TwissTracker

      public TwissTracker(TwissTracker sourceTracker)
      Copy constructor for TwissTracker
      Parameters:
      sourceTracker - Tracker that is being copied
  • Method Details

    • copy

      public TwissTracker copy()
      Creates a deep copy of TwissTracker
    • setStepSize

      public void setStepSize(double dblStepSize)
      Set the step size used for PMQ and any other exceptional propagation. Normally we take one step through a beamline element
      Parameters:
      dblStepSize - new step size in meters
    • setEmittanceGrowth

      public void setEmittanceGrowth(boolean bolEmitGrowth)
      Set the emittance growth flag. If set true then the algorithm will simulate emittance growth through RF gaps. NOTE: If set, the dynamics will no longer be consistent since the response matrix and betatron phases will not reproduce the current Twiss parameters.
      Parameters:
      bolEmitGrowth - set true to simulation emittance growth
      See Also:
    • setUseSpacecharge

      public void setUseSpacecharge(boolean bolScheff)
      Method to set the flag to use/notuse spacecharge.
      Parameters:
      bolScheff - set whether or not to simulation space charge effects
    • getStepSize

      public double getStepSize()
      Returns the element subsection length (in meters) that the probe may be advanced for exceptional cases. Typically, probe is propagated through the entire element.
      Returns:
      special case step size in meters
    • getEmittanceGrowthFlag

      public boolean getEmittanceGrowthFlag()
      Return the emittance growth flag.
      Returns:
      true if we are simulating emittance growth, false otherwise
      See Also:
    • getSpaceChargeFlag

      public boolean getSpaceChargeFlag()
      Returns the flag determining whether or not space charge effects are being considered during the propagation.
      Returns:
      true if space charge forces are used, false otherwise
    • doPropagation

      public void doPropagation(IProbe probe, IElement elem) throws ModelException
      Propagates the probe through the element.
      Specified by:
      doPropagation in class Tracker
      Parameters:
      probe - probe to propagate
      elem - element acting on probe
      Throws:
      ModelException - invalid probe type or error in advancing probe
      See Also:
    • load

      public void load(String strPrimKeyVal, EditContext ecTableData) throws DataFormatException
      Load the parameters of this IAlgorithm object from the table data in the given EditContext. Here we load only the parameters specific to the base class. It is expected that Subclasses should override this method to recover the data particular to there own operation.
      Specified by:
      load in interface IContextAware
      Overrides:
      load in class Tracker
      Parameters:
      strPrimKeyVal - primary key value specifying the name of the data record
      ecTableData - EditContext containing table data
      Throws:
      DataFormatException - bad data format - error in reading
      See Also:
    • load

      public void load(DataAdaptor daSource)
      Load the parameters of the algorithm from a data source exposing the IArchive interface. The superclass load method is called first, then the properties particular to EnvTrackerAdapt are loaded.
      Specified by:
      load in interface IArchive
      Overrides:
      load in class Tracker
      Parameters:
      daSource - data source containing state data
      See Also:
    • save

      public void save(DataAdaptor daSink)
      Save the state and settings of this algorithm to a data source exposing the DataAdaptor interface. Subclasses should override this method to store the data particular to there own operation.
      Specified by:
      save in interface IArchive
      Overrides:
      save in class Tracker
      Parameters:
      daSink - data source to receive algorithm configuration
      See Also:
    • advanceState

      protected void advanceState(IProbe ifcProbe, IElement ifcElem, double dblLen) throws ModelException
      Advances the probe state through a subsection of the element with the specified length. Applies a space charge kick at the end of the element subsection for any probe having nonzero beam current.
      Parameters:
      ifcElem - interface to the beam element
      ifcProbe - interface to the probe
      dblLen - length of element subsection to advance through
      Throws:
      ModelException - bad element transfer matrix/corrupt probe state