source: PSPA/madxPSPA/doc/usrguide/Introduction/elm_class.html @ 430

Last change on this file since 430 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 2.1 KB
Line 
1<head>
2<title>Element Classes</title>
3<!-- Changed by: Chris ISELIN, 24-Jan-1997 -->
4<!-- Changed by: Hans Grote, 25-Sep-2002 -->
5</head>
6
7<body bgcolor="#ffffff">
8
9<h1>Element Classes</h1>
10
11The concept of element classes solves the problem of addressing
12instances of elements in the accelerator in a convenient manner.
13It will first be explained by an example.
14All the quadrupoles in the accelerator form a class QUADRUPOLE.
15Let us define three subclasses for the focussing quadrupoles,
16the defocussing quadrupoles, and the skewed quadrupoles:
17<pre>
18MQF: QUADRUPOLE,L=LQM,K1=KQD;     ! Focussing quadrupoles
19MQD: QUADRUPOLE,L=LQM,K1=KQF;     ! Defocussing quadrupoles
20MQT: QUADRUPOLE,L=LQT;            ! Skewed quadrupoles
21</pre>
22These classes can be thought of as new keywords which define
23elements with specified default attributes.
24We now use theses classes to define the real quadrupoles:
25<pre>
26QD1: MQD;           ! Defocussing quadrupoles
27QD2: MQD;
28QD3: MQD;
29 ...
30QF1: MQF;           ! Focussing quadrupoles
31QF2: MQF;
32QF3: MQF;
33 ...
34QT1: MQT,K1S=KQT1;   ! Skewed quadrupoles
35QT2: MQT,K1S=KQT2;
36 ...
37</pre>
38These quadrupoles inherit all unspecified attributes from their class.
39This allows to build up a hierarchy of objects with a rather
40economic input structure.
41<p>
42The full power of the class concept is revealed when object classes
43are used to select instances of elements for various purposes.
44Example:
45<pre>
46select,flag=twiss,class=QUADRUPOLE; ! Select all quadrupoles for the
47                                    ! Twiss TFS file
48</pre>
49<p>
50More formally, for each element keyword MAD maintains a
51class of elements with the same name.
52A defined element becomes itself a class which can be used
53to define new objects,
54which will become members of this class.
55A new object inherits all attributes from its class;
56but its definition may override some of those values by new ones.
57All class and object names can be used in range selections,
58providing a powerful mechanism to specify positions
59for matching constraints and printing.
60
61<address><a href="http://www.cern.ch/Hans.Grote/hansg_sign.html">hansg</a>,
62January 24, 1997
63</address>
64
65</body>
Note: See TracBrowser for help on using the repository browser.