LoadILLIndirect2.h 2.78 KB
Newer Older
1
2
3
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2014 ISIS Rutherford Appleton Laboratory UKRI,
4
5
//   NScD Oak Ridge National Laboratory, European Spallation Source,
//   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
// SPDX - License - Identifier: GPL - 3.0 +
7
#pragma once
8
9
10

#include "MantidAPI/IFileLoader.h"
#include "MantidDataHandling/LoadHelper.h"
11
#include "MantidKernel/NexusDescriptor.h"
12
13
14
15
16
17
18
19
#include "MantidNexus/NexusClasses.h"

namespace Mantid {
namespace DataHandling {

/**
  Loads an ILL IN16B nexus file into a Mantid workspace.
*/
Samuel Jones's avatar
Samuel Jones committed
20
class DLLExport LoadILLIndirect2 : public API::IFileLoader<Kernel::NexusDescriptor> {
21
public:
22
  LoadILLIndirect2();
23
24
25
26
27
  /// Returns a confidence value that this algorithm can load a file
  int confidence(Kernel::NexusDescriptor &descriptor) const override;

  /// Algorithm's version for identification. @see Algorithm::version
  int version() const override { return 2; }
Samuel Jones's avatar
Samuel Jones committed
28
  const std::vector<std::string> seeAlso() const override { return {"LoadNexus"}; }
29
30
31

  const std::string name() const override;
  /// Summary of algorithms purpose
Samuel Jones's avatar
Samuel Jones committed
32
  const std::string summary() const override { return "Loads a ILL/IN16B nexus file."; }
33
34
35
36
37
38
39
  const std::string category() const override;

private:
  void init() override;
  void exec() override;

  void loadDataDetails(NeXus::NXEntry &entry);
40
  void initWorkSpace();
Samuel Jones's avatar
Samuel Jones committed
41
  void setInstrumentName(const NeXus::NXEntry &firstEntry, const std::string &instrumentNamePath);
Mathieu Tillet's avatar
Mathieu Tillet committed
42
  std::string getDataPath(NeXus::NXEntry &entry);
David Fairbrother's avatar
David Fairbrother committed
43
  void loadNexusEntriesIntoProperties(const std::string &nexusfilename);
44
  void loadDataIntoTheWorkSpace(NeXus::NXEntry &entry);
45
  void loadDiffractionData(NeXus::NXEntry &entry);
46
  void runLoadInstrument();
47
48
  void moveComponent(const std::string &, double);
  void moveSingleDetectors(NeXus::NXEntry &entry);
49
  void rotateTubes();
50
  std::string getInstrumentFilePath();
51
52
53
54
55
56

  API::MatrixWorkspace_sptr m_localWorkspace;

  std::string m_instrumentName; ///< Name of the instrument

  // Variables describing the data in the detector
57
58
59
60
  size_t m_numberOfTubes;           // number of tubes - X
  size_t m_numberOfPixelsPerTube;   // number of pixels per tube - Y
  size_t m_numberOfChannels;        // time channels - Z
  size_t m_numberOfSimpleDetectors; // number of simple detector
61
  size_t m_numberOfMonitors;        // number of monitors
62
63
  std::set<int> m_activeSDIndices;  // set of Single Detector indices,
                                    // that were actually active
64
  bool m_bats;                      // A flag marking the BATS mode
65
  size_t m_firstTubeAngleRounded;   // A flag holding the rounded angle of the first tube
66

67
  std::vector<std::string> m_supportedInstruments;
68
  LoadHelper m_loader;
69
  std::string m_loadOption;
70
71
72
73
};

} // namespace DataHandling
} // namespace Mantid