Class ProbeState<S extends ProbeState<S>>
- All Implemented Interfaces:
IProbeState
,IArchive
- Direct Known Subclasses:
BunchProbeState
,DiagnosticProbeState
,ParticleProbeState
,TransferMapState
- Version:
- June 26, 2014
- Author:
- Craig McChesney, Christopher K. Allen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
element tag for the probe state dataprotected static final String
attribute tag for concrete type of probe stateFields inherited from interface xal.model.probe.traj.IProbeState
LIGHT_SPEED
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Default constructor - creates an emptyProbeState
object.protected
ProbeState
(S state) Copy constructor for ProbeState.protected
ProbeState
(Probe<S> probe) Initializing Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addPropertiesTo
(DataAdaptor container) Save the state information to aDataAdaptor
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 valueprotected 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).abstract S
copy()
Creates a new clone of this object.double
getBeta()
Returns the probe velocity normalized to the speed of light.protected double
Convenience function for multiplication of beta * gammaReturns 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
getGamma()
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 momentumdouble
Returns the current beam-line position of the probedouble
Returns the charge of probe's particle speciesdouble
Returns the rest energy of particle speciesdouble
getTime()
Return the time elapsed from the start of the probe trackingfinal void
load
(DataAdaptor container) Recovers the state information from a data source represented by aDataAdaptor
interface.protected void
readPropertiesFrom
(DataAdaptor container) Recover the state information from aDataAdaptor
interface.final void
save
(DataAdaptor daSink) Save the state information to a data sink represented by aDataAdaptor
interfacevoid
setElementId
(String id) Set the lattice element id associated with this state.void
setElementTypeId
(String strTypeId) Sets the type identifier string of the modeling element where this state was created.void
setHardwareNodeId
(String strSmfId) 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 beamvoid
setSpeciesRestEnergy
(double eR) Set the rest energy of a single particle in the beamvoid
setTime
(double dblTime) Set the current probe time elapsed from the start of the probe tracking.toString()
Return a textual representation of theProbeState
internal state.
-
Field Details
-
STATE_LABEL
element tag for the probe state data- See Also:
-
TYPE_LABEL
attribute tag for concrete type of probe state- See Also:
-
-
Constructor Details
-
ProbeState
protected ProbeState()Default constructor - creates an emptyProbeState
object. -
ProbeState
Copy constructor for ProbeState. Initializes the newProbeState
objects with the state attributes of the given probe state.- Parameters:
state
- initializing state- Since:
- Jun 26, 2014
-
ProbeState
Initializing Constructor. Creates aProbeState
object initialized to the state of theProbe
argument.- Parameters:
probe
-Probe
object containing initial values
-
-
Method Details
-
copy
Creates a new clone of this object.- Returns:
- a deep copy of this object.
- Since:
- Jun 26, 2014
-
setHardwareNodeId
Sets the hardware node ID modeled by the element owning this state.- Parameters:
strSmfId
- hardware ID of the state- Since:
- Sep 3, 2014
-
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 interfaceIProbeState
- 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 interfaceIProbeState
- 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 interfaceIProbeState
- 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 interfaceIProbeState
- 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 interfaceIProbeState
- 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 interfaceIProbeState
- Parameters:
w
- new probe kinetic energy (electron-volts)- See Also:
-
setElementId
Set the lattice element id associated with this state.- Specified by:
setElementId
in interfaceIProbeState
- Parameters:
id
- element id of current lattice element
-
setElementTypeId
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 interfaceIProbeState
- 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 interfaceIProbeState
- Returns:
- particle species charge (Coulombs)
-
getSpeciesRestEnergy
public double getSpeciesRestEnergy()Returns the rest energy of particle species- Specified by:
getSpeciesRestEnergy
in interfaceIProbeState
- Returns:
- particle species rest energy (electron-volts)
-
getElementId
Returns the id of the lattice element associated with this state.- Specified by:
getElementId
in interfaceIProbeState
- Returns:
- string ID of associated lattice element
-
getElementTypeId
Returns the modeling element type identifier string for the modeling element where this probe state was created.- Specified by:
getElementTypeId
in interfaceIProbeState
- 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 interfaceIProbeState
- Returns:
- probe position (meters)
-
getTime
public double getTime()Return the time elapsed from the start of the probe tracking- Specified by:
getTime
in interfaceIProbeState
- 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 interfaceIProbeState
- 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 interfaceIProbeState
- Returns:
- probe kinetic energy (electron-volts)
-
toString
Return a textual representation of theProbeState
internal state. -
save
Save the state information to a data sink represented by aDataAdaptor
interface -
load
Recovers the state information from a data source represented by aDataAdaptor
interface.- Specified by:
load
in interfaceIArchive
- Parameters:
container
- data source containing state information- Throws:
DataFormatException
- data incontainer
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
Save the state information to aDataAdaptor
interface.- Parameters:
container
- data sink withDataAdaptor
interface
-
readPropertiesFrom
Recover the state information from aDataAdaptor
interface.- Parameters:
container
- data source withDataAdaptor
interface- Throws:
DataFormatException
- data source is malformatted
-