Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
cb698dfa
Commit
cb698dfa
authored
10 years ago
by
Harry Jeffery
Browse files
Options
Downloads
Patches
Plain Diff
Fix crash in CalculateResolution.
Refs #10173.
parent
3f5af090
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
Code/Mantid/Framework/Algorithms/src/CalculateResolution.cpp
+11
-2
11 additions, 2 deletions
Code/Mantid/Framework/Algorithms/src/CalculateResolution.cpp
with
11 additions
and
2 deletions
Code/Mantid/Framework/Algorithms/src/CalculateResolution.cpp
+
11
−
2
View file @
cb698dfa
...
...
@@ -103,8 +103,17 @@ namespace Mantid
const
V3D
slitDiff
=
(
slit2
->
getPos
()
-
slit1
->
getPos
())
*
1000
;
//Convert from mm to m.
const
double
slit1VG
=
slit1
->
getNumberParameter
(
vGapParam
).
front
();
const
double
slit2VG
=
slit2
->
getNumberParameter
(
vGapParam
).
front
();
std
::
vector
<
double
>
slit1VGParam
=
slit1
->
getNumberParameter
(
vGapParam
);
std
::
vector
<
double
>
slit2VGParam
=
slit2
->
getNumberParameter
(
vGapParam
);
if
(
slit1VGParam
.
size
()
<
1
)
throw
std
::
runtime_error
(
"Could not find a value for the first slit's vertical gap with given parameter name: '"
+
vGapParam
+
"'."
);
if
(
slit2VGParam
.
size
()
<
1
)
throw
std
::
runtime_error
(
"Could not find a value for the second slit's vertical gap with given parameter name: '"
+
vGapParam
+
"'."
);
const
double
slit1VG
=
slit1VGParam
[
0
];
const
double
slit2VG
=
slit2VGParam
[
0
];
const
double
totalVertGap
=
slit1VG
+
slit2VG
;
const
double
slitDist
=
sqrt
(
slitDiff
.
X
()
*
slitDiff
.
X
()
+
slitDiff
.
Y
()
*
slitDiff
.
Y
()
+
slitDiff
.
Z
()
*
slitDiff
.
Z
());
...
...
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