20namespace SingleCrystalDiffractionTestHelper {
42 const std::tuple<double, double, double> &sigmas);
44 std::tuple<Mantid::API::MatrixWorkspace_sptr, Mantid::DataObjects::PeaksWorkspace_sptr>
build();
47 using HKLPeakDescriptor = std::tuple<Mantid::Kernel::V3D, int, std::tuple<double, double, double>>;
void rebinWorkspace()
Rebin the event workspace to a histogram workspace.
void outputAsHistogram(const bool outputAsHistogram)
Set whether to create an event workspace or a histogram workspace.
Mantid::API::MatrixWorkspace_sptr m_workspace
Handle to the final output workspace (event OR histogram)
std::tuple< Mantid::API::MatrixWorkspace_sptr, Mantid::DataObjects::PeaksWorkspace_sptr > build()
Make a tuple of event workspace and peaks workspace.
std::tuple< int, double, double > m_backgroundParameters
background parameters
std::unique_ptr< Mantid::Kernel::NearestNeighbours< 3 > > m_detectorSearcher
Nearest neighbour search tree for detectors.
void createBackground(const int peakIndex)
Create a flat background for the workspace.
void addBackground(const bool useBackground)
void createEventWorkspace()
Create an empty event workspace with the instrument attached.
bool m_outputAsHistogram
whether to output event or histogram data
int m_numPixels
number of pixels along a single axis on the detector bank
void addPeakByHKL(const Mantid::Kernel::V3D &hkl, const int numEvents, const std::tuple< double, double, double > &sigmas)
Add a HKL peak to the diffraction dataset.
std::mt19937 m_generator
Random generator for making events.
void setBackgroundParameters(const int nEvents, const double detRange, const double tofRange)
Set the parameters for the uniform background.
Mantid::DataObjects::PeaksWorkspace_sptr m_peaksWorkspace
Handle to the peaks workspace.
void createNeighbourSearch()
Create a neighbour search tree for finding nearest neighbours.
std::vector< double > m_rebinParams
rebin parameters
std::vector< HKLPeakDescriptor > m_peakDescriptors
List of peak descriptors for creating peaks.
Mantid::DataObjects::EventWorkspace_sptr m_eventWorkspace
Handle to the event workspace.
std::tuple< Mantid::Kernel::V3D, int, std::tuple< double, double, double > > HKLPeakDescriptor
void createPeaks()
Create peaks at the requested HKL positions.
void setNumPixels(const int numPixels)
Set the total number of peaks to use.
void setRandomSeed(const int seed)
Set the random seed for generating events.
bool m_useBackground
whether to add a background
void createPeaksWorkspace()
Create a peaks workspace with the request HKL peaks.
void createPeak(const HKLPeakDescriptor &descriptor)
Create a single HKL peak in the event workspace.
Mantid::Geometry::Instrument_sptr m_instrument
Handle to the instrument object.
void setRebinParameters(const std::vector< double > &rebinParams)
Set the rebin parameters to use.
int m_totalNPixels
total number of pixels in the detector bank
void createInstrument()
Create a dummy instrument.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::size_t numEvents(::NeXus::File &file, bool &hasTotalCounts, bool &oldNeXusFileNames, const std::string &prefix, const NexusHDF5Descriptor &descriptor)
Get the number of events in the currently opened group.
std::shared_ptr< PeaksWorkspace > PeaksWorkspace_sptr
Typedef for a shared pointer to a peaks workspace.
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
std::shared_ptr< Instrument > Instrument_sptr
Shared pointer to an instrument object.
Helper class which provides the Collimation Length for SANS instruments.