Package xal.model.alg
Class TwissTracker
java.lang.Object
xal.model.alg.Tracker
xal.model.alg.TwissTracker
- All Implemented Interfaces:
Remote,IAlgorithm,IArchive,IContextAware
- Direct Known Subclasses:
TwissTrackerPmq
Tracking algorithm for TwissProbe objects. The
TwissProbe's primary state object, a
BunchDescriptor object containing three sets of Twiss parameters
(one for each phase plane), is advanced using the linear dynamics portion of
any beamline element (IElement exposing object) Moreover,
currently the dynamics are not coupled between phase planes. The values of
the Twiss parameter propagated according to formula 2.54 from S.Y. Lee's
book.
NOTES:
· There is necessarily no coupling between the phase planes from
hardware elements. There can be, however, coupling from space charge effects
· Something else?
- Author:
- Christopher K. Allen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringlabel for emittance growth flagprotected static final Stringlabel for simulating space charge effectsprotected static final Stringlabel for maxstepsize *protected static final Stringlabel for simulating space charge effectsstatic final Class<TwissProbe>probe type recognized by this algorithmprotected static final Stringdata node label for EnvelopeTracker settingsprotected static final StringEditContext table name containing EnvelopeTracker parametersprotected static final StringTable record primary key namestatic final Stringstring type identifier for algorithmstatic final intcurrent algorithm versionFields inherited from class xal.model.alg.Tracker
ATTRTAG_DEBUG, ATTRTAG_RFGAP_PHASE, ATTRTAG_TYPE, ATTRTAG_UPDATE, ATTRTAG_VER, NODETAG_ALG, NODETAG_TRACKER, TBL_LBL_ALGORITHM, UPDATE_ALWAYS, UPDATE_CUSTOM, UPDATE_ENTRANCE, UPDATE_ENTRANCEANDEXIT, UPDATE_EXIT -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a new instance of EnvelopeTrackerprotectedTwissTracker(String strType, int intVersion, Class<? extends IProbe> clsProbeType) Creates a new, empty, instance of EnvelopeTracker.TwissTracker(TwissTracker sourceTracker) Copy constructor for TwissTracker -
Method Summary
Modifier and TypeMethodDescriptionprotected voidadvanceState(IProbe ifcProbe, IElement ifcElem, double dblLen) Advances the probe state through a subsection of the element with the specified length.copy()Creates a deep copy of TwissTrackervoiddoPropagation(IProbe probe, IElement elem) Propagates the probe through the element.booleanReturn the emittance growth flag.booleanReturns the flag determining whether or not space charge effects are being considered during the propagation.doubleReturns the element subsection length (in meters) that the probe may be advanced for exceptional cases.voidload(String strPrimKeyVal, EditContext ecTableData) Load the parameters of thisIAlgorithmobject from the table data in the givenEditContext.voidload(DataAdaptor daSource) Load the parameters of the algorithm from a data source exposing theIArchiveinterface.voidsave(DataAdaptor daSink) Save the state and settings of this algorithm to a data source exposing theDataAdaptorinterface.voidsetEmittanceGrowth(boolean bolEmitGrowth) Set the emittance growth flag.voidsetStepSize(double dblStepSize) Set the step size used for PMQ and any other exceptional propagation.voidsetUseSpacecharge(boolean bolScheff) Method to set the flag to use/notuse spacecharge.Methods inherited from class xal.model.alg.Tracker
advanceProbe, getDebugMode, getElemPosition, getProbeType, getProbeUpdatePolicy, getRfGapPhaseCalculation, getStartElementId, getStopElementId, getType, getVersion, initialize, isStopElementIncluded, newFromEditContext, newFromEditContext, newInstance, propagate, registerProbeType, retractProbe, setDebugMode, setElemPosition, setIncludeStopElement, setProbeUpdatePolicy, setRfGapPhaseCalculation, setStartElementId, setStopElementId, unsetStartElementId, unsetStopElementId, validElement, validProbe
-
Field Details
-
TBL_LBL_TWISSTRACKER
EditContext table name containing EnvelopeTracker parameters- See Also:
-
TBL_PRIM_KEY_NAME
Table record primary key name- See Also:
-
LABEL_OPTIONS
data node label for EnvelopeTracker settings- See Also:
-
ATTR_SCHEFF
label for simulating space charge effects- See Also:
-
ATTR_USESPACECHARGE
label for simulating space charge effects- See Also:
-
ATTR_EMITGROWTH
label for emittance growth flag- See Also:
-
ATTR_STEPSIZE
label for maxstepsize *- See Also:
-
TYPE_ID
string type identifier for algorithm -
VERSION
public static final int VERSIONcurrent algorithm version- See Also:
-
CLS_PROBE_TYPE
probe type recognized by this algorithm
-
-
Constructor Details
-
TwissTracker
public TwissTracker()Creates a new instance of EnvelopeTracker -
TwissTracker
Creates a new, empty, instance of EnvelopeTracker. This method is a protected constructor meant only for child classes.- Parameters:
strType- string type identifier of algorithmintVersion- version of algorithmclsProbeType- class object for probe handled by this algorithm.
-
TwissTracker
Copy constructor for TwissTracker- Parameters:
sourceTracker- Tracker that is being copied
-
-
Method Details
-
copy
Creates a deep copy of TwissTracker -
setStepSize
public void setStepSize(double dblStepSize) Set the step size used for PMQ and any other exceptional propagation. Normally we take one step through a beamline element- Parameters:
dblStepSize- new step size in meters
-
setEmittanceGrowth
public void setEmittanceGrowth(boolean bolEmitGrowth) Set the emittance growth flag. If set true then the algorithm will simulate emittance growth through RF gaps. NOTE: If set, the dynamics will no longer be consistent since the response matrix and betatron phases will not reproduce the current Twiss parameters.- Parameters:
bolEmitGrowth- set true to simulation emittance growth- See Also:
-
setUseSpacecharge
public void setUseSpacecharge(boolean bolScheff) Method to set the flag to use/notuse spacecharge.- Parameters:
bolScheff- set whether or not to simulation space charge effects
-
getStepSize
public double getStepSize()Returns the element subsection length (in meters) that the probe may be advanced for exceptional cases. Typically, probe is propagated through the entire element.- Returns:
- special case step size in meters
-
getEmittanceGrowthFlag
public boolean getEmittanceGrowthFlag()Return the emittance growth flag.- Returns:
- true if we are simulating emittance growth, false otherwise
- See Also:
-
getSpaceChargeFlag
public boolean getSpaceChargeFlag()Returns the flag determining whether or not space charge effects are being considered during the propagation.- Returns:
- true if space charge forces are used, false otherwise
-
doPropagation
Propagates the probe through the element.- Specified by:
doPropagationin classTracker- Parameters:
probe- probe to propagateelem- element acting on probe- Throws:
ModelException- invalid probe type or error in advancing probe- See Also:
-
load
Load the parameters of thisIAlgorithmobject from the table data in the givenEditContext. Here we load only the parameters specific to the base class. It is expected that Subclasses should override this method to recover the data particular to there own operation.- Specified by:
loadin interfaceIContextAware- Overrides:
loadin classTracker- Parameters:
strPrimKeyVal- primary key value specifying the name of the data recordecTableData- EditContext containing table data- Throws:
DataFormatException- bad data format - error in reading- See Also:
-
load
Load the parameters of the algorithm from a data source exposing theIArchiveinterface. The superclassloadmethod is called first, then the properties particular toEnvTrackerAdaptare loaded. -
save
Save the state and settings of this algorithm to a data source exposing theDataAdaptorinterface. Subclasses should override this method to store the data particular to there own operation. -
advanceState
Advances the probe state through a subsection of the element with the specified length. Applies a space charge kick at the end of the element subsection for any probe having nonzero beam current.- Parameters:
ifcElem- interface to the beam elementifcProbe- interface to the probedblLen- length of element subsection to advance through- Throws:
ModelException- bad element transfer matrix/corrupt probe state
-