Commit f8aa054e authored by Lynch, Vickie's avatar Lynch, Vickie
Browse files

Refs #22420 changes requested by reviewer

parent 91d939d1
......@@ -42,7 +42,8 @@ public:
int confidence(Kernel::FileDescriptor &descriptor) const override;
private:
bool m_ModStru;
/// Flag for reading modulated structures
bool m_isModulatedStructure;
std::vector<double> m_offset1 = {0.0, 0.0, 0.0};
std::vector<double> m_offset2 = {0.0, 0.0, 0.0};
std::vector<double> m_offset3 = {0.0, 0.0, 0.0};
......@@ -86,6 +87,9 @@ private:
boost::shared_ptr<const Geometry::IComponent> getCachedBankByName(
std::string bankname,
const boost::shared_ptr<const Geometry::Instrument> &inst);
/// Read offsets and add as property
void getOffsets(std::ifstream &in, API::Run &run, std::vector<double> m_offset, std::string &label, double &qSign);
};
} // namespace Mantid
......
......@@ -10,8 +10,8 @@ namespace Crystal {
corresponding
to fractional h,k,and l values.
@author Ruth Mikkelson
@date 2012-12-05
@author Vickie Lynch
@date 2018-07-13
Copyright &copy; 2012 ISIS Rutherford Appleton Laboratory &
NScD Oak Ridge National Laboratory
......
......@@ -35,7 +35,8 @@ public:
}
private:
bool m_ModStru = false;
/// Flag for writing modulated structures
bool m_isModulatedStructure = false;
/// Initialise the properties
void init() override;
......
......@@ -289,7 +289,7 @@ namespace Crystal
if (IndexingUtils::ValidIndex(hkl, tolerance))
{
peaks[i].setModStru(V3D(0,0,0));
peaks[i].setModulationVector(V3D(0,0,0));
main_indexed++;
h_error = fabs(round(hkl[0])-hkl[0]);
k_error = fabs(round(hkl[1])-hkl[1]);
......@@ -307,7 +307,7 @@ namespace Crystal
hkl1[2] -= order * offsets1[2];
if (IndexingUtils::ValidIndex(hkl1, satetolerance))
{
peaks[i].setModStru(V3D(order,0,0));
peaks[i].setModulationVector(V3D(order,0,0));
sate_indexed++;
h_error = fabs(round(hkl1[0])-hkl1[0]);
k_error = fabs(round(hkl1[1])-hkl1[1]);
......@@ -324,7 +324,7 @@ namespace Crystal
hkl1[2] -= order * offsets2[2];
if (IndexingUtils::ValidIndex(hkl1, satetolerance))
{
peaks[i].setModStru(V3D(0,order,0));
peaks[i].setModulationVector(V3D(0,order,0));
sate_indexed++;
h_error = fabs(round(hkl1[0])-hkl1[0]);
k_error = fabs(round(hkl1[1])-hkl1[1]);
......@@ -341,7 +341,7 @@ namespace Crystal
hkl1[2] -= order * offsets3[2];
if (IndexingUtils::ValidIndex(hkl1, satetolerance))
{
peaks[i].setModStru(V3D(0,0,order));
peaks[i].setModulationVector(V3D(0,0,order));
sate_indexed++;
h_error = fabs(round(hkl1[0])-hkl1[0]);
k_error = fabs(round(hkl1[1])-hkl1[1]);
......
......@@ -157,10 +157,7 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS,
else if (tag == "Date:")
date = getWord(in, false);
tag = getWord(in, false);
if (tag == "MOD")
m_ModStru = true;
else
m_ModStru = false;
m_isModulatedStructure = tag == "MOD";
readToEndOfLine(in, true);
// Now we load the instrument using the name and date
......@@ -201,7 +198,7 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS,
if (s == "5")
det.push_back(bank);
if (s == "9") {
m_offset1[0] = qSign * std::stod(getWord(in, false), nullptr);
/* m_offset1[0] = qSign * std::stod(getWord(in, false), nullptr);
m_offset1[1] = qSign * std::stod(getWord(in, false), nullptr);
m_offset1[2] = qSign * std::stod(getWord(in, false), nullptr);
m_offset2[0] = qSign * std::stod(getWord(in, false), nullptr);
......@@ -215,7 +212,14 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS,
outWS->mutableRun().addProperty<std::vector<double>>("Offset2", m_offset2,
true);
outWS->mutableRun().addProperty<std::vector<double>>("Offset3", m_offset3,
true);
true);*/
auto run = outWS->mutableRun();
std::string offsetName = "Offset1";
getOffsets(in, run, m_offset1, offsetName, qSign);
offsetName = "Offset1";
getOffsets(in, run, m_offset2, offsetName, qSign);
offsetName = "Offset1";
getOffsets(in, run, m_offset3, offsetName, qSign);
}
}
// Find bank numbers in instument that are not in header lines
......@@ -267,6 +271,23 @@ std::string LoadIsawPeaks::readHeader(PeaksWorkspace_sptr outWS,
return s;
}
//-----------------------------------------------------------------------------------------------
/** Read offsets and add as property
*
* @param in :: input file stream
* @param run :: mutable run of workspace
* @param m_offset :: vectors of offsets
* @param lablel :: label for property
* @param qSign :: For inelastic this is 1; for crystallography this is -1
* @return void
*/
void LoadIsawPeaks::getOffsets(std::ifstream &in, API::Run &run, std::vector<double> m_offset, std::string &label, double &qSign) {
for (int i=0; i<3; i++)
m_offset.push_back(qSign * std::stod(getWord(in, false), nullptr));
run.addProperty<std::vector<double>>(label, m_offset,
true);
}
//-----------------------------------------------------------------------------------------------
/** Read one peak in a line of an ISAW peaks file.
*
......@@ -324,15 +345,15 @@ DataObjects::Peak LoadIsawPeaks::readPeak(PeaksWorkspace_sptr outWS,
l = qSign * std::stod(getWord(in, false), nullptr);
V3D mod = V3D(0, 0, 0);
V3D intHKL = V3D(h, k, l);
if (m_ModStru) {
if (m_isModulatedStructure) {
mod[0] = qSign * std::stoi(getWord(in, false), nullptr);
mod[1] = qSign * std::stoi(getWord(in, false), nullptr);
mod[2] = qSign * std::stoi(getWord(in, false), nullptr);
double deltaH =
auto deltaH =
mod[0] * m_offset1[0] + mod[1] * m_offset2[0] + mod[2] * m_offset3[0];
double deltaK =
auto deltaK =
mod[0] * m_offset1[1] + mod[1] * m_offset2[1] + mod[2] * m_offset3[1];
double deltaL =
auto deltaL =
mod[0] * m_offset1[2] + mod[1] * m_offset2[2] + mod[2] * m_offset3[2];
h += deltaH;
......@@ -371,8 +392,8 @@ DataObjects::Peak LoadIsawPeaks::readPeak(PeaksWorkspace_sptr outWS,
Peak peak(outWS->getInstrument(), pixelID, wl);
peak.setHKL(h, k, l);
peak.setIntHKL(intHKL);
if (m_ModStru) {
peak.setModStru(mod);
if (m_isModulatedStructure) {
peak.setModulationVector(mod);
}
peak.setIntensity(Inti);
peak.setSigmaIntensity(SigI);
......
/*
* PredictSatellitePeaks.cpp
*
* Created on: Dec 5, 2012
* Author: ruth
* Created on: July 15, 2018
* Author: Vickie Lynch
*/
#include "MantidCrystal/PredictSatellitePeaks.h"
#include "MantidAPI/Sample.h"
......@@ -132,15 +132,15 @@ void PredictSatellitePeaks::exec() {
return;
}
API::Sample samp = Peaks->sample();
API::Sample sample = Peaks->sample();
Geometry::OrientedLattice &ol = samp.getOrientedLattice();
const auto &lattice = sample.getOrientedLattice();
Geometry::Instrument_const_sptr Instr = Peaks->getInstrument();
const auto instrument = Peaks->getInstrument();
auto OutPeaks = boost::dynamic_pointer_cast<IPeaksWorkspace>(
WorkspaceFactory::Instance().createPeaks());
OutPeaks->setInstrument(Instr);
OutPeaks->setInstrument(instrument);
OutPeaks->mutableRun().addProperty<std::vector<double>>("Offset1", offsets1,
true);
OutPeaks->mutableRun().addProperty<std::vector<double>>("Offset2", offsets2,
......@@ -151,8 +151,8 @@ void PredictSatellitePeaks::exec() {
V3D hkl;
int peakNum = 0;
const auto NPeaks = Peaks->getNumberPeaks();
Kernel::Matrix<double> Gon;
Gon.identityMatrix();
Kernel::Matrix<double> goniometer;
goniometer.identityMatrix();
const double lambdaMin = getProperty("WavelengthMin");
const double lambdaMax = getProperty("WavelengthMax");
......@@ -162,8 +162,8 @@ void PredictSatellitePeaks::exec() {
if (includePeaksInRange) {
const double dMin = getProperty("MinDSpacing");
const double dMax = getProperty("MaxDSpacing");
Geometry::HKLGenerator gen(ol, dMin);
auto filter = boost::make_shared<HKLFilterDRange>(ol, dMin, dMax);
Geometry::HKLGenerator gen(lattice, dMin);
auto filter = boost::make_shared<HKLFilterDRange>(lattice, dMin, dMax);
V3D hkl = *(gen.begin());
g_log.information() << "HKL range for d_min of " << dMin << " to d_max of "
......@@ -189,14 +189,14 @@ void PredictSatellitePeaks::exec() {
N = max<size_t>(100, N);
}
auto RunNumber = peak0.getRunNumber();
const Kernel::DblMatrix &UB = ol.getUB();
Gon = peak0.getGoniometerMatrix();
auto &UB = lattice.getUB();
goniometer = peak0.getGoniometerMatrix();
Progress prog(this, 0.0, 1.0, N);
vector<vector<int>> AlreadyDonePeaks;
bool done = false;
int ErrPos = 1; // Used to determine position in code of a throw
Geometry::InstrumentRayTracer tracer(Peaks->getInstrument());
DblMatrix orientedUB = Gon * UB;
DblMatrix orientedUB = goniometer * UB;
HKLFilterWavelength lambdaFilter(orientedUB, lambdaMin, lambdaMax);
int seqNum = 0;
size_t next = 0;
......@@ -214,18 +214,16 @@ void PredictSatellitePeaks::exec() {
if (!lambdaFilter.isAllowed(hkl1) && includePeaksInRange)
continue;
Kernel::V3D Qs = UB * hkl1;
Qs *= 2.0;
Qs *= M_PI;
Qs = Gon * Qs;
Kernel::V3D Qs = goniometer * UB * hkl1 * 2.0 * M_PI;
if (Qs[2] <= 0)
continue;
ErrPos = 1;
boost::shared_ptr<IPeak> peak(Peaks->createPeak(Qs, 1));
auto peak(Peaks->createPeak(Qs, 1));
peak->setGoniometerMatrix(Gon);
peak->setGoniometerMatrix(goniometer);
if (Qs[2] > 0 && peak->findDetector(tracer)) {
ErrPos = 2;
......@@ -247,10 +245,10 @@ void PredictSatellitePeaks::exec() {
peak->setPeakNumber(seqNum);
seqNum++;
peak->setRunNumber(RunNumber);
peak->setModStru(V3D(order, 0, 0));
peak->setModulationVector(V3D(order, 0, 0));
OutPeaks->addPeak(*peak);
}
} catch (...) {
} catch (std::runtime_error &) {
if (ErrPos != 1) // setQLabFrame in createPeak throws exception
throw std::invalid_argument("Invalid data at this point");
}
......@@ -266,10 +264,7 @@ void PredictSatellitePeaks::exec() {
hkl1[1] += order * offsets2[1];
hkl1[2] += order * offsets2[2];
Kernel::V3D Qs = UB * hkl1;
Qs *= 2.0;
Qs *= M_PI;
Qs = Gon * Qs;
Kernel::V3D Qs = goniometer * UB * hkl1 * 2.0 * M_PI;
if (Qs[2] <= 0)
continue;
......@@ -277,7 +272,7 @@ void PredictSatellitePeaks::exec() {
boost::shared_ptr<IPeak> peak(Peaks->createPeak(Qs, 1));
peak->setGoniometerMatrix(Gon);
peak->setGoniometerMatrix(goniometer);
if (Qs[2] > 0 && peak->findDetector(tracer)) {
ErrPos = 2;
......@@ -298,10 +293,10 @@ void PredictSatellitePeaks::exec() {
peak->setPeakNumber(seqNum);
seqNum++;
peak->setRunNumber(RunNumber);
peak->setModStru(V3D(0, order, 0));
peak->setModulationVector(V3D(0, order, 0));
OutPeaks->addPeak(*peak);
}
} catch (...) {
} catch (std::runtime_error &) {
if (ErrPos != 1) // setQLabFrame in createPeak throws exception
throw std::invalid_argument("Invalid data at this point");
}
......@@ -317,10 +312,7 @@ void PredictSatellitePeaks::exec() {
hkl1[1] += order * offsets3[1];
hkl1[2] += order * offsets3[2];
Kernel::V3D Qs = UB * hkl1;
Qs *= 2.0;
Qs *= M_PI;
Qs = Gon * Qs;
Kernel::V3D Qs = goniometer * UB * hkl1 * 2.0 * M_PI;
if (Qs[2] <= 0)
continue;
......@@ -328,7 +320,7 @@ void PredictSatellitePeaks::exec() {
boost::shared_ptr<IPeak> peak(Peaks->createPeak(Qs, 1));
peak->setGoniometerMatrix(Gon);
peak->setGoniometerMatrix(goniometer);
if (Qs[2] > 0 && peak->findDetector(tracer)) {
ErrPos = 2;
......@@ -349,10 +341,10 @@ void PredictSatellitePeaks::exec() {
peak->setPeakNumber(seqNum);
seqNum++;
peak->setRunNumber(RunNumber);
peak->setModStru(V3D(0, 0, order));
peak->setModulationVector(V3D(0, 0, order));
OutPeaks->addPeak(*peak);
}
} catch (...) {
} catch (std::runtime_error &) {
if (ErrPos != 1) // setQLabFrame in createPeak throws exception
throw std::invalid_argument("Invalid data at this point");
}
......@@ -373,7 +365,7 @@ void PredictSatellitePeaks::exec() {
hkl[0] = peak1.getH();
hkl[1] = peak1.getK();
hkl[2] = peak1.getL();
Gon = peak1.getGoniometerMatrix();
goniometer = peak1.getGoniometerMatrix();
RunNumber = peak1.getRunNumber();
}
}
......
......@@ -94,8 +94,8 @@ void SaveIsawPeaks::exec() {
runMap_t runMap;
for (size_t i = 0; i < peaks.size(); ++i) {
Peak &p = peaks[i];
if (p.getModStru() != V3D(0, 0, 0))
m_ModStru = true;
if (p.getModulationVector() != V3D(0, 0, 0))
m_isModulatedStructure = true;
int run = p.getRunNumber();
int bank = 0;
std::string bankName = p.getBankName();
......@@ -117,7 +117,7 @@ void SaveIsawPeaks::exec() {
// Save in the map
runMap[run][bank].push_back(i);
}
if (m_ModStru)
if (m_isModulatedStructure)
header =
"2 SEQN H K L M N P COL ROW CHAN "
" L2 2_THETA AZ WL D IPK "
......@@ -160,7 +160,7 @@ void SaveIsawPeaks::exec() {
// saving.
Types::Core::DateAndTime expDate = inst->getValidFromDate() + 1.0;
out << expDate.toISO8601String();
if (m_ModStru)
if (m_isModulatedStructure)
out << " MOD";
out << '\n';
......@@ -272,7 +272,7 @@ void SaveIsawPeaks::exec() {
// Go in order of run numbers
std::vector<double> offset1, offset2, offset3;
if (m_ModStru) {
if (m_isModulatedStructure) {
auto run = ws->mutableRun();
offset1 = run.getPropertyValueAsType<std::vector<double>>("Offset1");
offset2 = run.getPropertyValueAsType<std::vector<double>>("Offset2");
......@@ -352,8 +352,8 @@ void SaveIsawPeaks::exec() {
// HKL's are flipped by -1 because of the internal Q convention
// unless Crystallography convention
if (m_ModStru) {
V3D mod = p.getModStru();
if (m_isModulatedStructure) {
V3D mod = p.getModulationVector();
auto intHKL = p.getIntHKL();
out << std::setw(5) << Utils::round(qSign * intHKL.X())
<< std::setw(5) << Utils::round(qSign * intHKL.Y())
......
......@@ -80,23 +80,20 @@ public:
TS_ASSERT_EQUALS(SatellitePeaks->getNumberPeaks(), 122);
Peak &peakx = dynamic_cast<Peak &>(SatellitePeaks->getPeak(0));
Peak peak = peakx;
TS_ASSERT_DELTA(peak.getH(), -5.5, .0001);
TS_ASSERT_DELTA(peak.getK(), 7.0, .0001);
TS_ASSERT_DELTA(peak.getL(), -4.2, .0001);
peakx = dynamic_cast<Peak &>(SatellitePeaks->getPeak(3));
peak = peakx;
TS_ASSERT_DELTA(peak.getH(), -5.5, .0001);
TS_ASSERT_DELTA(peak.getK(), 3.0, .0001);
TS_ASSERT_DELTA(peak.getL(), -3.2, .0001);
peakx = dynamic_cast<Peak &>(SatellitePeaks->getPeak(6));
peak = peakx;
TS_ASSERT_DELTA(peak.getH(), -6.5, .0001);
TS_ASSERT_DELTA(peak.getK(), 4.0, .0001);
TS_ASSERT_DELTA(peak.getL(), -4.2, .0001);
auto &peak0 = SatellitePeaks->getPeak(0);
TS_ASSERT_DELTA(peak0.getH(), -5.5, .0001);
TS_ASSERT_DELTA(peak0.getK(), 7.0, .0001);
TS_ASSERT_DELTA(peak0.getL(), -4.2, .0001);
auto &peak3 = SatellitePeaks->getPeak(3);
TS_ASSERT_DELTA(peak3.getH(), -5.5, .0001);
TS_ASSERT_DELTA(peak3.getK(), 3.0, .0001);
TS_ASSERT_DELTA(peak3.getL(), -3.2, .0001);
auto &peak6 = SatellitePeaks->getPeak(6);
TS_ASSERT_DELTA(peak6.getH(), -6.5, .0001);
TS_ASSERT_DELTA(peak6.getK(), 4.0, .0001);
TS_ASSERT_DELTA(peak6.getL(), -4.2, .0001);
}
};
......
......@@ -154,8 +154,8 @@ public:
void setCol(int m_col);
void setPeakNumber(int m_peakNumber) override;
int getPeakNumber() const override;
void setModStru(Mantid::Kernel::V3D m_ModStru) override;
Mantid::Kernel::V3D getModStru() const override;
void setModulationVector(const Mantid::Kernel::V3D m_modStru) override;
Mantid::Kernel::V3D getModulationVector() const override;
virtual Mantid::Kernel::V3D getDetPos() const override;
double getL1() const override;
......@@ -203,15 +203,6 @@ private:
/// L of the peak
double m_L;
/// integer H of the peak
int m_intH;
/// integer K of the peak
int m_intK;
/// integer L of the peak
int m_intL;
/// Integrated peak intensity
double m_intensity;
......@@ -260,7 +251,16 @@ private:
// keep peak number
int m_peakNumber;
Mantid::Kernel::V3D m_ModStru;
Mantid::Kernel::V3D m_modStru;
/// integer H of the peak
int m_intH;
/// integer K of the peak
int m_intK;
/// integer L of the peak
int m_intL;
/// List of contributing detectors IDs
std::set<int> m_detIDs;
......
......@@ -30,7 +30,7 @@ Peak::Peak()
m_finalEnergy(0.), m_GoniometerMatrix(3, 3, true),
m_InverseGoniometerMatrix(3, 3, true), m_runNumber(0), m_monitorCount(0),
m_row(-1), m_col(-1), m_orig_H(0), m_orig_K(0), m_orig_L(0),
m_peakNumber(0), m_ModStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_peakNumber(0), m_modStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
}
......@@ -52,7 +52,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst,
m_binCount(0), m_GoniometerMatrix(3, 3, true),
m_InverseGoniometerMatrix(3, 3, true), m_runNumber(0), m_monitorCount(0),
m_orig_H(0), m_orig_K(0), m_orig_L(0), m_peakNumber(0),
m_ModStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_modStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
this->setInstrument(m_inst);
......@@ -80,7 +80,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst,
m_binCount(0), m_GoniometerMatrix(goniometer),
m_InverseGoniometerMatrix(goniometer), m_runNumber(0), m_monitorCount(0),
m_orig_H(0), m_orig_K(0), m_orig_L(0), m_peakNumber(0),
m_ModStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_modStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
if (fabs(m_InverseGoniometerMatrix.Invert()) < 1e-8)
......@@ -104,7 +104,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst, int m_detectorID,
m_binCount(0), m_GoniometerMatrix(3, 3, true),
m_InverseGoniometerMatrix(3, 3, true), m_runNumber(0), m_monitorCount(0),
m_orig_H(0), m_orig_K(0), m_orig_L(0), m_peakNumber(0),
m_ModStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_modStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
this->setInstrument(m_inst);
......@@ -127,7 +127,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst, int m_detectorID,
m_sigmaIntensity(0), m_binCount(0), m_GoniometerMatrix(3, 3, true),
m_InverseGoniometerMatrix(3, 3, true), m_runNumber(0), m_monitorCount(0),
m_orig_H(0), m_orig_K(0), m_orig_L(0), m_peakNumber(0),
m_ModStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_modStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
this->setInstrument(m_inst);
......@@ -152,7 +152,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst, int m_detectorID,
m_sigmaIntensity(0), m_binCount(0), m_GoniometerMatrix(goniometer),
m_InverseGoniometerMatrix(goniometer), m_runNumber(0), m_monitorCount(0),
m_orig_H(0), m_orig_K(0), m_orig_L(0), m_peakNumber(0),
m_ModStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_modStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
if (fabs(m_InverseGoniometerMatrix.Invert()) < 1e-8)
......@@ -176,7 +176,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst, double scattering,
m_binCount(0), m_GoniometerMatrix(3, 3, true),
m_InverseGoniometerMatrix(3, 3, true), m_runNumber(0), m_monitorCount(0),
m_row(-1), m_col(-1), m_orig_H(0), m_orig_K(0), m_orig_L(0),
m_peakNumber(0), m_ModStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_peakNumber(0), m_modStru(V3D(0, 0, 0)), m_intH(0), m_intK(0), m_intL(0),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
this->setInstrument(m_inst);
......@@ -206,8 +206,9 @@ Peak::Peak(const Peak &other)
samplePos(other.samplePos), detPos(other.detPos),
m_orig_H(other.m_orig_H), m_orig_K(other.m_orig_K),
m_orig_L(other.m_orig_L), m_peakNumber(other.m_peakNumber),
m_ModStru(other.m_ModStru), m_detIDs(other.m_detIDs),
m_modStru(other.m_modStru),
m_intH(other.m_intH), m_intK(other.m_intK), m_intL(other.m_intL),
m_detIDs(other.m_detIDs),
m_peakShape(other.m_peakShape->clone()), convention(other.convention) {}
//----------------------------------------------------------------------------------------------
......@@ -228,9 +229,9 @@ Peak::Peak(const Geometry::IPeak &ipeak)
m_runNumber(ipeak.getRunNumber()),
m_monitorCount(ipeak.getMonitorCount()), m_row(ipeak.getRow()),
m_col(ipeak.getCol()), m_orig_H(0.), m_orig_K(0.), m_orig_L(0.),
m_peakNumber(ipeak.getPeakNumber()), m_ModStru(ipeak.getModStru()),
m_intH(ipeak.getIntHKL().X()), m_intK(ipeak.getIntHKL().Y()),
m_intL(ipeak.getIntHKL().Z()),
m_peakNumber(ipeak.getPeakNumber()), m_modStru(ipeak.getModulationVector()),
m_intH(int(ipeak.getIntHKL().X())), m_intK(int(ipeak.getIntHKL().Y())),
m_intL(int(ipeak.getIntHKL().Z())),
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
if (fabs(m_InverseGoniometerMatrix.Invert()) < 1e-8)
......@@ -923,7 +924,7 @@ int Peak::getPeakNumber() const { return m_peakNumber; }
// -------------------------------------------------------------------------------------
/**Returns the unique peak number
* Returns -1 if it could not find it. */
V3D Peak::getModStru() const { return m_ModStru; }
V3D Peak::getModulationVector() const { return m_modStru; }
// -------------------------------------------------------------------------------------
/** For RectangularDetectors only, sets the row (y) of the pixel of the
......@@ -946,8 +947,8 @@ void Peak::setPeakNumber(int m_peakNumber) {
// -------------------------------------------------------------------------------------
/** Sets the modulated peak structure number
* @param m_ModStru :: modulated peak structure value */
void Peak::setModStru(V3D m_ModStru) { this->m_ModStru = m_ModStru; }
* @param m_modStru :: modulated peak structure value */
void Peak::setModulationVector(V3D m_modStru) { this->m_modStru = m_modStru; }
// -------------------------------------------------------------------------------------
/** Return the detector position vector */
......
......@@ -84,8 +84,8 @@ public:
virtual int getPeakNumber() const = 0;