Mantid
Loading...
Searching...
No Matches
LoadILLSANS.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2013 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
10#include "MantidDataHandling/DllConfig.h"
13
14namespace Mantid {
15namespace DataHandling {
16
20class MANTID_DATAHANDLING_DLL LoadILLSANS : public API::IFileLoader<Kernel::NexusDescriptor> {
21public:
23 const std::string name() const override;
24 const std::string summary() const override;
25 int version() const override;
26 const std::vector<std::string> seeAlso() const override { return {"LoadNexus"}; }
27 const std::string category() const override;
29 int confidence(Kernel::NexusDescriptor &descriptor) const override;
30
31private:
32 enum MultichannelType { TOF, KINETIC, SCAN };
37 double shiftLeft;
38 double shiftRight;
39 double shiftUp;
40 double shiftDown;
41 void operator>>(std::ostream &strm) {
42 strm << "DetectorPosition : "
43 << "distanceSampleRear = " << distanceSampleRear << ", "
44 << "distanceSampleBottomTop = " << distanceSampleBottomTop << ", "
45 << "distanceSampleRightLeft = " << distanceSampleRightLeft << ", "
46 << "shiftLeft = " << shiftLeft << ", "
47 << "shiftRight = " << shiftRight << ", "
48 << "shiftUp = " << shiftUp << ", "
49 << "shiftDown = " << shiftDown << '\n';
50 }
51 };
52
53 void init() override;
54 void exec() override;
55 void setInstrumentName(const NeXus::NXEntry &, const std::string &);
56 DetectorPosition getDetectorPositionD33(const NeXus::NXEntry &, const std::string &);
57 void setNumberOfMonitors();
58
59 void initWorkSpace(NeXus::NXEntry &, const std::string &);
60 void initWorkSpaceD11B(NeXus::NXEntry &, const std::string &);
61 void initWorkSpaceD22B(NeXus::NXEntry &, const std::string &);
62 void initWorkSpaceD33(NeXus::NXEntry &, const std::string &);
63 void initWorkSpaceD16(NeXus::NXEntry &, const std::string &);
64 void createEmptyWorkspace(const size_t, const size_t, const MultichannelType type = MultichannelType::TOF);
65 void getDataDimensions(const NeXus::NXInt &data, int &numberOfChannels, int &numberOfTubes,
66 int &numberOfPixelsPerTube);
67 size_t loadDataFromMonitors(NeXus::NXEntry &firstEntry, size_t firstIndex = 0,
68 const MultichannelType type = MultichannelType::TOF);
69 size_t loadDataFromD16ScanMonitors(const NeXus::NXEntry &firstEntry, size_t firstIndex,
70 const std::vector<double> &binning);
71 size_t loadDataFromTubes(NeXus::NXInt &, const std::vector<double> &, size_t,
72 const MultichannelType type = MultichannelType::TOF);
73 void runLoadInstrument();
74 void moveDetectorsD33(const DetectorPosition &);
75 void moveDetectorDistance(double distance, const std::string &componentName);
76 void moveDetectorHorizontal(double, const std::string &);
77 void moveDetectorVertical(double, const std::string &);
78 Kernel::V3D getComponentPosition(const std::string &componentName);
79 void loadMetaData(const NeXus::NXEntry &, const std::string &);
80 std::string getInstrumentFilePath(const std::string &) const;
81 void rotateInstrument(double, const std::string &);
82 void placeD16(double, double, const std::string &);
83 void adjustTOF();
84 void moveSource();
85
86 std::string m_instrumentName;
87 std::vector<std::string> m_supportedInstruments;
89 std::vector<double> m_defaultBinning;
90 std::string m_resMode;
91 bool m_isTOF;
92 double m_sourcePos;
95
96 void setFinalProperties(const std::string &filename);
97 std::vector<double> getVariableTimeBinning(const NeXus::NXEntry &, const std::string &, const NeXus::NXInt &,
98 const NeXus::NXFloat &) const;
99 std::vector<double> getOmegaBinning(const NeXus::NXEntry &entry, const std::string &path) const;
100};
101
102} // namespace DataHandling
103} // namespace Mantid
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
Definition: IFileLoader.h:19
LoadILLSANS; supports D11, D22 and D33 (TOF/monochromatic)
Definition: LoadILLSANS.h:20
void initWorkSpaceD16(NeXus::NXEntry &, const std::string &)
bool m_isTOF
TOF or monochromatic flag.
Definition: LoadILLSANS.h:91
double m_sourcePos
Source Z (for D33 TOF)
Definition: LoadILLSANS.h:92
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: LoadILLSANS.h:26
size_t m_numberOfMonitors
Number of monitors in this instrument.
Definition: LoadILLSANS.h:94
std::vector< double > m_defaultBinning
the default x-axis binning
Definition: LoadILLSANS.h:89
std::vector< std::string > m_supportedInstruments
List of supported instruments.
Definition: LoadILLSANS.h:87
API::MatrixWorkspace_sptr m_localWorkspace
to-be output workspace
Definition: LoadILLSANS.h:88
bool m_isD16Omega
Data comes from a D16 omega scan flag.
Definition: LoadILLSANS.h:93
std::string m_instrumentName
Name of the instrument.
Definition: LoadILLSANS.h:86
std::string m_resMode
Resolution mode for D11 and D22.
Definition: LoadILLSANS.h:90
Defines a wrapper around a file whose internal structure can be accessed using the NeXus API.
Class for 3D vectors.
Definition: V3D.h:34
Templated class implementation of NXDataSet.
Definition: NexusClasses.h:203
Implements NXentry Nexus class.
Definition: NexusClasses.h:898
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.