|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.xal.model.probe.Probe
Provides a base class implementation of the IProbe interface that is useful for
most standard probe types. This class provides most of the functionality necessary
for the implementation of the IProbe interface,
| Field Summary | |
static java.lang.String |
PROBE_LABEL
element tag for probe data |
| Fields inherited from interface gov.sns.xal.model.IProbe |
LightSpeed, Permittivity, UnitCharge |
| Constructor Summary | |
protected |
Probe()
Creates a new instance of Probe. |
protected |
Probe(IAlgorithm ifcAlg)
Creates a new instance of Probe. |
|
Probe(Probe probe)
Copy constructor for Probe. |
| Method Summary | |
void |
applyState(ProbeState state)
Apply the contents of ProbeState to update my current state. |
protected double |
computeBetaFromGamma(double gamma)
Convenience function for computing the probe's velocity beta (w.r.t. |
protected double |
computeGammaFromBeta(double beta)
Computes the relatavistic factor gamma from the current beta value |
protected double |
computeGammaFromW(double W)
Convenience function for computing the relatistic factor gamma from the probe's kinetic energy (using the particle species rest energy m_dblParEr). |
abstract ProbeState |
createProbeState()
Captures the probe's state in a ProbeState of the appropriate species. |
protected abstract Trajectory |
createTrajectory()
Require concrete implementations to override this method to create a Trajectory object of the appropriate species. |
protected void |
deepCopyProbeBase(Probe probe)
This is a convenience function for derived classes when implementing their deepCopy() method. |
IAlgorithm |
getAlgorithm()
Return the algorithm defining the probes dynamics. |
IArchive |
getArchive()
Return the archiving interface for this object. |
double |
getBeta()
Returns the probe velocity normalized to the speed of light. |
protected double |
getBetaGamma()
Convenience function for multiplication of beta * gamma |
java.lang.String |
getComment()
Returns the comment string associated with the probe |
java.lang.String |
getCurrentElement()
Returns the id of the current lattice element that the probe is visiting. |
double |
getGamma()
Returns the relativistic parameter corresponding to the probe velocity. |
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 since the probe began propagation. |
java.util.Date |
getTimestamp()
Returns the time stamp of the probe. |
Trajectory |
getTrajectory()
Get the state history of the probe. |
void |
initialize()
Initializes the probe, resetting state as necessary. |
void |
load(DataAdaptor daptSource)
Load the contents of a probe from an data archive represented by a DataAdaptor interface. |
static Probe |
newProbeInitializedFrom(Probe probeInit)
Clone factory method. |
static Probe |
readFrom(DataAdaptor container)
Read the contents of the supplied DataAdaptor and return
an instance of the appropriate Probe species. |
void |
reset()
Resets the probe to the saved initial state, if there is one and clears the m_trajHist. |
void |
save(DataAdaptor daptProbe)
Save the contents of a probe to a data archive represented by a DataAdaptor interface. |
boolean |
setAlgorithm(IAlgorithm ifcAlg)
Set the algorithm defining the probes dynamics through elements |
void |
setComment(java.lang.String strComment)
Provide a user comment associated with the probe |
void |
setCurrentElement(java.lang.String id)
Set the current lattice element id. |
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 time since the probe began propagating |
void |
setTimestamp(java.util.Date dateStamp)
Sets a time stamp for the probe. |
void |
setTracking(boolean bolTrack)
Set particle m_trajHist tracking for probes. |
void |
update()
Save the probe state into m_trajHist. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String PROBE_LABEL
| Constructor Detail |
protected Probe()
protected Probe(IAlgorithm ifcAlg)
ifcAlg - default dynamics algorithm for probepublic Probe(Probe probe)
probe - Probe object to be cloned| Method Detail |
public static Probe readFrom(DataAdaptor container)
throws ParsingException
DataAdaptor and return
an instance of the appropriate Probe species.
container - DataAdaptor to read a Probe from
ParsingException - error encountered reading the DataAdaptorpublic static Probe newProbeInitializedFrom(Probe probeInit)
Probe object, of the appropriate
type, initialized to the argument Probe.
NOTE: There is now a reset() method that is preferable to this one. It
clears the probe m_trajHist and restores the initial state saved in the
initialize() method, without creating a new probe instance.
probeInit - Probe object containing initial data
Probe object initialized to argumentprotected abstract Trajectory createTrajectory()
Trajectory object of the appropriate species.
Trajectory of the appropriate species for this probe typepublic abstract ProbeState createProbeState()
public void applyState(ProbeState state)
state - ProbeState object containing new probe state datapublic void setComment(java.lang.String strComment)
strComment - user comment stringpublic void setTimestamp(java.util.Date dateStamp)
dateStamp - time stamp for probepublic void setSpeciesCharge(double q)
q - species particle charge (Coulombs)public void setSpeciesRestEnergy(double Er)
Er - particle rest energy (electron-volts)public boolean setAlgorithm(IAlgorithm ifcAlg)
ifcAlg - object exposing the IAlgorithm interfacepublic void setTracking(boolean bolTrack)
bolTrack - turn tracking on or offpublic java.lang.String getComment()
public java.util.Date getTimestamp()
public Trajectory getTrajectory()
public double getSpeciesCharge()
getSpeciesCharge in interface IProbepublic double getSpeciesRestEnergy()
getSpeciesRestEnergy in interface IProbepublic java.lang.String getCurrentElement()
getCurrentElement in interface IProbepublic double getPosition()
getPosition in interface IProbepublic double getTime()
getTime in interface IProbepublic double getKineticEnergy()
getKineticEnergy in interface IProbepublic double getBeta()
getBeta in interface IProbepublic double getGamma()
getGamma in interface IProbepublic void setCurrentElement(java.lang.String id)
setCurrentElement in interface IProbeid - element id of current lattice elementpublic void setPosition(double s)
setPosition in interface IProbes - new probe position (meters)getPositionpublic void setTime(double dblTime)
setTime in interface IProbedblTime - new probe current time in secondspublic void setKineticEnergy(double W)
setKineticEnergy in interface IProbeW - new probe kinetic energy (electron-volts)getKineticEnergypublic void initialize()
initialize in interface IProbepublic void reset()
public void update()
throws ModelException
update in interface IProbeModelException - an error occurred while trying to update the probepublic IAlgorithm getAlgorithm()
getAlgorithm in interface IProbepublic IArchive getArchive()
getArchive in interface IProbeIArchive
public void load(DataAdaptor daptSource)
throws DataFormatException
DataAdaptor interface.
load in interface IArchivedaptSource - data archive containing probe info
DataFormatException - bad probe type, missing child data node, or bad number formatpublic void save(DataAdaptor daptProbe)
DataAdaptor interface.
save in interface IArchivedaptProbe - data archive to receive probe informationprotected void deepCopyProbeBase(Probe probe)
probe - probe object whose Probe base is to be deep copied into thisprotected double computeGammaFromBeta(double beta)
beta - speed of probe w.r.t. the speed of light
protected double computeGammaFromW(double W)
W - kinetic energy of the probe
protected double computeBetaFromGamma(double gamma)
protected double getBetaGamma()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||