@@ -48,38 +48,38 @@ using namespace NeXus;
48
48
49
49
namespace {
50
50
enum class CalibFilenameExtensionEnum { H5, HD5, HDF, CAL, enum_count };
51
- const std::vector<std::string> calibFilenameExtensions{" .h5" , " .hd5" , " .hdf" , " .cal" };
51
+ std::vector<std::string> const calibFilenameExtensions{" .h5" , " .hd5" , " .hdf" , " .cal" };
52
52
typedef EnumeratedString<CalibFilenameExtensionEnum, &calibFilenameExtensions, &compareStringsCaseInsensitive>
53
53
CalibFilenameExtension;
54
54
55
55
enum class GroupingFilenameExtensionEnum { XML, H5, HD5, HDF, CAL, enum_count };
56
- const std::vector<std::string> groupingFilenameExtensions{" .xml" , " .h5" , " .hd5" , " .hdf" , " .cal" };
56
+ std::vector<std::string> const groupingFilenameExtensions{" .xml" , " .h5" , " .hd5" , " .hdf" , " .cal" };
57
57
typedef EnumeratedString<GroupingFilenameExtensionEnum, &groupingFilenameExtensions, &compareStringsCaseInsensitive>
58
58
GroupingFilenameExtension;
59
59
60
60
namespace PropertyNames {
61
- const std::string CAL_FILE (" Filename" );
62
- const std::string GROUP_FILE (" GroupFilename" );
63
- const std::string MAKE_CAL (" MakeCalWorkspace" );
64
- const std::string MAKE_GRP (" MakeGroupingWorkspace" );
65
- const std::string MAKE_MSK (" MakeMaskWorkspace" );
61
+ std::string const CAL_FILE (" Filename" );
62
+ std::string const GROUP_FILE (" GroupFilename" );
63
+ std::string const MAKE_CAL (" MakeCalWorkspace" );
64
+ std::string const MAKE_GRP (" MakeGroupingWorkspace" );
65
+ std::string const MAKE_MSK (" MakeMaskWorkspace" );
66
66
} // namespace PropertyNames
67
67
} // namespace
68
68
69
69
// Register the algorithm into the AlgorithmFactory
70
70
DECLARE_ALGORITHM (LoadDiffCal)
71
71
72
72
// / Algorithms name for identification. @see Algorithm::name
73
- const std::string LoadDiffCal::name () const { return " LoadDiffCal" ; }
73
+ std::string const LoadDiffCal::name () const { return " LoadDiffCal" ; }
74
74
75
75
// / Algorithm's version for identification. @see Algorithm::version
76
76
int LoadDiffCal::version () const { return 1 ; }
77
77
78
78
// / Algorithm's category for identification. @see Algorithm::category
79
- const std::string LoadDiffCal::category () const { return " DataHandling\\ Instrument;Diffraction\\ DataHandling" ; }
79
+ std::string const LoadDiffCal::category () const { return " DataHandling\\ Instrument;Diffraction\\ DataHandling" ; }
80
80
81
81
// / Algorithm's summary for use in the GUI and help. @see Algorithm::summary
82
- const std::string LoadDiffCal::summary () const { return " Loads a calibration file for powder diffraction" ; }
82
+ std::string const LoadDiffCal::summary () const { return " Loads a calibration file for powder diffraction" ; }
83
83
84
84
/* * Initialize the algorithm's properties.
85
85
*/
@@ -123,21 +123,21 @@ void LoadDiffCal::init() {
123
123
124
124
namespace { // anonymous
125
125
126
- void setGroupWSProperty (API::Algorithm *alg, const std::string &prefix, const GroupingWorkspace_sptr &wksp) {
126
+ void setGroupWSProperty (API::Algorithm *alg, std::string const &prefix, GroupingWorkspace_sptr const &wksp) {
127
127
alg->declareProperty (std::make_unique<WorkspaceProperty<DataObjects::GroupingWorkspace>>(
128
128
" OutputGroupingWorkspace" , prefix + " _group" , Direction::Output),
129
129
" Set the output GroupingWorkspace, if any." );
130
130
alg->setProperty (" OutputGroupingWorkspace" , wksp);
131
131
}
132
132
133
- void setMaskWSProperty (API::Algorithm *alg, const std::string &prefix, const MaskWorkspace_sptr &wksp) {
133
+ void setMaskWSProperty (API::Algorithm *alg, std::string const &prefix, MaskWorkspace_sptr const &wksp) {
134
134
alg->declareProperty (std::make_unique<WorkspaceProperty<DataObjects::MaskWorkspace>>(
135
135
" OutputMaskWorkspace" , prefix + " _mask" , Direction::Output),
136
136
" Set the output MaskWorkspace, if any." );
137
137
alg->setProperty (" OutputMaskWorkspace" , wksp);
138
138
}
139
139
140
- void setCalWSProperty (API::Algorithm *alg, const std::string &prefix, const ITableWorkspace_sptr &wksp) {
140
+ void setCalWSProperty (API::Algorithm *alg, std::string const &prefix, ITableWorkspace_sptr const &wksp) {
141
141
alg->declareProperty (
142
142
std::make_unique<WorkspaceProperty<ITableWorkspace>>(" OutputCalWorkspace" , prefix + " _cal" , Direction::Output),
143
143
" Set the output Diffraction Calibration workspace, if any." );
@@ -182,7 +182,7 @@ void LoadDiffCal::getInstrument(H5File &file) {
182
182
<< m_instrument->getFilename () << " \"\n " ;
183
183
}
184
184
185
- void LoadDiffCal::makeGroupingWorkspace (const std::vector<int32_t > &detids, const std::vector<int32_t > &groups) {
185
+ void LoadDiffCal::makeGroupingWorkspace (std::vector<int32_t > const &detids, std::vector<int32_t > const &groups) {
186
186
bool makeWS = getProperty (PropertyNames::MAKE_GRP);
187
187
if (!makeWS) {
188
188
g_log.information (" Not loading GroupingWorkspace from the calibration file" );
@@ -211,7 +211,7 @@ void LoadDiffCal::makeGroupingWorkspace(const std::vector<int32_t> &detids, cons
211
211
setGroupWSProperty (this , m_workspaceName, wksp);
212
212
}
213
213
214
- void LoadDiffCal::makeMaskWorkspace (const std::vector<int32_t > &detids, const std::vector<int32_t > &use) {
214
+ void LoadDiffCal::makeMaskWorkspace (std::vector<int32_t > const &detids, std::vector<int32_t > const &use) {
215
215
bool makeWS = getProperty (PropertyNames::MAKE_MSK);
216
216
if (!makeWS) {
217
217
g_log.information (" Not making a MaskWorkspace" );
@@ -238,10 +238,10 @@ void LoadDiffCal::makeMaskWorkspace(const std::vector<int32_t> &detids, const st
238
238
setMaskWSProperty (this , m_workspaceName, wksp);
239
239
}
240
240
241
- void LoadDiffCal::makeCalWorkspace (const std::vector<int32_t > &detids, const std::vector<double > &difc,
242
- const std::vector<double > &difa, const std::vector<double > &tzero,
243
- const std::vector<int32_t > &dasids, const std::vector<double > &offsets,
244
- const std::vector<int32_t > &use) {
241
+ void LoadDiffCal::makeCalWorkspace (std::vector<int32_t > const &detids, std::vector<double > const &difc,
242
+ std::vector<double > const &difa, std::vector<double > const &tzero,
243
+ std::vector<int32_t > const &dasids, std::vector<double > const &offsets,
244
+ std::vector<int32_t > const &use) {
245
245
bool makeWS = getProperty (PropertyNames::MAKE_CAL);
246
246
if (!makeWS) {
247
247
g_log.information (" Not making a calibration workspace" );
@@ -290,14 +290,14 @@ void LoadDiffCal::makeCalWorkspace(const std::vector<int32_t> &detids, const std
290
290
291
291
// calculate tof range for information
292
292
Kernel::Units::dSpacing dspacingUnit;
293
- const double tofMinRow = dspacingUnit.calcTofMin (difc[i], difa[i], tzero[i], tofMin);
293
+ double const tofMinRow = dspacingUnit.calcTofMin (difc[i], difa[i], tzero[i], tofMin);
294
294
std::stringstream msg;
295
295
if (tofMinRow != tofMin) {
296
296
msg << " TofMin shifted from " << tofMin << " to " << tofMinRow << " " ;
297
297
}
298
298
newrow << tofMinRow;
299
299
if (useTofMax) {
300
- const double tofMaxRow = dspacingUnit.calcTofMax (difc[i], difa[i], tzero[i], tofMax);
300
+ double const tofMaxRow = dspacingUnit.calcTofMax (difc[i], difa[i], tzero[i], tofMax);
301
301
newrow << tofMaxRow;
302
302
303
303
if (tofMaxRow != tofMax) {
0 commit comments