gov.sns.xal.model.probe.traj
Class ProbeState

java.lang.Object
  |
  +--gov.sns.xal.model.probe.traj.ProbeState
All Implemented Interfaces:
IArchive
Direct Known Subclasses:
BeamProbeState, DiagnosticProbeState, ParticlePerturbProbeState, ParticleProbeState, SynchronousState, TransferMapState

public abstract class ProbeState
extends java.lang.Object
implements IArchive

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.


Field Summary
static java.lang.String STATE_LABEL
          element tag for the probe state data
 
Constructor Summary
ProbeState()
          Default constructor - creates an empty ProbeState object.
ProbeState(Probe probe)
          Initializing Constructor.
 
Method Summary
protected  void addPropertiesTo(DataAdaptor container)
          Save the state information to a DataAdaptor interface.
 java.lang.String getElementId()
          Returns the id of the lattice element associated with this state.
 double getKineticEnergy()
          Return the kinetic energy of the probe.
 double getPosition()
          Returns the current beam-line position of the probe
 double getSpeciesCharge()
          Returns the charge of probe's particle species
 double getSpeciesRestEnergy()
          Returns the rest energy of particle species
 double getTime()
          Return the time elapsed from the start of the probe tracking
 void load(DataAdaptor container)
          Recovers the state information from a data source represented by a DataAdaptor interface.
static ProbeState readFrom(DataAdaptor container)
          Read the contents of the supplied DataAdaptor and return an instance of the appropriate Trajectory species.
protected  void readPropertiesFrom(DataAdaptor container)
          Recover the state information from a DataAdaptor interface.
 void save(DataAdaptor container)
          Save the state information to a data sink represented by a DataAdaptor interface
 void setElementId(java.lang.String id)
          Set the lattice element id associated with this state.
 void setKineticEnergy(double W)
          Set the current kinetic energy of the probe.
 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 setSpeciesRestEnergy(double Er)
          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.
 java.lang.String toString()
          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 Detail

STATE_LABEL

public static final java.lang.String STATE_LABEL
element tag for the probe state data

See Also:
Constant Field Values
Constructor Detail

ProbeState

public ProbeState()
Default constructor - creates an empty ProbeState object.


ProbeState

public ProbeState(Probe probe)
Initializing Constructor. Creates a ProbeState object initialized to the state of the Probe argument.

Parameters:
probe - Probe object containing initial values
Method Detail

readFrom

public static ProbeState readFrom(DataAdaptor container)
                           throws ParsingException
Read the contents of the supplied DataAdaptor and return an instance of the appropriate Trajectory species.

Parameters:
container - DataAdaptor to read a Trajectory from
Returns:
a Trajectory for the contents of the DataAdaptor
Throws:
ParsingException - error encountered reading the DataAdaptor

setSpeciesCharge

public void setSpeciesCharge(double q)
Set the charge of the particle species in the beam

Parameters:
q - species particle charge (Coulombs)

setSpeciesRestEnergy

public void setSpeciesRestEnergy(double Er)
Set the rest energy of a single particle in the beam

Parameters:
Er - particle rest energy (electron-volts)

setPosition

public void setPosition(double s)
Set the current position of the probe along the beamline.

Parameters:
s - new probe position (meters)
See Also:
getPosition

setTime

public void setTime(double dblTime)
Set the current probe time elapsed from the start of the probe tracking.

Parameters:
dblTime - elapsed time in seconds

setKineticEnergy

public void setKineticEnergy(double W)
Set the current kinetic energy of the probe.

Parameters:
W - new probe kinetic energy (electron-volts)
See Also:
getKineticEnergy

setElementId

public void setElementId(java.lang.String id)
Set the lattice element id associated with this state.

Parameters:
id - element id of current lattice element

getSpeciesCharge

public double getSpeciesCharge()
Returns the charge of probe's particle species

Returns:
particle species charge (Coulombs)

getSpeciesRestEnergy

public double getSpeciesRestEnergy()
Returns the rest energy of particle species

Returns:
particle species rest energy (electron-volts)

getElementId

public java.lang.String getElementId()
Returns the id of the lattice element associated with this state.

Returns:
string ID of associated lattice element

getPosition

public double getPosition()
Returns the current beam-line position of the probe

Returns:
probe position (meters)

getTime

public double getTime()
Return the time elapsed from the start of the probe tracking

Returns:
time elapsed since probe began tracking, in seconds

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.

Returns:
probe kinetic energy (electron-volts)

toString

public java.lang.String toString()
Return a textual representation of the ProbeState internal state.

Overrides:
toString in class java.lang.Object
Returns:
string containing current ProbeState state

save

public void save(DataAdaptor container)
Save the state information to a data sink represented by a DataAdaptor interface

Specified by:
save in interface IArchive
Parameters:
container - data source to receive state information

load

public 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

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 ParsingException
Recover the state information from a DataAdaptor interface.

Parameters:
container - data source with DataAdaptor interface
Throws:
ParsingException - data source is malformatted