Fork me on GitHub

source: git/external/Hector/H_TransportMatrices.h@ 0e0f211

ImprovedOutputFile Timing dual_readout llp
Last change on this file since 0e0f211 was 3c40083, checked in by pavel <pavel@…>, 11 years ago

switch to a more stable Hector version

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