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
13eb7141
Commit
13eb7141
authored
Jan 30, 2014
by
Ricardo Leal
Browse files
Re #7452 Added property monitor with average monitor counts.
parent
ed15dc3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Code/Mantid/Framework/DataHandling/src/LoadILLSANS.cpp
View file @
13eb7141
...
...
@@ -277,6 +277,14 @@ size_t LoadILLSANS::loadDataIntoWorkspaceFromMonitors(NeXus::NXEntry &firstEntry
MantidVec
&
E
=
m_localWorkspace
->
dataE
(
firstIndex
);
std
::
transform
(
data
(),
data
()
+
data
.
dim2
(),
E
.
begin
(),
LoadHelper
::
calculateStandardError
);
// Add average monitor counts to a property:
double
averageMonitorCounts
=
std
::
accumulate
(
data
(),
data
()
+
data
.
dim2
(),
0
)
/
data
.
dim2
();
// make sure the monitor has values!
if
(
averageMonitorCounts
>
0
)
{
API
::
Run
&
runDetails
=
m_localWorkspace
->
mutableRun
();
runDetails
.
addProperty
(
"monitor"
,
averageMonitorCounts
,
true
);
}
firstIndex
++
;
}
}
...
...
Code/Mantid/Framework/DataHandling/test/LoadILLSANSTest.h
View file @
13eb7141
...
...
@@ -59,6 +59,7 @@ public:
TS_ASSERT_EQUALS
(
output2D
->
getNumberHistograms
(),
65536
+
2
);
TS_ASSERT_EQUALS
(
output2D
->
blocksize
(),
100
);
TS_ASSERT_DIFFERS
(
output2D
->
run
().
getPropertyValueAsType
<
double
>
(
"monitor"
),
0.0
);
AnalysisDataService
::
Instance
().
clear
();
}
...
...
@@ -81,6 +82,7 @@ public:
TS_ASSERT_EQUALS
(
output2D
->
getNumberHistograms
(),
65536
+
2
);
TS_ASSERT_EQUALS
(
output2D
->
blocksize
(),
1
);
TS_ASSERT_DIFFERS
(
output2D
->
run
().
getPropertyValueAsType
<
double
>
(
"monitor"
),
0.0
);
AnalysisDataService
::
Instance
().
clear
();
}
...
...
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