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 String
label for emittance growth flagprotected static final String
label for simulating space charge effectsprotected static final String
label for maxstepsize *protected static final String
label for simulating space charge effectsstatic final Class<TwissProbe>
probe type recognized by this algorithmprotected static final String
data node label for EnvelopeTracker settingsprotected static final String
EditContext table name containing EnvelopeTracker parametersprotected static final String
Table record primary key namestatic final String
string type identifier for algorithmstatic final int
current 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 EnvelopeTrackerprotected
TwissTracker
(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 void
advanceState
(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 TwissTrackervoid
doPropagation
(IProbe probe, IElement elem) Propagates the probe through the element.boolean
Return the emittance growth flag.boolean
Returns the flag determining whether or not space charge effects are being considered during the propagation.double
Returns the element subsection length (in meters) that the probe may be advanced for exceptional cases.void
load
(String strPrimKeyVal, EditContext ecTableData) Load the parameters of thisIAlgorithm
object from the table data in the givenEditContext
.void
load
(DataAdaptor daSource) Load the parameters of the algorithm from a data source exposing theIArchive
interface.void
save
(DataAdaptor daSink) Save the state and settings of this algorithm to a data source exposing theDataAdaptor
interface.void
setEmittanceGrowth
(boolean bolEmitGrowth) Set the emittance growth flag.void
setStepSize
(double dblStepSize) Set the step size used for PMQ and any other exceptional propagation.void
setUseSpacecharge
(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:
doPropagation
in 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 thisIAlgorithm
object 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:
load
in interfaceIContextAware
- Overrides:
load
in 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 theIArchive
interface. The superclassload
method is called first, then the properties particular toEnvTrackerAdapt
are loaded. -
save
Save the state and settings of this algorithm to a data source exposing theDataAdaptor
interface. 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
-