next up previous contents index
Next: Attach Special Integrators Up: Tables Previous: Introduction   Contents   Index


Element Selection

Many MAD commands allow for the possibility to process a subset of the elements occurring in a beam line. For this purpose each beam line and table has a selection flag for each element. The SELECT command may be used to manipulate these flags. It affects the following commands:

Three formats are recognised for the command:

SELECT,LINE=name,FULL;
SELECT,LINE=name,CLEAR;
SELECT,LINE=name,RANGE=range,CLASS=name,TYPE=name,PATTERN=regular_expression;
All three forms require the parameter
LINE
The label of a previously defined beam line or table on which the selection is to be done (no default).
The first format sets the selection flag for all elements in the beam line and the second format clears the selection flags for all elements.

The third format keeps all existing selections and additionally marks those elements as selected which belong to the intersection of the following four sets:

RANGE
If RANGE is omitted, the first set contains all elements; if it is given, the first set is limited to the named range in the line. The default is equivalent to RANGE=#S/#E.
CLASS
The label of an element class (default: blank). If CLASS is omitted, the second set contains all elements; if it is given, the set contains only the elements derived directly or indirectly from the named class.
TYPE
If TYPE is omitted, the third set contains all elements; if it is given, the set contains only the elements whose TYPE attribute is equal to the given name.
PATTERN
If PATTERN is omitted, the fourth set contains all elements; if it is given, the regular expression is applied to all element names, and the set contains only the matching elements.
The effect of subsequent SELECT commands produces the union of all selections. If a fresh selection is desired, precede the new SELECT command with the command

SELECT,LINE=name,CLEAR;
Example:

SELECT,LINE=X,RANGE=IP1/IP2;                            // (1)
SELECT,LINE=X,CLASS=BB;                                 // (2)
SELECT,LINE=X,PATTERN=".*\.L1";                         // (3)
SELECT,LINE=X,RANGE=IP1/IP2,CLASS=BB,PATTERN=".*\.L1";  // (4)
SELECT,LINE=LHC,CLASS=IP;                               // (5)
T:TWISS,LINE=LHC;                                       // (6)
SELECT,LINE=T,CLASS=QUADRUPOLE;                         // (7)
TWISS3,TABLE=T,FILE=name,TFS;                           // (8)
U:TWISS,LINE=LHC;                                       // (9)
Command (1) selects all elements from IP1 to IP2, both included. Command (2) selects all elements in the ring which belong to or are derived from class BB. Command (3) selects all elements in the ring whose names end .L1. Command (4) is the most restrictive, it selects all elements between IP1 and IP2 which are derived from class BB and whose names end in .L1.

Command (5) sets the selections flags on all interaction points in line LHC. The selection is transmitted to command (6), which generates the TWISS table T lists the default columns for the interaction points. Command (7) sets additional selection flags on the table T for all quadrupoles, and command (8) lists the Mais-Ripken functions for all interaction points and all quadrupoles. Command (9) gets the selection from line LHC, i. e. the selection concerns only the interaction points.


next up previous contents index
Next: Attach Special Integrators Up: Tables Previous: Introduction   Contents   Index
MAD User Guide, http://wwwslap.cern.ch/mad/