public class TransferMatrixGenerator
extends java.lang.Object
Class for generating transfer matrices for the XAL accelerator beamlines. For economic
reasons the simulation is first run using methods generateWithoutSpaceCharge()
for the zero-current case or generateWithSpaceCharge(double, double, CovarianceMatrix)
for the finite beam current case. Once the simulation is completed transfer
matrices between any two beamline elements may be retrieved with the method
retrieveTransferMatrix(String, String)
. Note that when space charge is
present an initial covariance matrix for the beam must be supplied. The matrix
describes the beam sizes at the entrance to the beamline.
Modifier and Type | Class and Description |
---|---|
static class |
TransferMatrixGenerator.SYNC
Enumeration set representing the possible synchronization modes of the
class. |
Constructor and Description |
---|
TransferMatrixGenerator(AcceleratorSeq smfSeq)
Creates a new
TransferMatrixGenerator object using the
given sequence, and synchronizes to the design parameters. |
TransferMatrixGenerator(AcceleratorSeq smfSeq,
long lngPvLogId)
Creates a new
TransferMatrixGenerator object using
the given sequence, initializes the model to the historical machine state identified
by the given PV Logger ID. |
TransferMatrixGenerator(AcceleratorSeq smfSeq,
TransferMatrixGenerator.SYNC enmSyn)
Creates a new
TransferMatrixGenerator object using the given accelerator (XML definition file)
accelerator, the given sequence, and the given synchronization mode. |
Modifier and Type | Method and Description |
---|---|
void |
generateWithoutSpaceCharge()
Generates all the transfer matrices for the zero-current
case.
|
void |
generateWithSpaceCharge(double dblBnchFreq,
double dblBeamCurr,
CovarianceMatrix matInitState)
Generates all the transfer matrices including space
charge effects.
|
void |
generateWithSpaceCharge(java.lang.String strDevIdStart,
double dblBnchFreq,
double dblBeamCurr,
CovarianceMatrix matInitState)
Generates all the transfer matrices when there are significant space
charge effects.
|
PhaseMatrix |
retrieveTransferMatrix(java.lang.String strElemStop)
Compute and return the transfer matrix from the beginning
of the current accelerator sequence to the entrance of the given element.
|
PhaseMatrix |
retrieveTransferMatrix(java.lang.String strElemStart,
java.lang.String strElemStop)
Compute and return the transfer matrix from the entrance of the given starting element
to the entrance of the given stop element (within the current accelerator sequence).
|
void |
setSynchronizationMode(TransferMatrixGenerator.SYNC enmSync)
Sets the source of hardware parameters for the simulations.
|
void |
setSyncToMachineHistory(long lngPvLogId)
Synchronizes to the machine parameters at the time of the given PV logger
snapshot ID.
|
public TransferMatrixGenerator(AcceleratorSeq smfSeq) throws ModelException
TransferMatrixGenerator
object using the
given sequence, and synchronizes to the design parameters.smfSeq
- the desired sequence for transfer matrix computationModelException
- and error occurred when instantiating the machine modelpublic TransferMatrixGenerator(AcceleratorSeq smfSeq, long lngPvLogId) throws ModelException
TransferMatrixGenerator
object using
the given sequence, initializes the model to the historical machine state identified
by the given PV Logger ID.smfSeq
- the desired sequence for transfer matrix computationlngPvLogId
- PV Logger ID of the historical machine snapshot where model parameters are takenModelException
- and error occurred when instantiating the machine modelpublic TransferMatrixGenerator(AcceleratorSeq smfSeq, TransferMatrixGenerator.SYNC enmSyn) throws ModelException
TransferMatrixGenerator
object using the given accelerator (XML definition file)
accelerator, the given sequence, and the given synchronization mode.smfSeq
- the desired sequence for transfer matrix computationenmSyn
- source of machine parametersModelException
- and error occurred when instantiating the machine model or a componentpublic void setSynchronizationMode(TransferMatrixGenerator.SYNC enmSync) throws SynchronizationException
setSyncToMachineHistory(long)
).enmSync
- synchronization mode determining parameter sourceSynchronizationException
- general error during model synchronizationpublic void setSyncToMachineHistory(long lngPvLogId) throws SynchronizationException
lngPvLogId
- PV Logger ID for the historical machine stateSynchronizationException
- general error during model synchronizationpublic void generateWithoutSpaceCharge() throws ModelException
Generates all the transfer matrices for the zero-current case. The model is run using a transfer map probe which only collects machine data.
ModelException
- general error during model synchronization or simulationpublic void generateWithSpaceCharge(double dblBnchFreq, double dblBeamCurr, CovarianceMatrix matInitState) throws ModelException
Generates all the transfer matrices including space charge effects. The simulation is performed with the given bunch charge and the initial beam state at the entrance to the associated accelerator sequence.
This methods is a direct proxy to
using #generateWithSpaceCharge(String, double, CovarianceMatrix)
null
as the first argument.
dblBnchFreq
- bunch arrival frequency (in Hz)dblBeamCurr
- beam current (in Amperes)matInitState
- initial state of the beam, initial covariance matrixModelException
- general error during model synchronization or simulation#generateWithSpaceCharge(String, double, CovarianceMatrix)
public void generateWithSpaceCharge(java.lang.String strDevIdStart, double dblBnchFreq, double dblBeamCurr, CovarianceMatrix matInitState) throws ModelException
Generates all the transfer matrices when there are significant space charge effects. The simulation is performed with the given bunch charge and the initial beam state at the given element location. Thus, the given probe state corresponds to the given element.
There is a self-consistency issue between the space charge effects and the beam size. Thus, the transfer matrices will typically be different for different starting configurations of the beam.
strDevIdStart
- ID of device with which to start the simulation,
or null
for the beginning of the sequencedblBnchChg
- beam bunch charge in CoulombsmatInitState
- initial state of the beam, initial covariance matrixModelException
- general error during model synchronization or simulationpublic PhaseMatrix retrieveTransferMatrix(java.lang.String strElemStop) throws java.lang.IllegalStateException
generateWithoutSpaceCharge()
or
#generateWithSpaceCharge(String, double, CovarianceMatrix)
.strElemStop
- string identifier of the terminal elementjava.lang.IllegalStateException
- The transfer matrices have not been generated yetgenerateWithoutSpaceCharge()
,
#generateWithSpaceCharge(String, double, CovarianceMatrix)
public PhaseMatrix retrieveTransferMatrix(java.lang.String strElemStart, java.lang.String strElemStop) throws java.lang.IllegalStateException
generateWithoutSpaceCharge()
or
#generateWithSpaceCharge(String, double, CovarianceMatrix)
.strElemStart
- string identifier of the starting elementstrElemStop
- string identifier of the terminal elementjava.lang.IllegalStateException
- The transfer matrices have not been generated yetgenerateWithoutSpaceCharge()
,
#generateWithSpaceCharge(String, double, CovarianceMatrix)