31 : m_spectrumInfo(ws->spectrumInfo()), m_L1s(m_spectrumInfo.l1()),
32 m_beamDir(ws->getInstrument()->getReferenceFrame()->vecPointingAlongBeam()),
33 m_paramMap(ws->constInstrumentParameters()) {}
46 efixed = par->value<
double>();
48 }
catch (std::runtime_error &) {
50 std::stringstream errmsg;
51 errmsg <<
"Inelastic instrument detector " << det->
getID() <<
" of spectrum " << workspace_index
52 <<
" does not have EFixed ";
53 throw std::runtime_error(errmsg.str());
56 std::stringstream errmsg;
57 errmsg <<
"Inelastic instrument detector " << det->
getID() <<
" of spectrum " << workspace_index
58 <<
" does not have EFixed ";
59 throw std::runtime_error(errmsg.str());
74 const double scale = std::abs(
m_L1s / L1m);
77 const double efix = this->
getEfixed(workspace_index);
79 const double shift = -1. *
l2 / sqrt(efix * TWO_MEV_OVER_MASS);
82 constexpr double NO_MULTIPLY_TOF{1.};
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.
Correction calculate(const size_t &workspace_index) const override
double getEfixed(const size_t &workspace_index) const
This will throw an exception if efixed is not found or negative.
const Geometry::ParameterMap & m_paramMap
const API::SpectrumInfo & m_spectrumInfo
const Kernel::V3D m_beamDir
TimeAtSampleStrategyIndirect(std::shared_ptr< const Mantid::API::MatrixWorkspace > ws)
Constructor.
Interface class for detector objects.
virtual detid_t getID() const =0
Get the detector ID.
std::shared_ptr< Parameter > getRecursive(const IComponent *comp, const std::string &name, const std::string &type="") const
Use get() recursively to see if can find param in all parents of comp and given type (std::string ver...
constexpr double scalar_prod(const V3D &v) const noexcept
Calculates the cross product.
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.
The Correction struct to be applied as factor * TOF + offset multiplicativeFactor: TOF correction fac...