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:
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
The third format keeps all existing selections and additionally marks those elements as selected which belong to the intersection of the following four sets:
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.