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
03755aad
Commit
03755aad
authored
May 18, 2020
by
Stephen
Browse files
Fix LLVM warnings
parent
b15287c2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Framework/DataHandling/inc/MantidDataHandling/LoadMuonNexusV2.h
View file @
03755aad
...
...
@@ -73,8 +73,6 @@ private:
std
::
string
m_filename
;
/// The number of the input entry
int64_t
m_entrynumber
;
/// The number of periods in the raw file
int
m_numberOfPeriods
;
// Is file multi period
bool
m_isFileMultiPeriod
;
// Are multi periods loaded
...
...
Framework/DataHandling/src/LoadMuonNexusV2.cpp
View file @
03755aad
...
...
@@ -33,8 +33,8 @@ using namespace DataObjects;
/// Empty default constructor
LoadMuonNexusV2
::
LoadMuonNexusV2
()
:
m_filename
(),
m_
isFileMultiPeriod
(
false
),
m_m
ultiPeriod
sLoaded
(
false
),
m_
entrynumber
(
0
),
m_numberOfPeriods
(
0
)
{}
:
m_filename
(),
m_
entrynumber
(
0
),
m_isFileM
ultiPeriod
(
false
),
m_
multiPeriodsLoaded
(
false
)
{}
/**
* Return the confidence criteria for this algorithm can load the file
...
...
Framework/DataHandling/src/SinglePeriodLoadMuonStrategy.cpp
View file @
03755aad
...
...
@@ -29,8 +29,8 @@ SinglePeriodLoadMuonStrategy::SinglePeriodLoadMuonStrategy(
Kernel
::
Logger
&
g_log
,
const
std
::
string
&
filename
,
NXEntry
&
entry
,
Workspace2D_sptr
workspace
,
int
entryNumber
,
bool
isFileMultiPeriod
)
:
LoadMuonStrategy
(
g_log
,
filename
),
m_entry
(
entry
),
m_workspace
(
workspace
),
m_
detectors
(
getLoadedDetectors
()),
m_entryNumber
(
entryNumber
),
m_
isFileMultiPeriod
(
isFileMultiPeriod
)
{}
m_
entryNumber
(
entryNumber
),
m_isFileMultiPeriod
(
isFileMultiPeriod
),
m_
detectors
(
getLoadedDetectors
()
)
{}
/**
* Loads Muon specific logs into the stored workspace
...
...
@@ -159,7 +159,7 @@ void SinglePeriodLoadMuonStrategy::applyTimeZeroCorrection() {
m_workspace
->
getAxis
(
0
)
->
unit
()
=
newUnit
;
auto
numHistograms
=
m_workspace
->
getNumberHistograms
();
for
(
auto
i
=
0
;
i
<
numHistograms
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
numHistograms
;
++
i
)
{
auto
&
timeAxis
=
m_workspace
->
mutableX
(
i
);
timeAxis
=
timeAxis
-
timeZero
;
}
...
...
Framework/DataHandling/test/LoadMuonNexusV2Test.h
View file @
03755aad
...
...
@@ -7,13 +7,16 @@
#pragma once
#include
"MantidAPI/AnalysisDataService.h"
#include
<cxxtest/TestSuite.h>
#include
"MantidAPI/Axis.h"
#include
"MantidAPI/MatrixWorkspace.h"
#include
"MantidAPI/Run.h"
#include
"MantidAPI/WorkspaceGroup.h"
#include
"MantidDataHandling/LoadMuonNexusV2.h"
#include
"MantidDataObjects/Workspace2D.h"
#include
"MantidKernel/UnitFactory.h"
#include
"MantidKernel/UnitLabelTypes.h"
#include
<cxxtest/TestSuite.h>
#include
<cmath>
...
...
@@ -42,18 +45,30 @@ public:
output_ws
=
AnalysisDataService
::
Instance
().
retrieveWS
<
MatrixWorkspace
>
(
"outWS"
));
Workspace2D_sptr
output2D_1
=
Workspace2D_sptr
output2D
=
std
::
dynamic_pointer_cast
<
Workspace2D
>
(
output_ws
);
const
Mantid
::
API
::
Run
&
run
1
=
output2D
_1
->
run
();
int
goodfrm
=
run
1
.
getPropertyAsIntegerValue
(
"goodfrm"
);
const
Mantid
::
API
::
Run
&
run
=
output2D
->
run
();
int
goodfrm
=
run
.
getPropertyAsIntegerValue
(
"goodfrm"
);
TS_ASSERT_EQUALS
(
goodfrm
,
36197
);
double
firstGoodData
=
ld
.
getProperty
(
"FirstGoodData"
);
TS_ASSERT_EQUALS
(
firstGoodData
,
0.384
);
double
timeZero
=
ld
.
getProperty
(
"TimeZero"
);
TS_ASSERT_DELTA
(
timeZero
,
0.1599999
,
1e-5
);
// check time zero applied to time axis
// Check the unit has been set correctly
TS_ASSERT_EQUALS
(
output2D
->
getAxis
(
0
)
->
unit
()
->
unitID
(),
"Label"
);
TS_ASSERT
(
!
output2D
->
isDistribution
());
// Check that sample temp and field set
double
temperature
=
run
.
getPropertyAsSingleValue
(
"sample_temp"
);
TS_ASSERT_EQUALS
(
100.0
,
temperature
);
double
field
=
run
.
getPropertyAsSingleValue
(
"sample_magn_field"
);
TS_ASSERT_EQUALS
(
0.0
,
field
);
}
void
testExecWithGroupingTable
()
{}
};
//------------------------------------------------------------------------------
...
...
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