|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--gov.sns.xal.model.alg.Tracker
Abstract base class for tracking algorithms, classes implementing the IAlgorithm interface.
Provides common functionality of all algorithms. Derived classes must implement a
the
| Field Summary | |
static java.lang.String |
ATTRTAG_DEBUG
attribute tag for debugging flag |
static java.lang.String |
ATTRTAG_TYPE
attribute tag for the algorithm type identifier |
static java.lang.String |
ATTRTAG_UPDATE
attribute tag for trajectory state update policy |
static java.lang.String |
ATTRTAG_VER
attribute tag for the algorithm version number |
static java.lang.String |
CALC_RFGAP_PHASE
flag to update the beam phase in RF gaps ( a la parmila) rather than use default values |
static java.lang.String |
NODETAG_ALG
data node tag for the algorithm root |
static java.lang.String |
NODETAG_TRACKER
data node tag for common data |
static java.lang.String |
NODETAG_TRAJ
data node tag for trajectory parameters |
static int |
UPDATE_ALWAYS
save every state whenever probe is moved |
static int |
UPDATE_CUSTOM
never update - this is done comstomly somewhere else |
static int |
UPDATE_ENTRANCE
save state at element entrance |
static int |
UPDATE_ENTRANCEANDEXIT
save state at element exit and entrance |
static int |
UPDATE_EXIT
save state at element exit only |
| Constructor Summary | |
protected |
Tracker(java.lang.String strType,
int intVersion,
java.lang.Class clsProbeType)
Creates a new instance of Tracker. |
| Method Summary | |
protected void |
advanceProbe(IProbe probe,
IElement elem,
double dblLen)
Standard propagation dynamics for all probes. |
abstract void |
doPropagation(IProbe probe,
IElement elem)
Propagates the probe through the element according to the dynamics of the specific algorithm. |
IArchive |
getArchive()
Return the archiving interface for this object. |
boolean |
getDebugMode()
Indicate whether or not algorithm is in debug mode. |
protected double |
getElemPosition()
Return the current position within the element through which the probe is being propagated |
int |
getProbeUpdatePolicy()
Return the probe trajectory updating policy. |
java.lang.String |
getStartElementId()
Get the modeling element string identifier where propagation is to start. |
java.lang.String |
getStopElementId()
Get the modeling element string identifier where propagation is to stop. |
java.lang.String |
getType()
Return the algorithm type. |
int |
getVersion()
Returns the version number of this algorithm |
void |
initialize()
Initializes the algorithm to begin a new propagation cycle. |
void |
load(DataAdaptor daptArchive)
Load the state and settings of this aglorithm from a data source exposing the DataAdaptor interface. |
void |
propagate(IProbe probe,
IElement elem)
Propagates the probe through the element. |
protected void |
registerProbeType(java.lang.Class clsProbeType)
Register the class of a probe recognized by this algorithm. |
void |
save(DataAdaptor daptArchive)
Save the state and settings of this algorithm to a data source exposing the DataAdaptor interface. |
void |
setDebugMode(boolean bolDebug)
Set or clear the debugging mode flag. |
protected void |
setElemPosition(double dblPosElem)
Set the current position with the element though which the probe is being propagated. |
void |
setProbeUpdatePolicy(int enmPolicy)
Set the frequency of probe trajectory updates. |
void |
setStartElementId(java.lang.String id)
Sets the element from which to start propagation. |
void |
setStopElementId(java.lang.String id)
Sets the element at which to stop propagation. |
void |
unsetStartElementId()
reset the Start Element Id to null |
void |
unsetStopElementId()
reset the Stop Element Id to null |
boolean |
useRfGapPhaseCalculation()
indicates whether to calculate the beam phase in multi gap Rf cavities, (a la Parmila) rather than use default values (a la Trace 3D) |
protected boolean |
validElement(IElement elem)
Check if the specified element is requires probe propagating. |
boolean |
validProbe(IProbe ifcProbe)
Check if probe can be handled by this algorithm. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int UPDATE_CUSTOM
public static final int UPDATE_ALWAYS
public static final int UPDATE_EXIT
public static final int UPDATE_ENTRANCE
public static final int UPDATE_ENTRANCEANDEXIT
public static final java.lang.String NODETAG_ALG
public static final java.lang.String ATTRTAG_TYPE
public static final java.lang.String ATTRTAG_VER
public static final java.lang.String NODETAG_TRACKER
public static final java.lang.String ATTRTAG_UPDATE
public static final java.lang.String ATTRTAG_DEBUG
public static final java.lang.String NODETAG_TRAJ
public static final java.lang.String CALC_RFGAP_PHASE
| Constructor Detail |
protected Tracker(java.lang.String strType,
int intVersion,
java.lang.Class clsProbeType)
strType - string type identifier of algorithmintVersion - version of algorithmclsProbeType - class object for probe handled by this algorithm.| Method Detail |
public abstract void doPropagation(IProbe probe,
IElement elem)
throws ModelException
Tracker base provided convenient methods for this implementation.
probe - probe to propagateelem - element acting on probe
ModelException - invalid probe type or error in advancing probeadvanceProbe(gov.sns.xal.model.IProbe, gov.sns.xal.model.IElement, double),
validProbe(gov.sns.xal.model.IProbe)public void setProbeUpdatePolicy(int enmPolicy)
enmPolicy - probe update policy enumeration codepublic void setDebugMode(boolean bolDebug)
bolDebug - public int getProbeUpdatePolicy()
public boolean getDebugMode()
true if in debug modepublic java.lang.String getStartElementId()
public java.lang.String getStopElementId()
public boolean useRfGapPhaseCalculation()
useRfGapPhaseCalculation in interface IAlgorithmpublic java.lang.String getType()
getType in interface IAlgorithmpublic int getVersion()
getVersion in interface IAlgorithmpublic boolean validProbe(IProbe ifcProbe)
validProbe in interface IAlgorithmifcProbe - probe interface to be validated
public void setStartElementId(java.lang.String id)
setStartElementId in interface IAlgorithmid - String id of the element from which to start propagationpublic void setStopElementId(java.lang.String id)
setStopElementId in interface IAlgorithmid - String id of the element at which to stop propagationpublic void initialize()
initialize in interface IAlgorithmIAlgorithm.initialize()
public void propagate(IProbe probe,
IElement elem)
throws ModelException
propagate in interface IAlgorithmprobe - probe to propagateelem - element acting on probe
ModelException - invalid probe type or error in advancing probepublic IArchive getArchive()
getArchive in interface IAlgorithmIArchive
public void load(DataAdaptor daptArchive)
throws DataFormatException
DataAdaptor interface. Subclasses should
override this method to recover the data particular to there own
operation.
load in interface IArchivedaptArchive - data source containing algorithm configuration
DataFormatException - malformatted algorithm datagov.sns.tools.data.IArchive#load(gov.sns.tools.data.DataAdaptor)public void save(DataAdaptor daptArchive)
DataAdaptor interface. Subclasses should
override this method to store the data particular to there own
operation.
save in interface IArchivedaptArchive - data source to receive algorithm configurationgov.sns.tools.data.IArchive#save(gov.sns.tools.data.DataAdaptor)
protected void advanceProbe(IProbe probe,
IElement elem,
double dblLen)
throws ModelException
probe - target probe whose position and energy will be modified.elem - element acting on probedblLen - length of element subsection to advance through
ModelException - unable to advance probe through elementprotected boolean validElement(IElement elem)
elem - element interface to validate propagation
protected void registerProbeType(java.lang.Class clsProbeType)
clsProbeType - class object of probe which this algorithm can propagateprotected double getElemPosition()
protected void setElemPosition(double dblPosElem)
dblPosElem - current element positin in meterspublic void unsetStartElementId()
unsetStartElementId in interface IAlgorithmpublic void unsetStopElementId()
unsetStopElementId in interface IAlgorithm
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||