Commit ac793bca authored by Zhang, Chen's avatar Zhang, Chen
Browse files

new constructor that converts lean peak to peak

parent 7e4dfc72
......@@ -7,6 +7,7 @@
#pragma once
#include "MantidDataObjects/BasePeak.h"
#include "MantidDataObjects/LeanElasticPeak.h"
#include "MantidGeometry/Crystal/IPeak.h"
#include "MantidGeometry/Crystal/PeakShape.h"
#include "MantidGeometry/Instrument.h"
......@@ -76,6 +77,11 @@ public:
explicit Peak(const Geometry::IPeak &ipeak);
// Construct a peak from LeanPeak
Peak(const Mantid::DataObjects::LeanElasticPeak &lpeak,
const Geometry::Instrument_const_sptr &inst,
boost::optional<double> detectorDistance = boost::none);
void setDetectorID(int id) override;
int getDetectorID() const override;
void addContributingDetID(const int id);
......
......@@ -126,6 +126,7 @@ Peak::Peak(const Geometry::Instrument_const_sptr &m_inst, int m_detectorID,
this->setWavelength(m_Wavelength);
this->setHKL(HKL);
}
//----------------------------------------------------------------------------------------------
/** Constructor
*
......@@ -177,6 +178,14 @@ Peak::Peak(const Geometry::IPeak &ipeak)
}
}
//----------------------------------------------------------------------------------------------
Peak::Peak(const Mantid::DataObjects::LeanElasticPeak &lpeak,
const Geometry::Instrument_const_sptr &inst,
boost::optional<double> detectorDistance) {
this->setInstrument(inst);
this->setQLabFrame(lpeak.getQLabFrame(), std::move(detectorDistance));
}
//----------------------------------------------------------------------------------------------
/** Set the incident wavelength of the neutron. Calculates the energy from this.
* Assumes elastic scattering.
......
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