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"
12
13#include <vector>
14
15namespace NeXus {
16class File;
17}
18
19namespace Mantid {
20
21namespace Kernel {
22template <class T> class Matrix;
23}
24
25namespace Geometry {
26class Goniometer;
27}
28
29namespace API {
30
38class MANTID_API_DLL Run : public LogManager {
39public:
40 Run();
41 Run(const Run &other);
43 Run &operator=(const Run &other);
44 bool operator==(const Run &other);
45 bool operator!=(const Run &other);
46
48 std::shared_ptr<Run> clone();
49
51 Run &operator+=(const Run &rhs);
52
54 void filterByTime(const Types::Core::DateAndTime start, const Types::Core::DateAndTime stop) override;
56 void splitByTime(Kernel::TimeSplitterType &splitter, std::vector<LogManager *> outputs) const override;
57
59 size_t getMemorySize() const override;
60
62 void setProtonCharge(const double charge);
64 double getProtonCharge() const;
67 void integrateProtonCharge(const std::string &logname = "proton_charge") const;
68
70 void storeHistogramBinBoundaries(const std::vector<double> &histoBins);
72 std::pair<double, double> histogramBinBoundaries(const double value) const;
74 std::vector<double> getBinBoundaries() const;
75
78 void setGoniometer(const Geometry::Goniometer &goniometer, const bool useLogValues);
80 void setGoniometers(const Geometry::Goniometer &goniometer);
82 const Geometry::Goniometer &getGoniometer() const;
83
85 Geometry::Goniometer &mutableGoniometer();
86
88 const Kernel::Matrix<double> &getGoniometerMatrix() const;
89
91 const Geometry::Goniometer &getGoniometer(const size_t index) const;
93 Geometry::Goniometer &mutableGoniometer(const size_t index);
95 size_t getNumGoniometers() const;
97 const Kernel::Matrix<double> &getGoniometerMatrix(const size_t index) const;
99 size_t addGoniometer(const Geometry::Goniometer &goniometer);
101 void clearGoniometers();
103 const std::vector<Kernel::Matrix<double>> getGoniometerMatrices() const;
104
106 void saveNexus(::NeXus::File *file, const std::string &group, bool keepOpen = false) const override;
107
118 void loadNexus(::NeXus::File *file, const std::string &group, const Mantid::Kernel::NexusHDF5Descriptor &fileInfo,
119 const std::string &prefix, bool keepOpen = false) override;
121 void loadNexus(::NeXus::File *file, const std::string &group, bool keepOpen = false) override;
122
123private:
125 void calculateAverageGoniometerMatrix();
127 void calculateGoniometerMatrices(const Geometry::Goniometer &goniometer);
128
130 std::vector<std::unique_ptr<Geometry::Goniometer>> m_goniometers;
132 std::vector<double> m_histoBins;
133
135 void mergeMergables(Mantid::Kernel::PropertyManager &sum, const Mantid::Kernel::PropertyManager &toAdd);
136 void copyGoniometers(const Run &other);
137
138 // Function common to loadNexus overloads populating relevant members
139 void loadNexusCommon(::NeXus::File *file, const std::string &nameClass);
140};
141} // namespace API
142} // 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
Definition: DeltaEMode.cpp:19
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:38
std::vector< std::unique_ptr< Geometry::Goniometer > > m_goniometers
Goniometer for this run.
Definition: Run.h:130
std::vector< double > m_histoBins
A set of histograms that can be stored here for future reference.
Definition: Run.h:132
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.
MatrixWorkspace_sptr MANTID_API_DLL operator+=(const MatrixWorkspace_sptr &lhs, const MatrixWorkspace_sptr &rhs)
Adds two workspaces.
std::vector< SplittingInterval > TimeSplitterType
A typedef for splitting events according their pulse time.
Definition: LogManager.h:31
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)