32 : m_ws(
std::move(ws)), m_spectrumInfo(m_ws->spectrumInfo()) {}
43 const auto &beamDir =
m_ws->getInstrument()->getReferenceFrame()->vecPointingAlongBeam();
45 const double scale = std::abs(L1s / L1m);
56 efix = par->value<
double>();
58 }
catch (std::runtime_error &) {
60 std::stringstream errmsg;
61 errmsg <<
"Inelastic instrument detector " << det->
getID() <<
" of spectrum " << workspace_index
62 <<
" does not have EFixed ";
63 throw std::runtime_error(errmsg.str());
66 std::stringstream errmsg;
67 errmsg <<
"Inelastic instrument detector " << det->
getID() <<
" of spectrum " << workspace_index
68 <<
" does not have EFixed ";
69 throw std::runtime_error(errmsg.str());
73 const double shift = -1. *
l2 / sqrt(efix * TWO_MEV_OVER_MASS);
bool isMonitor(const size_t index) const
Returns true if the detector(s) associated with the spectrum are monitors.
Kernel::V3D sourcePosition() const
Returns the source position.
Kernel::V3D position(const size_t index) const
Returns the position of the spectrum with given index.
double l2(const size_t index) const
Returns L2 (distance from sample to spectrum).
const Geometry::IDetector & detector(const size_t index) const
Return a const reference to the detector or detector group of the spectrum with given index.
double l1() const
Returns L1 (distance from source to sample).
const API::SpectrumInfo & m_spectrumInfo
std::shared_ptr< const Mantid::API::MatrixWorkspace > m_ws
Workspace to operate on.
TimeAtSampleStrategyIndirect(std::shared_ptr< const Mantid::API::MatrixWorkspace > ws)
Constructor.
Correction calculate(const size_t &workspace_index) const override
Interface class for detector objects.
virtual detid_t getID() const =0
Get the detector ID.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< Parameter > Parameter_sptr
Typedef for the shared pointer.
static constexpr double NeutronMass
Mass of the neutron in kg.
static constexpr double meV
1 meV in Joules.
Generate a tableworkspace to store the calibration results.
The Correction struct to be applied as factor * TOF + offset offset:: TOF offset in unit of TOF facto...