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
be9c5bee
Commit
be9c5bee
authored
5 years ago
by
Andre Sailer
Browse files
Options
Downloads
Patches
Plain Diff
dumpBField: fix treatment of units
parent
542b1f2e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
UtilityApps/src/dumpBfield.cpp
+11
-11
11 additions, 11 deletions
UtilityApps/src/dumpBfield.cpp
with
11 additions
and
11 deletions
UtilityApps/src/dumpBfield.cpp
+
11
−
11
View file @
be9c5bee
...
...
@@ -42,20 +42,20 @@ static int invoke_dump_B_field(int argc, char** argv ){
sstr
<<
argv
[
2
]
<<
" "
<<
argv
[
3
]
<<
" "
<<
argv
[
4
]
<<
" "
<<
argv
[
5
]
<<
" "
<<
argv
[
6
]
<<
" "
<<
argv
[
7
]
;
float
xRange
,
yRange
,
zRange
,
dx
,
dy
,
dz
;
sstr
>>
xRange
;
sstr
>>
yRange
;
sstr
>>
zRange
;
sstr
>>
dx
;
sstr
>>
dy
;
sstr
>>
dz
;
sstr
>>
xRange
>>
yRange
>>
zRange
>>
dx
>>
dy
>>
dz
;
xRange
*=
dd4hep
::
cm
;
yRange
*=
dd4hep
::
cm
;
zRange
*=
dd4hep
::
cm
;
dx
*=
dd4hep
::
cm
;
dy
*=
dd4hep
::
cm
;
dz
*=
dd4hep
::
cm
;
Detector
&
description
=
Detector
::
getInstance
();
description
.
fromCompact
(
inFile
);
printf
(
"#######################################################################################################
\n
"
);
printf
(
"
x[cm]
y[cm] z[cm]
Bx[Tesla] By[
cm
]
Bz[
cm]
\n
"
);
printf
(
" x[cm] y[cm]
z[cm] Bx[Tesla] By[
Tesla
] Bz[
Tesla]
\n
"
);
for
(
float
x
=
-
xRange
;
x
<=
xRange
;
x
+=
dx
){
for
(
float
y
=
-
yRange
;
y
<=
yRange
;
y
+=
dy
){
...
...
@@ -66,7 +66,7 @@ static int invoke_dump_B_field(int argc, char** argv ){
description
.
field
().
magneticField
(
posV
,
bfieldV
)
;
printf
(
" %+15.8e %+15.8e %+15.8e %+15.8e %+15.8e %+15.8e
\n
"
,
posV
[
0
]
,
posV
[
1
],
posV
[
2
]
,
posV
[
0
]
/
dd4hep
::
cm
,
posV
[
1
]
/
dd4hep
::
cm
,
posV
[
2
]
/
dd4hep
::
cm
,
bfieldV
[
0
]
/
dd4hep
::
tesla
,
bfieldV
[
1
]
/
dd4hep
::
tesla
,
bfieldV
[
2
]
/
dd4hep
::
tesla
)
;
}
...
...
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