FileBackedExperimentInfo.h 3.56 KB
Newer Older
1
2
#ifndef MANTID_API_FILEBACKEDEXPERIMENTINFO_H_
#define MANTID_API_FILEBACKEDEXPERIMENTINFO_H_
3
4
5
//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
Gigg, Martyn Anthony's avatar
Gigg, Martyn Anthony committed
6
#include "MantidAPI/DllConfig.h"
7
8
#include "MantidAPI/ExperimentInfo.h"

Gigg, Martyn Anthony's avatar
Gigg, Martyn Anthony committed
9
10
namespace Mantid {
namespace API {
11

Gigg, Martyn Anthony's avatar
Gigg, Martyn Anthony committed
12
13
14
/**
    Implements a lazy-loading mechanism for the experimental information
    stored in a NeXus file.
15

Gigg, Martyn Anthony's avatar
Gigg, Martyn Anthony committed
16
17
    Copyright © 2015 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
   National Laboratory & European Spallation Source
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

    This file is part of Mantid.

    Mantid is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    Mantid is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

    File change history is stored at: <https://github.com/mantidproject/mantid>
    Code Documentation is available at: <http://doxygen.mantidproject.org>
  */
37
class MANTID_API_DLL FileBackedExperimentInfo : public ExperimentInfo {
Gigg, Martyn Anthony's avatar
Gigg, Martyn Anthony committed
38
39
public:
  /// Constructor
40
  FileBackedExperimentInfo(const std::string &filename,
41
                           const std::string &nxpath);
42

43
  ExperimentInfo *cloneExperimentInfo() const override;
44

45
  const std::string toString() const override;
46

47
  Geometry::Instrument_const_sptr getInstrument() const override;
48

49
  const Geometry::ParameterMap &instrumentParameters() const override;
50

51
  Geometry::ParameterMap &instrumentParameters() override;
52

53
  const Geometry::ParameterMap &constInstrumentParameters() const override;
54

55
  void populateInstrumentParameters() override;
56

57
  void replaceInstrumentParameters(const Geometry::ParameterMap &pmap) override;
58

59
  void swapInstrumentParameters(Geometry::ParameterMap &pmap) override;
60

61
  void cacheDetectorGroupings(const det2group_map &mapping) override;
62

63
64
  const std::vector<detid_t> &
  getGroupMembers(const detid_t detID) const override;
65

66
67
  Geometry::IDetector_const_sptr
  getDetectorByID(const detid_t detID) const override;
68

69
  void setModeratorModel(ModeratorModel *source) override;
70

71
  ModeratorModel &moderatorModel() const override;
72

73
  void setChopperModel(ChopperModel *chopper, const size_t index = 0) override;
74

75
  ChopperModel &chopperModel(const size_t index = 0) const override;
76

77
  const Sample &sample() const override;
78

79
  Sample &mutableSample() override;
80

81
  const Run &run() const override;
82

83
  Run &mutableRun() override;
84

85
  Kernel::Property *getLog(const std::string &log) const override;
86

87
  double getLogAsSingleValue(const std::string &log) const override;
88

89
  int getRunNumber() const override;
90

91
  Kernel::DeltaEMode::Type getEMode() const override;
92

93
  double getEFixed(const detid_t detID) const override;
94
95

  double getEFixed(const Geometry::IDetector_const_sptr detector =
96
                       Geometry::IDetector_const_sptr()) const override;
97

98
  void setEFixed(const detid_t detID, const double value) override;
99

Gigg, Martyn Anthony's avatar
Gigg, Martyn Anthony committed
100
private:
101
  void populateIfNotLoaded() const;
102
  void populateFromFile() const;
103

104
  mutable bool m_loaded;
105
106
  std::string m_filename;
  std::string m_nxpath;
Gigg, Martyn Anthony's avatar
Gigg, Martyn Anthony committed
107
};
108
109
110
111

} // namespace API
} // namespace Mantid

Gigg, Martyn Anthony's avatar
Gigg, Martyn Anthony committed
112
#endif /* MANTID_API_FILEBACKEDEXPERIMENTINFO_H_ */