-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathranges.tex
More file actions
76 lines (62 loc) · 2.53 KB
/
ranges.tex
File metadata and controls
76 lines (62 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
%%\title{Range Selection}
% Changed by: Chris ISELIN, 27-Jan-1997
% Changed by: Hans Grote, 10-Jun-2002
\chapter{Range and Class Selection Format}
\section{RANGE}
\label{sec:range}
A range can be defined starting at a given element and ending at
another element, both elements included. Two forms exist:
\madxmp{
RANGE = position; \\
RANGE = position1 / position2;
}
In the first case, only one element is selected; in the second case, one
or several elements that are between \texttt{position1} and
\texttt{position2} are selected. \\
NOTE: \texttt{position1} must appear before \texttt{position2} in the
sequence.
The \texttt{position} is composed of a single element name if that name
is unique in the sequence, or an element class name followed by the
occurrence count \texttt{n} in the sequence within square brackets to
specify the n$^{th}$ occurence of an element of that class in the sequence:
\label{range_position}
\madxmp{
xxxxxxxxxxxxxx\= \kill
mq.ir5.l6..1 \> ! unique element in the sequence\\
mb[17] \> ! 17th occurence of an element of class mb
}
There are two special predefined psoitions in \madx:
\begin{madlist}
\ttitem{\#S} The start of the beam line or sequence expanded by \hyperref[sec:use]{\texttt{USE}},
\ttitem{\#E} The end of the beam line or sequence expanded by \hyperref[sec:use]{\texttt{USE}}.
\end{madlist}
If a range is selected in a \texttt{USE} statement:
\madxmp{
USE, PERIOD=lhcb1, RANGE=ir1/ir5;
}
then the \texttt{\#S} and \texttt{\#E} indices refer to the start and
end of the range expanded by the \texttt{USE} statement.
Examples for ranges:
\madxmp{
xxxxxxxxxxxxxxxxxxxxxxxx\= \kill
.., RANGE=\#S; \>! first element \\
.., RANGE=\#S/\#E; \>! full expansion range \\
.., RANGE=mb[5]/\#E; \>! from 5th mb to end \\
.., RANGE=mq.ir5.l6..1; \>! first occurrence of element mq.ir5.l6..1
}
\section{CLASS}
\label{sec:class}
The single name of a class (no occurrence counts). A class is the name
of an element (or basic type) from which other elements have been
derived.
Example:
\madxmp{
MQ: quadrupole; \= ! makes the element MQ \\
Q1: MQ; \> ! makes the element Q1 from class MQ \\
Q2: MQ; \> ! makes the element Q2 from class MQ \\
Q1..A: Q1; \> ! makes an element from class Q1 \\
Q2..B: Q2; \> ! makes an element from class Q2
}
Subsequent selection with criterion \texttt{CLASS="MQ"} will actually select
\texttt{Q1, Q2, Q1..A}, and \texttt{Q2..B} in this example.
%\href{http://www.cern.ch/Hans.Grote/hansg_sign.html}{hansg}, June 17, 2002