Fork me on GitHub

source: svn/trunk/Utilities/Hector/include/H_TransportMatrices.h@ 530

Last change on this file since 530 was 281, checked in by Xavier Rouby, 16 years ago

new Hector version

File size: 6.4 KB
Line 
1#ifndef _H_TransportMatrices_
2#define _H_TransportMatrices_
3
4 /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
5 * *
6* --<--<-- A fast simulator --<--<-- *
7* / --<--<-- of particle --<--<-- *
8* ----HECTOR----< *
9* \ -->-->-- transport through -->-->-- *
10* -->-->-- generic beamlines -->-->-- *
11* *
12* JINST 2:P09005 (2007) *
13* X Rouby, J de Favereau, K Piotrzkowski (CP3) *
14* http://www.fynu.ucl.ac.be/hector.html *
15* *
16* Center for Cosmology, Particle Physics and Phenomenology *
17* Universite catholique de Louvain *
18* Louvain-la-Neuve, Belgium *
19 * *
20 * * * * * * * * * * * * * * * * * * * * * * * * * * * */
21
22/** \file H_TransportMatrices.h
23 * \brief Contains the matrices defining the propagation of the beam.
24 *
25 * The matrices should have the following units :
26 * \f$
27 * \mathbf{M} =
28 * \left(
29 * \begin{array}{cccccc}
30 * 1 & 1/m & 1 & 1/m & GeV/m & 1 \\
31 * m & 1 & m & 1 & GeV & 1 \\
32 * 1 & 1/m & 1 & 1/m & GeV/m & 1\\
33 * m & 1 & m & 1 & GeV & 1 \\
34 * m/GeV & 1/GeV & m/GeV & 1/GeV & 1 & 1\\
35 * 1 & 1 & 1 & 1 & 1 & 1 \\
36 * \end{array}
37 * \right)
38 * \f$
39 *
40 * Note : convention is transposed compared to ref : x0.M = x1
41 * instead of x1 = M.x0 so the matrices should be transposed.
42 */
43
44// ROOT #includes
45#include "TMatrix.h"
46using namespace std;
47
48 /// transport matrix dimension
49#define MDIM 6
50
51/// \f$ \omega(k,l) = l \sqrt{|k|} \f$ is needed for the quadrupole matrices
52extern double omega(const double , const double );
53
54/// \f$ r(k) \f$ is needed for the dipole matrices
55extern double radius(const double );
56
57/// Prints the matrix
58extern void printMatrix(TMatrix);
59
60/// \brief Returns the matrix for a vertically focussing quadrupole (H_VerticalQuadrupole)
61
62/*! \f$
63 \mathbf{M} =
64 \left(
65 \begin{array}{cccccc}
66 \cosh(\omega) & \sqrt{k}\sinh(\omega) & 0 & 0 & 0 & 0\\
67 (1/\sqrt{k})sinh(\omega) & \cosh(\omega) & 0 & 0 & 0 &0\\
68 0 & 0 & \cos(\omega) & -\sqrt{k}sin(\omega) & 0 &0\\
69 0 & 0 & (1/\sqrt{k})*sin(\omega) & \cos(\omega) & 0 &0\\
70 0 & 0 & 0 & 0 & 1 &0\\
71 0 & 0 & 0 & 0 & 0 &1 \\
72 \end{array}
73 \right)
74 \f$
75
76 assuming \f$ k = k_{0} \times \frac{p_{0}}{p_{0} - dp} \times \frac{q_{particle}}{q_{proton}} \f$ and \f$ \omega(k,l) = l \sqrt{|k|} \f$
77*/
78
79extern TMatrix vquadmat(const float , const float , const float , const float , const float);
80
81/// \brief Returns the matrix for a horizontally focussing quadrupole (H_HorizontalQuadrupole)
82
83/*! \f$
84 \mathbf{M} =
85 \left(
86 \begin{array}{cccccc}
87 \cos(\omega) & -\sqrt{k}\sin(\omega) & 0 & 0 & 0 & 0\\
88 (1/\sqrt{k})sin(\omega) & \cos(\omega) & 0 & 0 & 0 & 0\\
89 0 & 0 & \cosh(\omega) & \sqrt{k}sinh(\omega) & 0 & 0\\
90 0 & 0 & (1/\sqrt{k})sinh(\omega) & \cosh(\omega) & 0 & 0\\
91 0 & 0 & 0 & 0 & 1 & 0\\
92 0 & 0 & 0 & 0 & 0 & 1 \\
93 \end{array}
94 \right)
95 \f$
96
97 assuming \f$ k = k_{0} \times \frac{p_{0}}{p_{0} - dp} \times \frac{q_{particle}}{q_{proton}} \f$ and \f$ \omega(k,l) = l \sqrt{|k|} \f$
98*/
99extern TMatrix hquadmat(const float , const float , const float , const float , const float);
100
101/// \brief Returns the matrix for a rectangle dipole (H_RectangularDipole)
102
103/*! \f$
104 \mathbf{M} =
105 \left(
106 \begin{array}{cccccc}
107 \cos(l/r) & \frac{-1}{r} \sin(l/r) & 0 & 0 & 0 & 0\\
108 r \sin(l/r) & \cos(l/r) & 0 & 0 & 0 & 0\\
109 0 & 0 & 1 & 0 & 0 &0\\
110 0 & 0 & l & 1 & 0 &0\\
111 2r \sin^2(l/2r)/BE & \sin(l/r)/BE & 0 & 0 & 1 &0\\
112 0 & 0 & 0 & 0 & 0 & 1\\
113 \end{array}
114 \right)
115 \f$
116
117 assuming \f$ 1/r = k = k_{0} \times \frac{p_{0}}{p_{0} - dp} \times \frac{q_{particle}}{q_{proton}} \f$ and \f$ BE = 7000 GeV \f$.
118
119Attention : numerical sensitivity with \f$ r*(1-\cos(l/r))/BE\f$. \\
120Using \f$ 2\sin^2(x/2) = 1-\cos(x)\f$ instead (see the variable called "simp")
121*/
122extern TMatrix rdipmat(const float, const float , const float , const float , const float);
123
124/// \brief Returns the matrix for a sector dipole (H_SectorDipole)
125
126/*! The matrix is different if the bending is on or off.
127
128 \f$
129 \mathbf{M_{bending-off}} =
130 \left(
131 \begin{array}{cccccc}
132 \cos(l/r) & \frac{-1}{r} \sin(l/r) & 0 & 0 & 0 & 0\\
133 r \sin(l/r) & \cos(l/r) & 0 & 0 & 0 & 0\\
134 0 & 0 & 1 & 0 & 0 & 0\\
135 0 & 0 & l & 1 & 0 & 0\\
136 0 & 0 & 0 & 0 & 1 & 0\\
137 0 & 0 & 0 & 0 & 0 & 1\\
138 \end{array}
139 \right)
140 \f$
141
142 \f$
143 \mathbf{M_{bending-on}} =
144 \left(
145 \begin{array}{cccccc}
146 \cos(l/r) & \frac{-1}{r} \sin(l/r) & 0 & 0 & 0 & 0\\
147 r \sin(l/r) & \cos(l/r) & 0 & 0 & 0 & 0\\
148 0 & 0 & 1 & 0 & 0 &0\\
149 0 & 0 & l & 1 & 0 &0\\
150 2r \sin^2(l/2r)/BE & \sin(l/r)/BE & 0 & 0 & 1 & 0\\
151 0 & 0 & 0 & 0 & 0 & 1\\
152 \end{array}
153 \right)
154 \f$
155
156 assuming \f$ 1/r = k = k_{0} \times \frac{p_{0}}{p_{0} - dp} \times \frac{q_{particle}}{q_{proton}} \f$
157
158*/
159extern TMatrix sdipmat(const float, const float , const float , const float , const float );
160
161/// \brief Returns the matrix for a drift (H_Drift)
162
163/*! \f$
164 \mathbf{M} =
165 \left(
166 \begin{array}{cccccc}
167 1 & 0 & 0 & 0 & 0 & 0\\
168 l & 1 & 0 & 0 & 0 & 0\\
169 0 & 0 & 1 & 0 & 0 & 0\\
170 0 & 0 & l & 1 & 0 & 0\\
171 0 & 0 & 0 & 0 & 1 & 0\\
172 0 & 0 & 0 & 0 & 0 & 1\\
173 \end{array}
174 \right)
175 \f$
176*/
177extern TMatrix driftmat(const float );
178
179/// \brief Returns the matrix for a horizontal kicker (H_HorizontalKicker)
180/*! \f$
181 \mathbf{M} =
182 \left(
183 \begin{array}{cccccc}
184 1 & 0 & 0 & 0 & 0 & 0\\
185 l & 1 & 0 & 0 & 0 & 0 \\
186 0 & 0 & 1 & 0 & 0 & 0\\
187 0 & 0 & l & 1 & 0 & 0\\
188 0 & 0 & 0 & 0 & 1 & 0\\
189 l \tan(k) /2 & k & 0 & 0 & 0 & 1\\
190 \end{array}
191 \right)
192 \f$
193
194 assuming \f$ k = k_{0} \times \frac{p_{0}}{p_{0} - dp} \times \frac{q_{particle}}{q_{proton}} \f$
195*/
196extern TMatrix hkickmat(const float, const float , const float , const float, const float);
197
198/// \brief Returns the matrix for a vertical kicker (H_VerticalKicker)
199/*! \f$
200 \mathbf{M} =
201 \left(
202 \begin{array}{cccccc}
203 1 & 0 & 0 & 0 & 0 & 0\\
204 l & 1 & 0 & 0 & 0 & 0 \\
205 0 & 0 & 1 & 0 & 0 & 0\\
206 0 & 0 & l & 1 & 0 & 0\\
207 0 & 0 & 0 & 0 & 1 & 0\\
208 0 & 0 & l \tan(k) /2 & k & 0 & 1\\
209 \end{array}
210 \right)
211 \f$
212
213 assuming \f$ k = k_{0} \times \frac{p_{0}}{p_{0} - dp} \times \frac{q_{particle}}{q_{proton}} \f$
214*/
215extern TMatrix vkickmat(const float, const float , const float , const float , const float);
216
217
218
219#endif
Note: See TracBrowser for help on using the repository browser.