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 Stringelement tag for the probe state dataprotected static final Stringattribute tag for concrete type of probe stateFields inherited from interface xal.model.probe.traj.IProbeState
LIGHT_SPEED -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefault constructor - creates an emptyProbeStateobject.protectedProbeState(S state) Copy constructor for ProbeState.protectedProbeState(Probe<S> probe) Initializing Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddPropertiesTo(DataAdaptor container) Save the state information to aDataAdaptorinterface.protected doublecomputeBetaFromGamma(double gamma) Convenience function for computing the probe's velocity beta (w.r.t. the speed of light) from the relativistic factor gamma.protected doublecomputeGammaFromBeta(double beta) Computes the relativistic factor gamma from the current beta valueprotected doublecomputeGammaFromW(double w) Convenience function for computing the relativistic factor gamma from the probe's kinetic energy (using the particle species rest energy dblParEr).abstract Scopy()Creates a new clone of this object.doublegetBeta()Returns the probe velocity normalized to the speed of light.protected doubleConvenience 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.doublegetGamma()Return the relativistic gamma of the probe.Returns the identifier of the hardware node modeled by the associated modeling element for this state.doubleReturn the kinetic energy of the probe.doubleReturns the longitudinal phase of this probe with respect to the RF phase.doubleReturns the momentumdoubleReturns the current beam-line position of the probedoubleReturns the charge of probe's particle speciesdoubleReturns the rest energy of particle speciesdoublegetTime()Return the time elapsed from the start of the probe trackingfinal voidload(DataAdaptor container) Recovers the state information from a data source represented by aDataAdaptorinterface.protected voidreadPropertiesFrom(DataAdaptor container) Recover the state information from aDataAdaptorinterface.final voidsave(DataAdaptor daSink) Save the state information to a data sink represented by aDataAdaptorinterfacevoidsetElementId(String id) Set the lattice element id associated with this state.voidsetElementTypeId(String strTypeId) Sets the type identifier string of the modeling element where this state was created.voidsetHardwareNodeId(String strSmfId) Sets the hardware node ID modeled by the element owning this state.final voidsetKineticEnergy(double w) Set the current kinetic energy of the probe.voidsetLongitudinalPhase(double dblPhsLng) Set the longitudinal phase of this probe with respect to the RF phase.voidsetPosition(double s) Set the current position of the probe along the beamline.voidsetSpeciesCharge(double q) Set the charge of the particle species in the beamvoidsetSpeciesRestEnergy(double eR) Set the rest energy of a single particle in the beamvoidsetTime(double dblTime) Set the current probe time elapsed from the start of the probe tracking.toString()Return a textual representation of theProbeStateinternal 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 emptyProbeStateobject. -
ProbeState
Copy constructor for ProbeState. Initializes the newProbeStateobjects with the state attributes of the given probe state.- Parameters:
state- initializing state- Since:
- Jun 26, 2014
-
ProbeState
Initializing Constructor. Creates aProbeStateobject initialized to the state of theProbeargument.- Parameters:
probe-Probeobject 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:
setSpeciesChargein 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:
setSpeciesRestEnergyin 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:
setPositionin 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:
setTimein 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:
setLongitudinalPhasein 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:
setKineticEnergyin interfaceIProbeState- Parameters:
w- new probe kinetic energy (electron-volts)- See Also:
-
setElementId
Set the lattice element id associated with this state.- Specified by:
setElementIdin interfaceIProbeState- Parameters:
id- element id of current lattice element
-
setElementTypeId
Description copied from interface:IProbeStateSets 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:
setElementTypeIdin 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:
getSpeciesChargein interfaceIProbeState- Returns:
- particle species charge (Coulombs)
-
getSpeciesRestEnergy
public double getSpeciesRestEnergy()Returns the rest energy of particle species- Specified by:
getSpeciesRestEnergyin interfaceIProbeState- Returns:
- particle species rest energy (electron-volts)
-
getElementId
Returns the id of the lattice element associated with this state.- Specified by:
getElementIdin 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:
getElementTypeIdin 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:
getPositionin interfaceIProbeState- Returns:
- probe position (meters)
-
getTime
public double getTime()Return the time elapsed from the start of the probe tracking- Specified by:
getTimein 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:
getLongitudinalPhasein 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:
getKineticEnergyin interfaceIProbeState- Returns:
- probe kinetic energy (electron-volts)
-
toString
Return a textual representation of theProbeStateinternal state. -
save
Save the state information to a data sink represented by aDataAdaptorinterface -
load
Recovers the state information from a data source represented by aDataAdaptorinterface.- Specified by:
loadin interfaceIArchive- Parameters:
container- data source containing state information- Throws:
DataFormatException- data incontaineris 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 aDataAdaptorinterface.- Parameters:
container- data sink withDataAdaptorinterface
-
readPropertiesFrom
Recover the state information from aDataAdaptorinterface.- Parameters:
container- data source withDataAdaptorinterface- Throws:
DataFormatException- data source is malformatted
-