Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DD4hep
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cepc
externals
mirroring
DD4hep
Commits
91a695f1
Commit
91a695f1
authored
7 years ago
by
Daniel Jeans
Committed by
Marko Petric
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
FieldTypes: add factorial function to definition of multipole coefficients/skews
parent
5dc1d296
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
DDCore/include/DD4hep/FieldTypes.h
+8
-8
8 additions, 8 deletions
DDCore/include/DD4hep/FieldTypes.h
DDCore/src/FieldTypes.cpp
+4
-4
4 additions, 4 deletions
DDCore/src/FieldTypes.cpp
with
12 additions
and
12 deletions
DDCore/include/DD4hep/FieldTypes.h
+
8
−
8
View file @
91a695f1
...
@@ -95,8 +95,8 @@ namespace dd4hep {
...
@@ -95,8 +95,8 @@ namespace dd4hep {
* The different momenta are given by:
* The different momenta are given by:
*
*
* \f{eqnarray*}{
* \f{eqnarray*}{
* B_y + i*B_x &=& C_n * (x + iy)^{n-1} \\
* B_y + i*B_x &=&
( 1/(n-1)! )*
C_n * (x + iy)^{n-1} \\
* B_sum = B_y + i B_x &=& Sum_{n=1..4} (b_n + ia_n) (x + iy)^{n-1} \\
* B_sum = B_y + i B_x &=& Sum_{n=1..4} (
1/(n-1)! )*(
b_n + ia_n) (x + iy)^{n-1} \\
* \f}
* \f}
* With C_n being the complex multipole coefficients and
* With C_n being the complex multipole coefficients and
* b_n the "normal multipole coefficients" and a_n the "skew multipole coefficients".
* b_n the "normal multipole coefficients" and a_n the "skew multipole coefficients".
...
@@ -122,17 +122,17 @@ namespace dd4hep {
...
@@ -122,17 +122,17 @@ namespace dd4hep {
* \li Sextupole (n=3):
* \li Sextupole (n=3):
*
*
* \f{eqnarray*}{
* \f{eqnarray*}{
* B_y + i B_x &=& (b_3 +ia_3) (x^2 + 2ixy - y^2) \\
* B_y + i B_x &=&
(1/2) *
(b_3 +ia_3) (x^2 + 2ixy - y^2) \\
* B_y &=& b_3 x^2 - b_3 y^2 - 2 a_3 xy \\
* B_y &=&
(1/2) * (
b_3 x^2 - b_3 y^2 - 2 a_3 xy
)
\\
* B_x &=& a_3 x^2 - a_3 y^2 + 2 b_3 xy \\
* B_x &=&
(1/2) * (
a_3 x^2 - a_3 y^2 + 2 b_3 xy
)
\\
* \f}
* \f}
*
*
* \li Octopole (n=4):
* \li Octopole (n=4):
*
*
* \f{eqnarray*}{
* \f{eqnarray*}{
* B_y + i B_x &=& (b_4 +ia_4) (x^3 + 3ix^2y - 3xy^2 -iy^3) \\
* B_y + i B_x &=&
(1/6) *
(b_4 +ia_4) (x^3 + 3ix^2y - 3xy^2 -iy^3) \\
* B_y &=& b_4 x^3 - 3 b_4 x y^2 - 3 a_4 x^2 y + a_4 y^3 \\
* B_y &=&
(1/6) * (
b_4 x^3 - 3 b_4 x y^2 - 3 a_4 x^2 y + a_4 y^3
)
\\
* B_x &=& 3 b_4 x^2 y - b_4 y^3 + a_4 x^3 - 3 a_4 x y^2 \\
* B_x &=&
(1/6) * (
3 b_4 x^2 y - b_4 y^3 + a_4 x^3 - 3 a_4 x y^2
)
\
\
* \f}
* \f}
*
*
* The defined field components only apply within the shape 'volume'.
* The defined field components only apply within the shape 'volume'.
...
...
This diff is collapsed.
Click to expand it.
DDCore/src/FieldTypes.cpp
+
4
−
4
View file @
91a695f1
...
@@ -99,12 +99,12 @@ void MultipoleField::fieldComponents(const double* pos, double* field) {
...
@@ -99,12 +99,12 @@ void MultipoleField::fieldComponents(const double* pos, double* field) {
double
y2
=
y
*
y
;
double
y2
=
y
*
y
;
switch
(
coefficents
.
size
())
{
switch
(
coefficents
.
size
())
{
case
4
:
// Ocupole momentum
case
4
:
// Ocupole momentum
by
+=
coefficents
[
3
]
*
(
x2
*
x
-
3.0
*
x
*
y2
)
+
skews
[
3
]
*
(
y2
*
y
-
3.0
*
x2
*
y
);
by
+=
(
1.
/
6.
)
*
(
coefficents
[
3
]
*
(
x2
*
x
-
3.0
*
x
*
y2
)
+
skews
[
3
]
*
(
y2
*
y
-
3.0
*
x2
*
y
)
)
;
bx
+=
coefficents
[
3
]
*
(
3.0
*
x2
*
y
-
y2
*
y
)
+
skews
[
3
]
*
(
x2
*
x
-
3.0
*
x
*
y2
);
bx
+=
(
1.
/
6.
)
*
(
coefficents
[
3
]
*
(
3.0
*
x2
*
y
-
y2
*
y
)
+
skews
[
3
]
*
(
x2
*
x
-
3.0
*
x
*
y2
)
)
;
[[
fallthrough
]];
[[
fallthrough
]];
case
3
:
// Sextupole momentum:
case
3
:
// Sextupole momentum:
by
+=
coefficents
[
2
]
*
(
x2
-
y2
)
-
skews
[
2
]
*
2.0
*
xy
;
by
+=
(
1.
/
2.
)
*
(
coefficents
[
2
]
*
(
x2
-
y2
)
-
skews
[
2
]
*
2.0
*
xy
)
;
bx
+=
coefficents
[
2
]
*
2.0
*
xy
+
skews
[
2
]
*
(
x2
-
y2
);
bx
+=
(
1.
/
2.
)
*
(
coefficents
[
2
]
*
2.0
*
xy
+
skews
[
2
]
*
(
x2
-
y2
)
)
;
[[
fallthrough
]];
[[
fallthrough
]];
case
2
:
// Quadrupole momentum:
case
2
:
// Quadrupole momentum:
bx
+=
coefficents
[
1
]
*
y
+
skews
[
1
]
*
x
;
bx
+=
coefficents
[
1
]
*
y
+
skews
[
1
]
*
x
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment