Mantid
Loading...
Searching...
No Matches
Run.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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 "MantidAPI/DllConfig.h"
13
14#include <span>
15#include <vector>
16
17namespace Mantid {
18
19namespace Kernel {
20template <class T> class Matrix;
21}
22
23namespace Geometry {
24class Goniometer;
25}
26
27namespace API {
28
36class MANTID_API_DLL Run : public LogManager {
37public:
38 Run();
39 Run(const Run &other);
40 ~Run() override;
41 Run &operator=(const Run &other);
42 bool operator==(const Run &other);
43 bool operator!=(const Run &other);
44
46 std::shared_ptr<Run> clone();
47
49 Run &operator+=(const Run &rhs);
50
52 void filterByTime(const Types::Core::DateAndTime start, const Types::Core::DateAndTime stop) override;
53 void setTimeROI(const Kernel::TimeROI &timeroi) override;
54
56 size_t getMemorySize() const override;
57
59 void setProtonCharge(const double charge);
61 double getProtonCharge() const;
64 void integrateProtonCharge(const std::string &logname = "proton_charge") const;
66 std::tuple<double, double, double> getBadPulseRange(const std::string &logname = "proton_charge",
67 const double &cutoff = 95.) const;
68
70 void setDuration();
71
74 void storeHistogramBinBoundaries(std::span<double const> histoBins);
76 std::pair<double, double> histogramBinBoundaries(const double value) const;
78 std::vector<double> getBinBoundaries() const;
79
82 void setGoniometer(const Geometry::Goniometer &goniometer, const bool useLogValues);
84 void setGoniometers(const Geometry::Goniometer &goniometer);
86 const Geometry::Goniometer &getGoniometer() const;
87
89 Geometry::Goniometer &mutableGoniometer();
90
92 const Kernel::Matrix<double> &getGoniometerMatrix() const;
93
95 const Geometry::Goniometer &getGoniometer(const size_t index) const;
97 Geometry::Goniometer &mutableGoniometer(const size_t index);
99 size_t getNumGoniometers() const;
101 const Kernel::Matrix<double> &getGoniometerMatrix(const size_t index) const;
103 size_t addGoniometer(const Geometry::Goniometer &goniometer);
105 void clearGoniometers();
107 const std::vector<Kernel::Matrix<double>> getGoniometerMatrices() const;
108
110 void saveNexus(Nexus::File *file, const std::string &group, bool keepOpen = false) const override;
111
114 void loadNexus(Nexus::File *file, const std::string &group, const std::string &prefix,
115 bool keepOpen = false) override;
117 void loadNexus(Nexus::File *file, const std::string &group, bool keepOpen = false) override;
118
119private:
121 void calculateAverageGoniometerMatrix();
123 void calculateGoniometerMatrices(const Geometry::Goniometer &goniometer);
124
126 std::vector<std::unique_ptr<Geometry::Goniometer>> m_goniometers;
128 std::vector<double> m_histoBins;
129
131 void mergeMergables(Mantid::Kernel::PropertyManager &sum, const Mantid::Kernel::PropertyManager &toAdd);
132 void copyGoniometers(const Run &other);
133
134 // Function common to loadNexus overloads populating relevant members
135 void loadNexusCommon(Nexus::File *file, const std::string &nameClass);
136};
137} // namespace API
138} // namespace Mantid
const std::vector< double > & rhs
double value
The value of the point.
Definition FitMW.cpp:51
std::map< DeltaEMode::Type, std::string > index
This class contains the information about the log entries.
Definition LogManager.h:43
This class stores information regarding an experimental run as a series of log entries.
Definition Run.h:36
std::vector< std::unique_ptr< Geometry::Goniometer > > m_goniometers
Goniometer for this run.
Definition Run.h:126
~Run() override
std::vector< double > m_histoBins
A set of histograms that can be stored here for future reference.
Definition Run.h:128
Class to represent a particular goniometer setting, which is described by the rotation matrix.
Definition Goniometer.h:55
Numerical Matrix class.
Definition Matrix.h:42
Property manager helper class.
TimeROI : Object that holds information about when the time measurement was active.
Definition TimeROI.h:18
MatrixWorkspace_sptr MANTID_API_DLL operator+=(const MatrixWorkspace_sptr &lhs, const MatrixWorkspace_sptr &rhs)
Adds two workspaces.
Helper class which provides the Collimation Length for SANS instruments.
constexpr bool operator==(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)
constexpr bool operator!=(const wide_integer< Bits, Signed > &lhs, const wide_integer< Bits2, Signed2 > &rhs)