Fork me on GitHub

source: git/external/Hector/H_BeamLineParser.h@ 952bbbc

Last change on this file since 952bbbc was 3c40083, checked in by pavel <pavel@…>, 11 years ago

switch to a more stable Hector version

  • Property mode set to 100644
File size: 2.8 KB
Line 
1#ifndef _H_BeamLineParser_
2#define _H_BeamLineParser_
3
4/*
5---- Hector the simulator ----
6 A fast simulator of particles through generic beamlines.
7 J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
8
9 http://www.fynu.ucl.ac.be/hector.html
10
11 Centre de Physique des Particules et de Phénoménologie (CP3)
12 Université Catholique de Louvain (UCL)
13*/
14
15/// \file H_BeamLineParser.h
16/// \brief Reader for madx tables
17///
18/// Notes : Verifier que tous les SBEND sont toujours appeles MB. Et seulement comme ca !
19/// Verifier qu'il n'y a pas de probleme d'inversion H/V QUADRUPOLES
20/// no distinction between H and Vkickers ?
21/// The identification of the element is based on the values of k1l, k2l, hkick, vkick and on their name.
22
23// c++ #includes
24#include <iostream>
25#include <string>
26#include <fstream>
27#include <sstream>
28using namespace std;
29
30// local defines
31#define MADX_UNKNOWN 0
32#define MADX_NAME 1
33#define MADX_KEYWORD 2
34#define MADX_S 3
35#define MADX_L 4
36#define MADX_K0L 5
37#define MADX_K1L 6
38#define MADX_K2L 7
39#define MADX_K3L 8
40#define MADX_HKICK 9
41#define MADX_VKICK 10
42#define MADX_BETX 11
43#define MADX_ALFX 12
44#define MADX_MUX 13
45#define MADX_DX 14
46#define MADX_DPX 15
47#define MADX_X 16
48#define MADX_PX 17
49#define MADX_BETY 18
50#define MADX_ALFY 19
51#define MADX_MUY 20
52#define MADX_DY 21
53#define MADX_DPY 22
54#define MADX_Y 23
55#define MADX_PY 24
56#define MADX_APERTYPE 25
57#define MADX_APER_1 26
58#define MADX_APER_2 27
59#define MADX_APER_3 28
60#define MADX_APER_4 29
61#define MADX_KICK 30
62#define MADX_PARENT 31
63/* Apertures # parameters
64 CIRCLE 1
65 ELLIPSE 2
66 RECTANGLE 2
67 LHCSCREEN 3
68 MARGUERITE 3
69 RECTELLIPSE 4
70 RACETRACK 3
71*/
72
73extern int column_identification(const string );
74
75/// \brief Reader for madx tables to use in H_BeamLine
76///
77/// More info on http://project-mad9.web.cern.ch/project-mad9/mad/mad9/user/index.html
78class H_BeamLineParser {
79
80 public:
81 /// Constructor and destructor
82 //@{
83 H_BeamLineParser() {init();}
84 ~H_BeamLineParser() {return;}
85 //@}
86 void init();
87 /// Retrieve the data from the line it reads, and sets the corresponding variable.
88 void setProperties(istream& , const unsigned int );
89 void printProperties() const;
90 string name, apertype, keyword, parent;
91 /// Optical element longitudinal (co-moving) coordinate.
92 double s;
93 /// Length of the element.
94 double l;
95 /// Magnetic field strength.
96 //@{
97 double k0l, k1l, k2l, k3l, hkick, vkick;
98 //@}
99 /// Phase (mu), \f$ \alpha \f$(alf) and \f$ \beta \f$(bet) functions, given by MAD.
100 //@{
101 double mux, muy, betx, alfx, bety, alfy;
102 //@}
103 /// Positions and their dispersion
104 //@{
105 double x, y, dx, dy;
106 //@}
107 /// Momentum and their dispersion
108 //@{
109 double px, py, dpx, dpy;
110 //@}
111 /// Aperture parameters
112 //@{
113 double aper_1, aper_2, aper_3, aper_4;
114 //@}
115};
116
117#endif
Note: See TracBrowser for help on using the repository browser.