Mantid
Loading...
Searching...
No Matches
FakeMD.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2015 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9#include <vector>
10
12#include "MantidDataObjects/DllConfig.h"
15
16namespace Mantid {
17namespace DataObjects {
18
19template <typename MDE, size_t nd> class MDEventWorkspace;
20
24class MANTID_DATAOBJECTS_DLL FakeMD {
25public:
26 FakeMD(const std::vector<double> &uniformParams, const std::vector<double> &peakParams,
27 const std::vector<double> &ellipsoidParams, const int randomSeed, const bool randomizeSignal);
28
29 void fill(const API::IMDEventWorkspace_sptr &workspace);
30
31private:
32 void setupDetectorCache(const API::IMDEventWorkspace &workspace);
33
34 template <typename MDE, size_t nd> void addFakePeak(typename MDEventWorkspace<MDE, nd>::sptr ws);
35 template <typename MDE, size_t nd> void addFakeEllipsoid(typename MDEventWorkspace<MDE, nd>::sptr ws);
36 template <typename MDE, size_t nd> void addFakeUniformData(typename MDEventWorkspace<MDE, nd>::sptr ws);
37
38 template <typename MDE, size_t nd>
39 void addFakeRandomData(const std::vector<double> &params, typename MDEventWorkspace<MDE, nd>::sptr ws);
40 template <typename MDE, size_t nd>
41 void addFakeRegularData(const std::vector<double> &params, typename MDEventWorkspace<MDE, nd>::sptr ws);
42
43 detid_t pickDetectorID();
44
45 //------------------ Member variables ------------------------------------
46 std::vector<double> m_uniformParams;
47 std::vector<double> m_peakParams;
48 std::vector<double> m_ellipsoidParams;
49 const int m_randomSeed;
51 mutable std::vector<detid_t> m_detIDs;
52 std::mt19937 m_randGen;
54};
55
56} // namespace DataObjects
57} // namespace Mantid
IPeaksWorkspace_sptr workspace
Abstract base class for multi-dimension event workspaces (MDEventWorkspace).
Provides a helper class to add fake data to an MD workspace.
Definition FakeMD.h:24
std::mt19937 m_randGen
Definition FakeMD.h:52
std::vector< detid_t > m_detIDs
Definition FakeMD.h:51
const bool m_randomizeSignal
Definition FakeMD.h:50
Kernel::uniform_int_distribution< size_t > m_uniformDist
Definition FakeMD.h:53
std::vector< double > m_peakParams
Definition FakeMD.h:47
std::vector< double > m_ellipsoidParams
Definition FakeMD.h:48
std::vector< double > m_uniformParams
Definition FakeMD.h:46
std::shared_ptr< MDEventWorkspace< MDE, nd > > sptr
Typedef for a shared pointer of this kind of event workspace.
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
Helper class which provides the Collimation Length for SANS instruments.
int32_t detid_t
Typedef for a detector ID.