37 "A peaks workspace.");
39 "An input workspace containing the run information.");
41 declareProperty(
"DetectorID", 0,
"ID of a detector at the peak centre.");
53 auto runInst = runWS->getInstrument()->getName();
54 auto peakInst = peaksWS->getInstrument()->getName();
55 if (peaksWS->getNumberPeaks() > 0 && (runInst != peakInst)) {
56 throw std::runtime_error(
"The peak from " + runWS->getName() +
" comes from a different instrument (" + runInst +
58 "already in the table (" +
59 peakInst +
"). It could not be added.");
67 const auto &detectorInfo = runWS->detectorInfo();
77 double Qx = -sin(theta2) * cos(phi);
78 double Qy = -sin(theta2) * sin(phi);
79 double Qz = 1.0 - cos(theta2);
80 double l1 = detectorInfo.l1();
82 std::vector<int> emptyWarningVec;
86 if (unit->unitID() !=
"TOF") {
99 efixed = par->value<
double>();
101 }
catch (std::runtime_error &) {
109 std::vector<double> xdata(1, tof);
110 std::vector<double> ydata;
111 unit->toTOF(xdata, ydata, l1, emode,
123 if (m_qConvention ==
"Crystallography") {
133 peak->setDetectorID(detID);
134 peak->setGoniometerMatrix(runWS->run().getGoniometer().getR());
135 peak->setBinCount(
count);
136 peak->setRunNumber(runWS->getRunNumber());
137 peak->setIntensity(
height);
139 peak->setSigmaIntensity(std::sqrt(
height));
141 peaksWS->addPeak(*peak);
#define DECLARE_ALGORITHM(classname)
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
bool hasProperty(const std::string &name) const
Does the property exist on the object.
HeldType getPropertyValueAsType(const std::string &name) const
Get the value of a property as the given TYPE.
This class stores information regarding an experimental run as a series of log entries.
A property class for workspaces.
void exec() override
Run the algorithm.
void init() override
Initialise the properties.
Structure describing a single-crystal peak.
The class PeaksWorkspace stores information about a set of SCD peaks.
virtual bool hasParameter(const std::string &name, bool recursive=true) const =0
Returns a boolean indicating if the component has the named parameter.
Interface class for detector objects.
virtual double getPhi() const =0
Gives the phi of this detector object in radians.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< PeaksWorkspace > PeaksWorkspace_sptr
Typedef for a shared pointer to a peaks workspace.
std::unique_ptr< Peak > Peak_uptr
std::shared_ptr< Parameter > Parameter_sptr
Typedef for the shared pointer.
std::unique_ptr< IPeak > IPeak_uptr
std::shared_ptr< Unit > Unit_sptr
Shared pointer to the Unit base class.
A namespace containing physical constants that are required by algorithms and unit routines.
static constexpr double NeutronMass
Mass of the neutron in kg.
static constexpr double h_bar
Planck constant in J*s, divided by 2 PI.
Generate a tableworkspace to store the calibration results.
@ InOut
Both an input & output workspace.
@ Input
An input workspace.