Class ProbeState<S extends ProbeState<S>>

java.lang.Object
xal.model.probe.traj.ProbeState<S>
All Implemented Interfaces:
IProbeState, IArchive
Direct Known Subclasses:
BunchProbeState, DiagnosticProbeState, ParticleProbeState, TransferMapState

public abstract class ProbeState<S extends ProbeState<S>> extends Object implements IProbeState
Stores a snapshot of a probes state at a particular instant in time. Concrete extensions to this class should be developed for each type of probe.
Version:
June 26, 2014
Author:
Craig McChesney, Christopher K. Allen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    element tag for the probe state data
    protected static final String
    attribute tag for concrete type of probe state

    Fields inherited from interface xal.model.probe.traj.IProbeState

    LIGHT_SPEED
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Default constructor - creates an empty ProbeState object.
    protected
    ProbeState(S state)
    Copy constructor for ProbeState.
    protected
    ProbeState(Probe<S> probe)
    Initializing Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Save the state information to a DataAdaptor interface.
    protected double
    computeBetaFromGamma(double gamma)
    Convenience function for computing the probe's velocity beta (w.r.t. the speed of light) from the relativistic factor gamma.
    protected double
    computeGammaFromBeta(double beta)
    Computes the relativistic factor gamma from the current beta value
    protected double
    Convenience function for computing the relativistic factor gamma from the probe's kinetic energy (using the particle species rest energy dblParEr).
    abstract S
    Creates a new clone of this object.
    double
    Returns the probe velocity normalized to the speed of light.
    protected double
    Convenience function for multiplication of beta * gamma
    Returns the id of the lattice element associated with this state.
    Returns the modeling element type identifier string for the modeling element where this probe state was created.
    double
    Return the relativistic gamma of the probe.
    Returns the identifier of the hardware node modeled by the associated modeling element for this state.
    double
    Return the kinetic energy of the probe.
    double
    Returns the longitudinal phase of this probe with respect to the RF phase.
    double
    Returns the momentum
    double
    Returns the current beam-line position of the probe
    double
    Returns the charge of probe's particle species
    double
    Returns the rest energy of particle species
    double
    Return the time elapsed from the start of the probe tracking
    final void
    load(DataAdaptor container)
    Recovers the state information from a data source represented by a DataAdaptor interface.
    protected void
    Recover the state information from a DataAdaptor interface.
    final void
    save(DataAdaptor daSink)
    Save the state information to a data sink represented by a DataAdaptor interface
    void
    Set the lattice element id associated with this state.
    void
    Sets the type identifier string of the modeling element where this state was created.
    void
    Sets the hardware node ID modeled by the element owning this state.
    final void
    setKineticEnergy(double w)
    Set the current kinetic energy of the probe.
    void
    setLongitudinalPhase(double dblPhsLng)
    Set the longitudinal phase of this probe with respect to the RF phase.
    void
    setPosition(double s)
    Set the current position of the probe along the beamline.
    void
    setSpeciesCharge(double q)
    Set the charge of the particle species in the beam
    void
    Set the rest energy of a single particle in the beam
    void
    setTime(double dblTime)
    Set the current probe time elapsed from the start of the probe tracking.
    Return a textual representation of the ProbeState internal state.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • ProbeState

      protected ProbeState()
      Default constructor - creates an empty ProbeState object.
    • ProbeState

      protected ProbeState(S state)
      Copy constructor for ProbeState. Initializes the new ProbeState objects with the state attributes of the given probe state.
      Parameters:
      state - initializing state
      Since:
      Jun 26, 2014
    • ProbeState

      protected ProbeState(Probe<S> probe)
      Initializing Constructor. Creates a ProbeState object initialized to the state of the Probe argument.
      Parameters:
      probe - Probe object containing initial values
  • Method Details

    • copy

      public abstract S copy()
      Creates a new clone of this object.
      Returns:
      a deep copy of this object.
      Since:
      Jun 26, 2014
    • setHardwareNodeId

      public void setHardwareNodeId(String strSmfId)
      Sets the hardware node ID modeled by the element owning this state.
      Parameters:
      strSmfId - hardware ID of the state
      Since:
      Sep 3, 2014
    • getHardwareNodeId

      public String getHardwareNodeId()
      Returns the identifier of the hardware node modeled by the associated modeling element for this state.
      Returns:
      hardware ID of this state's modeling element
      Since:
      Sep 3, 2014
    • getMomentum

      public double getMomentum()
      Returns the momentum
      Returns:
      particle momentum
    • getBeta

      public double getBeta()
      Returns the probe velocity normalized to the speed of light.
      Returns:
      normalized probe velocity v/c (unitless
    • getGamma

      public double getGamma()
      Return the relativistic gamma of the probe. Depending upon the probe type, this could be the actual gamma of a single constituent particle, the average gamma of an ensemble, the design gamma, etc.
      Returns:
      probe kinetic energy (electron-volts)
    • setSpeciesCharge

      public void setSpeciesCharge(double q)
      Set the charge of the particle species in the beam
      Specified by:
      setSpeciesCharge in interface IProbeState
      Parameters:
      q - species particle charge (Coulombs)
    • setSpeciesRestEnergy

      public void setSpeciesRestEnergy(double eR)
      Set the rest energy of a single particle in the beam
      Specified by:
      setSpeciesRestEnergy in interface IProbeState
      Parameters:
      eR - particle rest energy (electron-volts)
    • setPosition

      public void setPosition(double s)
      Set the current position of the probe along the beamline.
      Specified by:
      setPosition in interface IProbeState
      Parameters:
      s - new probe position (meters)
      See Also:
    • setTime

      public void setTime(double dblTime)
      Set the current probe time elapsed from the start of the probe tracking.
      Specified by:
      setTime in interface IProbeState
      Parameters:
      dblTime - elapsed time in seconds
    • setLongitudinalPhase

      public void setLongitudinalPhase(double dblPhsLng)

      Set the longitudinal phase of this probe with respect to the RF phase. Typically used to account for phase delay/advance in cavities incurred due to finite propagation time. For example

          φ ≜ φ0 - Δφ

      where Δφ = 2πfΔt is the phase delay due to elapsed time Δt, f is the cavity resonant frequency, and φ0 is the operating phase of the cavity (w.r.t. the synchronous particle).

      Specified by:
      setLongitudinalPhase in interface IProbeState
      Parameters:
      dblPhsLng - the phase delay Δφ incurred from probe propagate between RF cavities
      Since:
      Nov 17, 2014
    • setKineticEnergy

      public final void setKineticEnergy(double w)
      Set the current kinetic energy of the probe.
      Specified by:
      setKineticEnergy in interface IProbeState
      Parameters:
      w - new probe kinetic energy (electron-volts)
      See Also:
    • setElementId

      public void setElementId(String id)
      Set the lattice element id associated with this state.
      Specified by:
      setElementId in interface IProbeState
      Parameters:
      id - element id of current lattice element
    • setElementTypeId

      public void setElementTypeId(String strTypeId)
      Description copied from interface: IProbeState
      Sets the type identifier string of the modeling element where this state was created. Note that all modeling elements have a static string identifier defined in their class definition.
      Specified by:
      setElementTypeId in interface IProbeState
      Parameters:
      strTypeId - static identifier string of the modeling element class
      Since:
      Dec 16, 2014 by Christopher K. Allen
      See Also:
    • getSpeciesCharge

      public double getSpeciesCharge()
      Returns the charge of probe's particle species
      Specified by:
      getSpeciesCharge in interface IProbeState
      Returns:
      particle species charge (Coulombs)
    • getSpeciesRestEnergy

      public double getSpeciesRestEnergy()
      Returns the rest energy of particle species
      Specified by:
      getSpeciesRestEnergy in interface IProbeState
      Returns:
      particle species rest energy (electron-volts)
    • getElementId

      public String getElementId()
      Returns the id of the lattice element associated with this state.
      Specified by:
      getElementId in interface IProbeState
      Returns:
      string ID of associated lattice element
    • getElementTypeId

      public String getElementTypeId()
      Returns the modeling element type identifier string for the modeling element where this probe state was created.
      Specified by:
      getElementTypeId in interface IProbeState
      Returns:
      static identifier string of the modeling element class
      Since:
      Dec 16, 2014 by Christopher K. Allen
      See Also:
    • getPosition

      public double getPosition()
      Returns the current beam-line position of the probe
      Specified by:
      getPosition in interface IProbeState
      Returns:
      probe position (meters)
    • getTime

      public double getTime()
      Return the time elapsed from the start of the probe tracking
      Specified by:
      getTime in interface IProbeState
      Returns:
      time elapsed since probe began tracking, in seconds
    • getLongitudinalPhase

      public double getLongitudinalPhase()

      Returns the longitudinal phase of this probe with respect to the RF phase. Typically used to account for phase delay/advance in cavities incurred due to finite propagation time. For example

          φ ≜ φ0 - Δφ

      where Δφ = 2πfΔt is the phase delay due to elapsed time Δt, f is the cavity resonant frequency, and φ0 is the operating phase of the cavity (w.r.t. the synchronous particle).

      Specified by:
      getLongitudinalPhase in interface IProbeState
      Returns:
      the probe phase φ with respect to the machine RF frequency
      Since:
      Nov 17, 2014
    • getKineticEnergy

      public double getKineticEnergy()
      Return the kinetic energy of the probe. Depending upon the probe type, this could be the actual kinetic energy of a single constituent particle, the average kinetic energy of an ensemble, the design energy, etc.
      Specified by:
      getKineticEnergy in interface IProbeState
      Returns:
      probe kinetic energy (electron-volts)
    • toString

      public String toString()
      Return a textual representation of the ProbeState internal state.
      Overrides:
      toString in class Object
      Returns:
      string containing current ProbeState state
    • save

      public final void save(DataAdaptor daSink)
      Save the state information to a data sink represented by a DataAdaptor interface
      Specified by:
      save in interface IArchive
      Parameters:
      daSink - data source to receive state information
    • load

      public final void load(DataAdaptor container) throws DataFormatException
      Recovers the state information from a data source represented by a DataAdaptor interface.
      Specified by:
      load in interface IArchive
      Parameters:
      container - data source containing state information
      Throws:
      DataFormatException - data in container is malformated
    • computeGammaFromBeta

      protected double computeGammaFromBeta(double beta)
      Computes the relativistic factor gamma from the current beta value
      Parameters:
      beta - speed of probe w.r.t. the speed of light
      Returns:
      relativistic factor gamma
    • computeGammaFromW

      protected double computeGammaFromW(double w)
      Convenience function for computing the relativistic factor gamma from the probe's kinetic energy (using the particle species rest energy dblParEr).
      Parameters:
      w - kinetic energy of the probe
      Returns:
      relativistic factor gamma
    • computeBetaFromGamma

      protected double computeBetaFromGamma(double gamma)
      Convenience function for computing the probe's velocity beta (w.r.t. the speed of light) from the relativistic factor gamma.
      Parameters:
      gamma - relativistic factor gamma
      Returns:
      speed of probe (w.r.t. speed of light)
    • getBetaGamma

      protected double getBetaGamma()
      Convenience function for multiplication of beta * gamma
    • addPropertiesTo

      protected void addPropertiesTo(DataAdaptor container)
      Save the state information to a DataAdaptor interface.
      Parameters:
      container - data sink with DataAdaptor interface
    • readPropertiesFrom

      protected void readPropertiesFrom(DataAdaptor container) throws DataFormatException
      Recover the state information from a DataAdaptor interface.
      Parameters:
      container - data source with DataAdaptor interface
      Throws:
      DataFormatException - data source is malformatted