next up previous contents index
Next: Reflection and Repetition Up: Beam Lines Previous: Simple Beam Lines   Contents   Index


Sub-lines

Instead of referring to an element, a beam line member can refer to another beam line defined in a separate command. This provides a shorthand notation for sub-lines which occur several times in a beam line. Lines and sub-lines can be entered in any order, but when a line is used, all its sub-lines must be known.

Example:


L:LINE=(A,B,S,B,A,S,A,B);
S:LINE=(C,D,E);
TWISS,LINE=printL;
This example produces the following expansion steps:
  1. Replace sub-line S:
    
    (A,B,(C,D,E),B,A,(C,D,E),A,B)
    
  2. Omit parentheses:
    
    A,B,C,D,E,B,A,C,D,E,A,B
    



MAD User Guide, http://wwwslap.cern.ch/mad/