Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
d879561a
Commit
d879561a
authored
May 04, 2016
by
Alex Buts
Browse files
Re #16049 Clang Format
parent
1f27ed92
Changes
3
Hide whitespace changes
Inline
Side-by-side
Framework/Algorithms/inc/MantidAlgorithms/GetEi.h
View file @
d879561a
...
...
@@ -90,8 +90,8 @@ private:
specnum_t
specNum1
,
specnum_t
specNum2
)
const
;
double
timeToFly
(
double
s
,
double
E_KE
)
const
;
double
getPeakCentre
(
API
::
MatrixWorkspace_const_sptr
WS
,
const
size_t
monitIn
,
const
double
peakTime
);
double
getPeakCentre
(
API
::
MatrixWorkspace_const_sptr
WS
,
const
size_t
monitIn
,
const
double
peakTime
);
void
extractSpec
(
int
wsInd
,
double
start
,
double
end
);
void
getPeakEstimates
(
double
&
height
,
int64_t
&
centreInd
,
double
&
background
)
const
;
...
...
Framework/Algorithms/src/GetEi.cpp
View file @
d879561a
...
...
@@ -144,7 +144,6 @@ void GetEi::exec() {
Property
*
incident_energy
=
new
PropertyWithValue
<
double
>
(
"Ei"
,
E_i
,
Direction
::
Input
);
inWS
->
mutableRun
().
addProperty
(
incident_energy
,
true
);
}
/** Gets the distances between the source and detectors whose IDs you pass to it
* @param WS :: the input workspace
...
...
@@ -285,16 +284,16 @@ double GetEi::getPeakCentre(API::MatrixWorkspace_const_sptr WS,
// peaks in the monitor histogram
double
halfWin
=
(
timesArray
.
back
()
-
timesArray
.
front
())
*
HALF_WINDOW
;
if
(
monitIn
<
std
::
numeric_limits
<
int
>::
max
())
{
int
ivsInd
=
static_cast
<
int
>
(
monitIn
);
int
ivsInd
=
static_cast
<
int
>
(
monitIn
);
// runs CropWorkspace as a Child Algorithm to and puts the result in a new
// runs CropWorkspace as a Child Algorithm to and puts the result in a new
// temporary workspace that will be deleted when this algorithm has finished
extractSpec
(
ivsInd
,
peakTime
-
halfWin
,
peakTime
+
halfWin
);
}
else
{
throw
Kernel
::
Exception
::
NotImplementedError
(
"Spectra number exceeds maximal"
" integer number defined for this OS."
" This behaviour is not yet supported"
);
extractSpec
(
ivsInd
,
peakTime
-
halfWin
,
peakTime
+
halfWin
);
}
else
{
throw
Kernel
::
Exception
::
NotImplementedError
(
"Spectra number exceeds maximal"
" integer number defined for this OS."
" This behaviour is not yet supported"
);
}
// converting the workspace to count rate is required by the fitting algorithm
// if the bin widths are not all the same
...
...
Framework/Algorithms/test/GetEiV1Test.h
View file @
d879561a
...
...
@@ -58,7 +58,6 @@ public:
dynamic_cast
<
PropertyWithValue
<
double
>
*>
(
ei_runprop
);
TS_ASSERT_DELTA
((
*
ei_propvalue
)(),
expected_ei
,
1e-08
);
AnalysisDataService
::
Instance
().
remove
(
outputName
);
}
...
...
@@ -107,9 +106,9 @@ public:
alg
->
setProperty
(
"Monitor2Spec"
,
2
);
alg
->
setProperty
(
"EnergyEstimate"
,
15.0
);
alg
->
setRethrows
(
true
);
TS_ASSERT_THROWS_EQUALS
(
alg
->
execute
(),
const
std
::
runtime_error
&
e
,
std
::
string
(
e
.
what
()),
"Some invalid Properties found"
);
TS_ASSERT_THROWS_EQUALS
(
alg
->
execute
(),
const
std
::
runtime_error
&
e
,
std
::
string
(
e
.
what
()),
"Some invalid Properties found"
);
AnalysisDataService
::
Instance
().
remove
(
outputName
);
}
void
testThrowsEi
()
{
...
...
@@ -151,7 +150,6 @@ public:
AnalysisDataService
::
Instance
().
remove
(
outputName
);
}
private:
MatrixWorkspace_sptr
createTestWorkspaceWithMonitors
(
const
bool
includePeaks
=
true
)
{
...
...
@@ -185,7 +183,6 @@ private:
exp
(
-
0.5
*
pow
(
xValue
-
peakTwoCentre
,
2.
)
/
sigmaSqTwo
);
}
xdata
.
access
()[
i
]
=
xValue
;
}
testWS
->
setX
(
0
,
xdata
);
testWS
->
setX
(
1
,
xdata
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment