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 <vector>
15
16namespace Mantid {
17
18namespace Kernel {
19template <class T> class Matrix;
20}
21
22namespace Geometry {
23class Goniometer;
24}
25
26namespace API {
27
35class MANTID_API_DLL Run : public LogManager {
36public:
37 Run();
38 Run(const Run &other);
40 Run &operator=(const Run &other);
41 bool operator==(const Run &other);
42 bool operator!=(const Run &other);
43
45 std::shared_ptr<Run> clone();
46
48 Run &operator+=(const Run &rhs);
49
51 void filterByTime(const Types::Core::DateAndTime start, const Types::Core::DateAndTime stop) override;
52 void setTimeROI(const Kernel::TimeROI &timeroi) override;
53
55 size_t getMemorySize() const override;
56
58 void setProtonCharge(const double charge);
60 double getProtonCharge() const;
63 void integrateProtonCharge(const std::string &logname = "proton_charge") const;
65 std::tuple<double, double, double> getBadPulseRange(const std::string &logname = "proton_charge",
66 const double &cutoff = 95.) const;
67
69 void setDuration();
70
72 void storeHistogramBinBoundaries(const std::vector<double> &histoBins);
74 std::pair<double, double> histogramBinBoundaries(const double value) const;
76 std::vector<double> getBinBoundaries() const;
77
80 void setGoniometer(const Geometry::Goniometer &goniometer, const bool useLogValues);
82 void setGoniometers(const Geometry::Goniometer &goniometer);
84 const Geometry::Goniometer &getGoniometer() const;
85
87 Geometry::Goniometer &mutableGoniometer();
88
90 const Kernel::Matrix<double> &getGoniometerMatrix() const;
91
93 const Geometry::Goniometer &getGoniometer(const size_t index) const;
95 Geometry::Goniometer &mutableGoniometer(const size_t index);
97 size_t getNumGoniometers() const;
99 const Kernel::Matrix<double> &getGoniometerMatrix(const size_t index) const;
101 size_t addGoniometer(const Geometry::Goniometer &goniometer);
103 void clearGoniometers();
105 const std::vector<Kernel::Matrix<double>> getGoniometerMatrices() const;
106
108 void saveNexus(Nexus::File *file, const std::string &group, bool keepOpen = false) const override;
109
112 void loadNexus(Nexus::File *file, const std::string &group, const Mantid::Nexus::NexusDescriptor &fileInfo,
113 const std::string &prefix, bool keepOpen = false) override;
115 void loadNexus(Nexus::File *file, const std::string &group, bool keepOpen = false) override;
116
117private:
119 void calculateAverageGoniometerMatrix();
121 void calculateGoniometerMatrices(const Geometry::Goniometer &goniometer);
122
124 std::vector<std::unique_ptr<Geometry::Goniometer>> m_goniometers;
126 std::vector<double> m_histoBins;
127
129 void mergeMergables(Mantid::Kernel::PropertyManager &sum, const Mantid::Kernel::PropertyManager &toAdd);
130 void copyGoniometers(const Run &other);
131
132 // Function common to loadNexus overloads populating relevant members
133 void loadNexusCommon(Nexus::File *file, const std::string &nameClass);
134};
135} // namespace API
136} // 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:44
This class stores information regarding an experimental run as a series of log entries.
Definition Run.h:35
std::vector< std::unique_ptr< Geometry::Goniometer > > m_goniometers
Goniometer for this run.
Definition Run.h:124
std::vector< double > m_histoBins
A set of histograms that can be stored here for future reference.
Definition Run.h:126
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)