Commit 30aabfae authored by Lynch, Vickie's avatar Lynch, Vickie
Browse files

Refs #22420 array for int HKL

parent 19fccd70
......@@ -73,8 +73,8 @@ void FindUBUsingIndexedPeakswithSatellites::exec() {
// just check for (0,0,0,0,0,0)
{
q_vectors.push_back(peaks[i].getQSampleFrame());
hkl_vectors.emplace_back(hkl[0], hkl[1], hkl[2]);
mnp_vectors.emplace_back(mnp[0], mnp[1], mnp[2]);
hkl_vectors.emplace_back(hkl);
mnp_vectors.emplace_back(mnp);
indexed_count++;
}
}
......
......@@ -253,14 +253,8 @@ private:
int m_peakNumber;
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;
/// integer HKL of the peak
std::array<int, 3> m_intHKL;
/// 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_intHKL{ {0, 0, 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_intHKL{ {0, 0, 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_intHKL{ {0, 0, 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_intHKL{ {0, 0, 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_intHKL{ {0, 0, 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_intHKL{ {0, 0, 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_intHKL{ {0, 0, 0} },
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
this->setInstrument(m_inst);
......@@ -206,8 +206,8 @@ 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_intH(other.m_intH), m_intK(other.m_intK),
m_intL(other.m_intL), m_detIDs(other.m_detIDs),
m_modStru(other.m_modStru), m_intHKL(other.m_intHKL),
m_detIDs(other.m_detIDs),
m_peakShape(other.m_peakShape->clone()), convention(other.convention) {}
//----------------------------------------------------------------------------------------------
......@@ -229,8 +229,7 @@ Peak::Peak(const Geometry::IPeak &ipeak)
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.getIntMNP()),
m_intH(int(ipeak.getIntHKL().X())), m_intK(int(ipeak.getIntHKL().Y())),
m_intL(int(ipeak.getIntHKL().Z())),
m_intHKL{ {static_cast<int>(ipeak.getIntHKL()[0]), static_cast<int>(ipeak.getIntHKL()[1]), static_cast<int>(ipeak.getIntHKL()[2])} },
m_peakShape(boost::make_shared<NoShape>()) {
convention = Kernel::ConfigService::Instance().getString("Q.convention");
if (fabs(m_InverseGoniometerMatrix.Invert()) < 1e-8)
......@@ -763,7 +762,7 @@ Mantid::Kernel::V3D Peak::getHKL() const { return V3D(m_H, m_K, m_L); }
/** Return the int HKL vector */
Mantid::Kernel::V3D Peak::getIntHKL() const {
return V3D(m_intH, m_intK, m_intL);
return V3D(m_intHKL[0], m_intHKL[1], m_intHKL[2]);
}
//----------------------------------------------------------------------------------------------
......@@ -826,9 +825,7 @@ void Peak::setHKL(const Mantid::Kernel::V3D &HKL) {
* @param HKL :: vector with integer x,y,z -> h,k,l
*/
void Peak::setIntHKL(const Mantid::Kernel::V3D &HKL) {
m_intH = boost::math::iround(HKL.X());
m_intK = boost::math::iround(HKL.Y());
m_intL = boost::math::iround(HKL.Z());
m_intHKL = {boost::math::iround(HKL.X()), boost::math::iround(HKL.Y()), boost::math::iround(HKL.Z())};
}
//----------------------------------------------------------------------------------------------
......
......@@ -215,7 +215,6 @@ protected:
void calculateGstar();
void calculateReciprocalLattice();
void calculateB();
// void calculateModVec();
virtual void recalculate();
};
......
......@@ -815,7 +815,7 @@ double IndexingUtils::Optimize_6dUB(DblMatrix &UB, DblMatrix &ModUB,
std::vector<double> &sigabc,
std::vector<double> &sigq) {
if (ModDim != 1 && ModDim != 2 && ModDim != 3)
if (ModDim <= 0 || ModDim > 3)
throw std::invalid_argument("invalid Value for Modulation Dimension");
double result = 0;
......@@ -981,7 +981,7 @@ double IndexingUtils::Optimize_6dUB(DblMatrix &UB, DblMatrix &ModUB,
"of q_vectors");
}
if (ModDim != 1 && ModDim != 2 && ModDim != 3)
if (ModDim <= 0 || ModDim > 3)
throw std::invalid_argument("invalid Value for Modulation Dimension");
gsl_matrix *H_transpose = gsl_matrix_alloc(hkl_vectors.size(), ModDim + 3);
......@@ -2936,10 +2936,7 @@ bool IndexingUtils::GetModulationVector(const DblMatrix &UB,
ModVec = o_lattice.getModVec(j);
if (ModVec[0] != 0.0 || ModVec[1] != 0.0 || ModVec[2] != 0.0)
return true;
else
return false;
return (ModVec[0] != 0.0 || ModVec[1] != 0.0 || ModVec[2] != 0.0);
}
/**
......
......@@ -624,17 +624,6 @@ void UnitCell::recalculate() {
calculateB();
}
/// Private function to calculate #G matrix
/*
void UnitCell::calculateModVec()
{
ModVec1(ModHKL[0][0],ModHKL[1][0],ModHKL[2][0]);
ModVec1(ModHKL[0][1],ModHKL[1][1],ModHKL[2][1]);
ModVec1(ModHKL[0][2],ModHKL[1][2],ModHKL[2][2]);
}
*/
void UnitCell::calculateG() {
G[0][0] = da[0] * da[0];
G[1][1] = da[1] * da[1];
......
Supports Markdown
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