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
6156c52c
Commit
6156c52c
authored
May 26, 2020
by
Stephen
Browse files
Make LoadMuonNexus algorithms use specnum_t for spectrum based integers
parent
a7ff8f7f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexus.h
View file @
6156c52c
...
...
@@ -85,12 +85,10 @@ protected:
std
::
string
m_instrument_name
;
/// The sample name read from Nexus
std
::
string
m_samplename
;
/// The number of the input entry
int64_t
m_entrynumber
;
/// The number of spectra in the raw file
int64
_t
m_numberOfSpectra
;
specnum
_t
m_numberOfSpectra
;
/// The number of periods in the raw file
int64_t
m_numberOfPeriods
;
/// Has the spectrum_list property been set?
...
...
@@ -100,11 +98,11 @@ protected:
/// The value of the spectrum_list property
std
::
vector
<
specnum_t
>
m_spec_list
;
/// The value of the spectrum_min property
int64
_t
m_spec_min
;
specnum
_t
m_spec_min
;
/// The value of the spectrum_max property
int64
_t
m_spec_max
;
specnum
_t
m_spec_max
;
/// The group which each detector belongs to in order
std
::
vector
<
specnum
_t
>
m_groupings
;
std
::
vector
<
detid
_t
>
m_groupings
;
private:
/// Overwrites Algorithm method.
...
...
Framework/DataHandling/src/LoadMuonNexus.cpp
View file @
6156c52c
...
...
@@ -60,13 +60,11 @@ void LoadMuonNexus::init() {
"algorithm. For multiperiod files, one workspace will be
\n
"
"generated for each period"
);
auto
mustBePositive
=
std
::
make_shared
<
BoundedValidator
<
int64_t
>>
();
mustBePositive
->
setLower
(
1
);
declareProperty
(
"SpectrumMin"
,
static_cast
<
int64_t
>
(
EMPTY_INT
()),
mustBePositive
,
"Index number of the first spectrum to read
\n
"
"(default 1)"
);
declareProperty
(
"SpectrumMax"
,
static_cast
<
int64_t
>
(
EMPTY_INT
()),
auto
mustBePositive
=
std
::
make_shared
<
BoundedValidator
<
specnum_t
>>
();
mustBePositive
->
setLower
(
0
);
declareProperty
(
"SpectrumMin"
,
static_cast
<
specnum_t
>
(
0
),
mustBePositive
,
"Index number of the first spectrum to read
\n
"
);
declareProperty
(
"SpectrumMax"
,
static_cast
<
specnum_t
>
(
EMPTY_INT
()),
mustBePositive
,
"Index of last spectrum to read
\n
"
"(default the last spectrum)"
);
...
...
Framework/DataHandling/src/LoadMuonNexus1.cpp
View file @
6156c52c
...
...
@@ -151,7 +151,7 @@ void LoadMuonNexus1::exec() {
checkOptionalProperties
();
// Calculate the size of a workspace, given its number of periods & spectra to
// read
int64
_t
total_specs
;
size
_t
total_specs
;
if
(
m_interval
||
m_list
)
{
// Remove from list possible duplicate specs
for
(
auto
it
=
m_spec_list
.
begin
();
it
!=
m_spec_list
.
end
();)
{
...
...
@@ -239,10 +239,10 @@ void LoadMuonNexus1::exec() {
addGoodFrames
(
localWorkspace
,
period
,
nxload
.
t_nper
);
size_t
counter
=
0
;
for
(
int64_t
i
=
m_spec_min
;
i
<
m_spec_max
;
++
i
)
{
for
(
auto
i
=
m_spec_min
;
i
<
m_spec_max
;
++
i
)
{
// Shift the histogram to read if we're not in the first period
auto
histToRead
=
static_cast
<
specnum_t
>
(
i
-
1
+
period
*
nxload
.
t_nsp1
);
auto
specNo
=
static_cast
<
specnum_t
>
(
i
)
;
auto
specNo
=
i
;
loadData
(
counter
,
histToRead
,
specNo
,
nxload
,
lengthIn
-
1
,
localWorkspace
);
// added -1 for NeXus
counter
++
;
...
...
@@ -358,8 +358,8 @@ void LoadMuonNexus1::loadDeadTimes(NXRoot &root) {
// Load only selected spectra
specToLoad
.
insert
(
specToLoad
.
end
(),
boost
::
counting_iterator
<
int
>
(
static_cast
<
in
t
>
(
m_spec_min
)
)
,
boost
::
counting_iterator
<
int
>
(
static_cast
<
in
t
>
(
m_spec_max
))
)
;
boost
::
counting_iterator
<
specnum_
t
>
(
m_spec_min
),
boost
::
counting_iterator
<
specnum_
t
>
(
m_spec_max
));
specToLoad
.
insert
(
specToLoad
.
end
(),
m_spec_list
.
begin
(),
m_spec_list
.
end
());
}
else
{
...
...
@@ -466,8 +466,8 @@ Workspace_sptr LoadMuonNexus1::loadDetectorGrouping(
// Load only selected spectra
specToLoad
.
insert
(
specToLoad
.
end
(),
boost
::
counting_iterator
<
int
>
(
static_cast
<
in
t
>
(
m_spec_min
)
)
,
boost
::
counting_iterator
<
int
>
(
static_cast
<
in
t
>
(
m_spec_max
))
)
;
boost
::
counting_iterator
<
specnum_
t
>
(
m_spec_min
),
boost
::
counting_iterator
<
specnum_
t
>
(
m_spec_max
));
specToLoad
.
insert
(
specToLoad
.
end
(),
m_spec_list
.
begin
(),
m_spec_list
.
end
());
}
else
{
...
...
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