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
22class MANTID_DATAOBJECTS_DLL FakeMD {
23public:
24 FakeMD(const std::vector<double> &uniformParams, const std::vector<double> &peakParams,
25 const std::vector<double> &ellipsoidParams, const int randomSeed, const bool randomizeSignal);
26
27 void fill(const API::IMDEventWorkspace_sptr &workspace);
28
29private:
30 void setupDetectorCache(const API::IMDEventWorkspace &workspace);
31
32 template <typename MDE, size_t nd> void addFakePeak(typename MDEventWorkspace<MDE, nd>::sptr ws);
33 template <typename MDE, size_t nd> void addFakeEllipsoid(typename MDEventWorkspace<MDE, nd>::sptr ws);
34 template <typename MDE, size_t nd> void addFakeUniformData(typename MDEventWorkspace<MDE, nd>::sptr ws);
35
36 template <typename MDE, size_t nd>
37 void addFakeRandomData(const std::vector<double> &params, typename MDEventWorkspace<MDE, nd>::sptr ws);
38 template <typename MDE, size_t nd>
39 void addFakeRegularData(const std::vector<double> &params, typename MDEventWorkspace<MDE, nd>::sptr ws);
40
41 detid_t pickDetectorID();
42
43 //------------------ Member variables ------------------------------------
44 std::vector<double> m_uniformParams;
45 std::vector<double> m_peakParams;
46 std::vector<double> m_ellipsoidParams;
47 const int m_randomSeed;
49 mutable std::vector<detid_t> m_detIDs;
50 std::mt19937 m_randGen;
52};
53
54} // namespace DataObjects
55} // namespace Mantid
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
Abstract base class for multi-dimension event workspaces (MDEventWorkspace).
Provides a helper class to add fake data to an MD workspace.
Definition: FakeMD.h:22
std::mt19937 m_randGen
Definition: FakeMD.h:50
std::vector< detid_t > m_detIDs
Definition: FakeMD.h:49
const bool m_randomizeSignal
Definition: FakeMD.h:48
Kernel::uniform_int_distribution< size_t > m_uniformDist
Definition: FakeMD.h:51
std::vector< double > m_peakParams
Definition: FakeMD.h:45
std::vector< double > m_ellipsoidParams
Definition: FakeMD.h:46
std::vector< double > m_uniformParams
Definition: FakeMD.h:44
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.
Definition: SpectrumInfo.h:21