SLAC ESD Software Engineering Group
Stanford Linear Accelerator Center
AIDA

SLC Model Data Provider Guide

SLAC Detailed
SLAC Computing
Software Home
Software Detailed
AIDA
SLC Peer PG

This page provides documentation for users and programmers of AIDA's SLC Model Data Provider.

See Also: Basic Users Guide to Aida, REF_AIDASHR; AIDA SLC Peer Programmers Guide


Users Guide

This section descibes what an AIDA user should know about accessing SLC Model Data through AIDA. For general information on using AIDA see Basic Users Guide to Aida, and the Aida javadoc, in particular the classes DaObject and DaReference (and DaReference's parent _DaReference) in aida.lib.da which form Aida's programming interface. One can also use Matlab.

Table 1: Summary of AIDA Data Provider for SLC Model Data

SUMMARY
Acquires Twiss and Rmatrix parameters of devices modelled in the SLC Online modelling system. The list of modelled device type primaries is AMPL, ARRY, BEND, BNDS, BPMS, COLL, KICK, MARK, PROF, QUAD, QUAS, SEPT, SEXT, SOLN, SOLS, SPTS, SXTS, WIRE, XCOR, XMOV, YCOR, YMOV.

Take care though, each device instance is only modelled under certain machine Twiss modes. When asking for the model of a given device, you need to supply a Twiss mode under which your device was modelled. FACET will be twiss MODE 1 or MODE 2.

Status and limitations

Only presently acquires the COMPUTED or DESIGN model, no MEASURED (see Online Model API documentation for more). The model values may be obtained from the SLC database or a Dimad file. Non-MBIT devices such as QUAD, BEND, and SOLN are only be obtained from a Dimad file.

Plan Add global model data, such tune, beta at IP etc.

EXAMPLES
Schematic Java example of getting Twiss params, see DpSlcModelTests.java for Rmat example:
String query = "BPMS:PR02:8032//twiss";   // Note case
da.setParam("MODE=7");
da.setParam("DGRP=NULL");
Float[] twiss = (Float[])da.geta(query, DaValue.Type.FLOATA);
Java $CD_SOFT/ref/package/aida/test/java/DpSlcModelTests.java
Matlab $CD_SOFT/ref/package/aida/test/matlab/modelDemo.m

INSTANCES and ATTRIBUTES
Instance Type Description
SLC Modelled Device Syntax <prim>:<micr>:<unit>//{twiss|R}
Examples

BPMS:PR08:8032//twiss

BPMS:PR10:8012//R

Attributes
Attribute Description
twiss The Courant-Snyder parameters of given SLC modelled "device" (d)
Methods Name* Returns
getDaValue(q) DaValue containing an array of 11 float: Energy (GeV), psix, betax (m), alphax , etax (m), etax', psiy, betay (m), alphay, etay (m), etay'
geta(d,DaValue.Types.FLOATA) array of 11 Float, see getDaValue
geta(d,DaValue.Types.DOUBLEA) array of 11 Double, see getDaValue
Arguments Name

Req/
Opt

Syntax Semantics
DGRP

opt

Dgrp name The SLC Display Group (DGRP) under which the device was modelled - see modl_line.def
MODE req The integer corresponding to the mode, eg 1 or 2 for FACET. The SLC global machine Twiss Mode under which the model was run
TYPE opt COMPUTED, DATABASE, or DESIGN The type of desired model: COMPUTED (DATABASE is a synonym) or DESIGN. The default is COMPUTED.
POS opt BEG, BEGINNING, MID, MIDDLE, or END The position of the device for which the model value should be returned: BEG (BEGINNING is a synonym), MID (MIDDLE is a synonym), or END. The default is END.
R The 6x6 transfer matrix from upstream marker point to named device (d), returned as 1 array. If the B argument is specified, gets the transfer R-matrix from the A device (d) to the B device specified by the B argument. For a specified B argument, the usual case is that the A device is upstream of the B device. However, the A device may be downstream of the B device, in which case the inverse matrix is returned.
Methods Name* Returns
geta(d,DaValue.Types.FLOATA) array of 36 Float, 1st 6 are 1st row of R-matrix, 2nd 6 are 2nd row, and so on.
geta(d,DaValue.Types.DOUBLEA) array of 36 Double, 1st 6 are 1st row of R-matrix, 2nd 6 are 2nd row, and so on.
getDaValue(d) DaValue containing an array of 36 float. Extract array with methods of java.util.Vector such as get() (which DaValue extends).
Arguments Name

Req/
Opt

Syntax Semantics
DGRP

opt

Dgrp name The SLC Display Group (DGRP) under which the device was modelled - see modl_line.def
MODE req The integer corresponding to the mode, eg 1 or 2 for FACET. The SLC global modelling Mode under which the model was run
TYPE opt COMPUTED, DATABASE, or DESIGN The type of desired model: COMPUTED (DATABASE is a synonym) or DESIGN. The default is COMPUTED.
POS opt BEG, BEGINNING, MID, MIDDLE, or END The position of the device for which the model value should be returned: BEG (BEGINNING is a synonym), MID (MIDDLE is a synonym), or END. The default is END. This argument should not be specified if the B argument is specified.
B opt <prim>:<micr>:<unit> If specified, the specification of the second device for the transfer R-matrix from the MIDdle of the first device (d) to the MIDdle of the second device (POS argument, if given, gives IllegalArgumentException).

* See DaObject and DaReference (and DaReference's parent _DaReference) in aida.lib.da for full API and method signatures.


Programmers Guide

The SLC Model Data Provider is a provider in the AIDA SLC Peer (along with the SLC DB Data Provider, the SLC History Data Provider, the SLC BPM Data Provider, the SLC Magnet Data Provider, the SLC Multiknob Data Provider, the SLC Master Oscillator Data Provider, and the SLC Klystron Data Provider). Development of all these data providers is described in a Programmers Guide here.


[SLAC ESD Software Engineering Group][ SLAC Home Page]

Author:  Greg White 09-Dec-2004
Modified by: Greg White 03-Feb-2005, Added R-matrix
Modified by: Greg White 17-Mar-2005, Put in real method names
Modified by: Bob Hall 30-Mar-2007, Added descripiton of R-matrix A-to-B and retrieval from Dimad file (with new TYPE and POS parameters).
Modified by: Bob Hall 19-Apr-2007, Changed description of R-matrix A-to-B to include the possibility that device A may be downstream of device B.