Commit 8ea4e5ac authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Update with Simon's comments and suggestions.

parent 081b03a6
......@@ -54,6 +54,16 @@ const std::string PDDetermineCharacterizations::summary() const {
/**
* These should match those in LoadPDCharacterizations
* - "frequency" double
* - "wavelength" (double)
* - "bank" (integer)
* - "container" (string)
* - "vanadium" (string)
* - "empty" (string)
* - "d_min" (string)
* - "d_max" (string)
* - "tof_min" (double)
* - "tof_max" (double)
* @return The list of expected column names
*/
std::vector<std::string> getColumnNames() {
......
......@@ -91,7 +91,6 @@ void ProcessBackground::init() {
// Optional Function Type
std::vector<std::string> bkgdtype{"Polynomial", "Chebyshev"};
// bkgdtype.emplace_back("FullprofPolynomial");
auto bkgdvalidator =
boost::make_shared<Kernel::StringListValidator>(bkgdtype);
declareProperty(
......
......@@ -214,8 +214,6 @@ public:
lebailfunction.function(out, vecX, true, false);
TS_ASSERT_THROWS_ANYTHING(lebailfunction.function(out, vecX, true, true));
// map<string, double> bkgdparmap {{"A0", 0.001},{"A1", 0.}};
vector<string> vecbkgdparnames(2);
vecbkgdparnames[0] = "A0";
vecbkgdparnames[1] = "A1";
......
......@@ -510,19 +510,16 @@ void GroupDetectors2::processXMLFile(std::string fname,
loader.getGroupSpectraMap();
// 3. Build m_GroupSpecInds
for (auto dit = mGroupDetectorsMap.begin(); dit != mGroupDetectorsMap.end();
++dit) {
m_GroupSpecInds.emplace(dit->first, std::vector<size_t>());
for (const auto &det : mGroupDetectorsMap) {
m_GroupSpecInds.emplace(det.first, std::vector<size_t>());
}
// 4. Detector IDs
for (auto dit = mGroupDetectorsMap.begin(); dit != mGroupDetectorsMap.end();
++dit) {
int groupid = dit->first;
std::vector<detid_t> detids = dit->second;
for (const auto &det : mGroupDetectorsMap) {
int groupid = det.first;
const std::vector<detid_t> &detids = det.second;
storage_map::iterator sit;
sit = m_GroupSpecInds.find(groupid);
auto sit = m_GroupSpecInds.find(groupid);
if (sit == m_GroupSpecInds.end())
continue;
......
......@@ -621,9 +621,9 @@ public:
V3D source(0, 0, 0);
V3D sample(10, 0, 0);
std::vector<V3D> detectorPositions{{11, 1, 0}, {11, 1, 0}};
// First detector pos
// Second detector sits on the first.
std::vector<V3D> detectorPositions{{11, 1, 0}, {11, 1, 0}};
WorkspaceCreationHelper::createInstrumentForWorkspaceWithDistances(
ws, source, sample, detectorPositions);
......
......@@ -142,11 +142,6 @@ public:
tw.setRowCount(2);
TS_ASSERT_EQUALS(tw.rowCount(), 2);
TS_ASSERT_EQUALS(cNumb[1], 2);
// str[0] = "First"; str[1] = "Second";
// vector<string> names;
// names.emplace_back("Number");
// names.emplace_back("Name");
}
void testRow() {
......
......@@ -158,8 +158,8 @@ public:
Test the distance of a point from the cylinder
*/
{
std::vector<std::string> CylStr{"cx 1", "c/x 1.0 1.0 1.0"};
// Cylinder origin // also cylinder at ?origin?
std::vector<std::string> CylStr{"cx 1", "c/x 1.0 1.0 1.0"};
Kernel::V3D P(0, -1.2, 0);
double results[] = {1.2 - 1, 1.41661};
......
......@@ -247,7 +247,6 @@ void NexusDescriptor::walkFile(::NeXus::File &file, const std::string &rootPath,
const std::string &entryClass = it->second;
const std::string entryPath = rootPath + "/" + entryName;
if (entryClass == "SDS") {
// tmap.emplace(entryClass, entryPath);
pmap.emplace(entryPath, entryClass);
} else if (entryClass == "CDF0.0") {
// Do nothing with this
......
......@@ -41,11 +41,6 @@ void CentroidPeaksMD2::init() {
Direction::Input),
"An input MDEventWorkspace.");
std::vector<std::string> propOptions;
propOptions.emplace_back("Q (lab frame)");
propOptions.emplace_back("Q (sample frame)");
propOptions.emplace_back("HKL");
declareProperty(
new PropertyWithValue<double>("PeakRadius", 1.0, Direction::Input),
"Fixed radius around each peak position in which to calculate the "
......
......@@ -199,16 +199,15 @@ bool PoldiPeakCollection::checkColumns(
return false;
}
std::vector<std::string> shouldNames;
shouldNames.emplace_back("HKL");
shouldNames.emplace_back("d");
shouldNames.emplace_back("delta d");
shouldNames.emplace_back("Q");
shouldNames.emplace_back("delta Q");
shouldNames.emplace_back("Intensity");
shouldNames.emplace_back("delta Intensity");
shouldNames.emplace_back("FWHM (rel.)");
shouldNames.emplace_back("delta FWHM (rel.)");
std::vector<std::string> shouldNames{"HKL",
"d",
"delta d",
"Q",
"delta Q",
"Intensity",
"delta Intensity",
"FWHM (rel.)",
"delta FWHM (rel.)"};
std::vector<std::string> columnNames = tableWorkspace->getColumnNames();
......
......@@ -19,11 +19,7 @@ using namespace Mantid::DataObjects;
void ProjectMD::init() {
declareProperty(new WorkspaceProperty<IMDHistoWorkspace>("InputWorkspace", "",
Direction::Input));
std::vector<std::string> projectOptions;
projectOptions.emplace_back("X");
projectOptions.emplace_back("Y");
projectOptions.emplace_back("Z");
projectOptions.emplace_back("K");
std::vector<std::string> projectOptions{"X", "Y", "Z", "K"};
this->declareProperty("ProjectDirection", "Z",
boost::make_shared<StringListValidator>(projectOptions),
"The project direction");
......
......@@ -17,11 +17,7 @@ using namespace Mantid::DataObjects;
void SINQTranspose3D::init() {
declareProperty(new WorkspaceProperty<IMDHistoWorkspace>("InputWorkspace", "",
Direction::Input));
std::vector<std::string> transposeOptions;
transposeOptions.emplace_back("Y,X,Z");
transposeOptions.emplace_back("X,Z,Y");
transposeOptions.emplace_back("TRICS");
transposeOptions.emplace_back("AMOR");
std::vector<std::string> transposeOptions{"Y,X,Z", "X,Z,Y", "TRICS", "AMOR"};
this->declareProperty(
"TransposeOption", "Y,X,Z",
boost::make_shared<StringListValidator>(transposeOptions),
......
......@@ -241,12 +241,7 @@ MDHistoWorkspace_sptr
makeFakeMDHistoWorkspaceGeneral(size_t numDims, double signal,
double errorSquared, size_t *numBins,
coord_t *min, coord_t *max, std::string name) {
std::vector<std::string> names;
names.emplace_back("x");
names.emplace_back("y");
names.emplace_back("z");
names.emplace_back("t");
std::vector<std::string> names{"x", "y", "z", "t"};
// Create MDFrame of General Frame type
Mantid::Geometry::GeneralFrame frame(
Mantid::Geometry::GeneralFrame::GeneralFrameDistance, "m");
......
......@@ -68,19 +68,14 @@ void ConvolutionFitSequential::init() {
"The input workspace for the fit.");
auto scv = boost::make_shared<StringContainsValidator>();
auto requires = std::vector<std::string>();
requires.emplace_back("Convolution");
requires.emplace_back("Resolution");
auto requires = std::vector<std::string>{"Convolution", "Resolution"};
scv->setRequiredStrings(requires);
declareProperty("Function", "", scv,
"The function that describes the parameters of the fit.",
Direction::Input);
std::vector<std::string> backType;
backType.emplace_back("Fixed Flat");
backType.emplace_back("Fit Flat");
backType.emplace_back("Fit Linear");
std::vector<std::string> backType{"Fixed Flat", "Fit Flat", "Fit Linear"};
declareProperty("BackgroundType", "Fixed Flat",
boost::make_shared<StringListValidator>(backType),
......
......@@ -20,9 +20,7 @@ void HFIRSANSNormalise::init() {
new WorkspaceProperty<>("InputWorkspace", "", Direction::Input),
"Workspace to be corrected");
std::vector<std::string> normOptions;
normOptions.emplace_back("Monitor");
normOptions.emplace_back("Timer");
std::vector<std::string> normOptions{"Monitor", "Timer"};
this->declareProperty("NormalisationType", "Monitor",
boost::make_shared<StringListValidator>(normOptions),
"Type of Normalisation to use");
......
......@@ -65,10 +65,8 @@ void MuonProcess::init() {
PropertyMode::Mandatory),
"Input workspace loaded from file (e.g. by LoadMuonNexus)");
std::vector<std::string> allowedModes;
allowedModes.emplace_back("CorrectAndGroup");
allowedModes.emplace_back("Analyse");
allowedModes.emplace_back("Combined");
std::vector<std::string> allowedModes{"CorrectAndGroup", "Analyse",
"Combined"};
auto modeVal = boost::make_shared<CompositeValidator>();
modeVal->add(boost::make_shared<StringListValidator>(allowedModes));
modeVal->add(boost::make_shared<MandatoryValidator<std::string>>());
......@@ -111,10 +109,8 @@ void MuonProcess::init() {
declareProperty("Xmin", EMPTY_DBL(), "Minimal X value to include");
declareProperty("Xmax", EMPTY_DBL(), "Maximal X value to include");
std::vector<std::string> allowedTypes;
allowedTypes.emplace_back("PairAsymmetry");
allowedTypes.emplace_back("GroupAsymmetry");
allowedTypes.emplace_back("GroupCounts");
std::vector<std::string> allowedTypes{"PairAsymmetry", "GroupAsymmetry",
"GroupCounts"};
declareProperty("OutputType", "PairAsymmetry",
boost::make_shared<StringListValidator>(allowedTypes),
"What kind of workspace required for analysis.");
......
......@@ -107,9 +107,7 @@ void RefReduction::init() {
setPropertySettings("AngleOffset", new VisibleWhenProperty(
"Instrument", IS_EQUAL_TO, "REF_L"));
std::vector<std::string> instrOptions;
instrOptions.emplace_back("REF_L");
instrOptions.emplace_back("REF_M");
std::vector<std::string> instrOptions{"REF_L", "REF_M"};
declareProperty("Instrument", "REF_M",
boost::make_shared<StringListValidator>(instrOptions),
"Instrument to reduce for");
......
......@@ -25,10 +25,7 @@ void SANSBeamFluxCorrection::init() {
new WorkspaceProperty<>("InputMonitorWorkspace", "", Direction::Input),
"Workspace containing the monitor counts for the sample data");
std::vector<std::string> exts;
exts.emplace_back("_event.nxs");
exts.emplace_back(".nxs");
exts.emplace_back(".nxs.h5");
std::vector<std::string> exts{"_event.nxs", ".nxs", ".nxs.h5"};
declareProperty(new API::FileProperty("ReferenceFluxFilename", "",
API::FileProperty::Load, exts),
"File containing the reference flux spectrum.");
......
......@@ -86,11 +86,8 @@ void SetupEQSANSReduction::init() {
// Beam center
std::string center_grp = "Beam Center";
std::vector<std::string> centerOptions;
centerOptions.emplace_back("None");
centerOptions.emplace_back("Value");
centerOptions.emplace_back("DirectBeam");
centerOptions.emplace_back("Scattering");
std::vector<std::string> centerOptions{"None", "Value", "DirectBeam",
"Scattering"};
declareProperty("BeamCenterMethod", "None",
boost::make_shared<StringListValidator>(centerOptions),
......@@ -256,9 +253,7 @@ void SetupEQSANSReduction::init() {
// Transmission
std::string trans_grp = "Transmission";
std::vector<std::string> transOptions;
transOptions.emplace_back("Value");
transOptions.emplace_back("DirectBeam");
std::vector<std::string> transOptions{"Value", "DirectBeam"};
declareProperty("TransmissionMethod", "Value",
boost::make_shared<StringListValidator>(transOptions),
"Transmission determination method");
......@@ -479,10 +474,7 @@ void SetupEQSANSReduction::init() {
declareProperty(
new ArrayProperty<int>("MaskedEdges"),
"Number of pixels to mask on the edges: X-low, X-high, Y-low, Y-high");
std::vector<std::string> maskOptions;
maskOptions.emplace_back("None");
maskOptions.emplace_back("Front");
maskOptions.emplace_back("Back");
std::vector<std::string> maskOptions{"None", "Front", "Back"};
declareProperty("MaskedSide", "None",
boost::make_shared<StringListValidator>(maskOptions),
"Mask one side of the detector");
......
......@@ -61,11 +61,8 @@ void SetupHFIRReduction::init() {
// Beam center
std::string center_grp = "Beam Center";
std::vector<std::string> centerOptions;
centerOptions.emplace_back("None");
centerOptions.emplace_back("Value");
centerOptions.emplace_back("DirectBeam");
centerOptions.emplace_back("Scattering");
std::vector<std::string> centerOptions{"None", "Value", "DirectBeam",
"Scattering"};
declareProperty("BeamCenterMethod", "None",
boost::make_shared<StringListValidator>(centerOptions),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment