Mantid
Loading...
Searching...
No Matches
LoadILLTOF2.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2019 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 {
15// forward declares
16namespace LegacyNexus {
17class NXEntry;
18}
19namespace DataHandling {
23class MANTID_DATAHANDLING_DLL LoadILLTOF2 : public API::IFileLoader<Kernel::LegacyNexusDescriptor> {
24public:
28 const std::string name() const override { return "LoadILLTOF"; }
30 const std::string summary() const override { return "Loads an ILL TOF NeXus file."; }
31
33 int version() const override { return 2; }
34 const std::vector<std::string> seeAlso() const override { return {"LoadNexus"}; }
36 const std::string category() const override { return "DataHandling\\Nexus;ILL\\Direct"; }
37
39 int confidence(Kernel::LegacyNexusDescriptor &descriptor) const override;
40
41private:
42 // Initialisation code
43 void init() override;
44 // Execution code
45 void exec() override;
46
47 void addAllNexusFieldsAsProperties(const std::string &filename);
48 void addEnergyToRun();
49 void addFacility();
50 void addPulseInterval();
51
52 void fillStaticWorkspace(const LegacyNexus::NXEntry &entry, const std::vector<std::string> &monitorList,
53 bool convertToTOF);
54 void fillScanWorkspace(const LegacyNexus::NXEntry &entry, const std::vector<std::string> &monitorList);
55
56 std::vector<std::string> getMonitorInfo(const LegacyNexus::NXEntry &firstEntry);
57 void initWorkspace(const LegacyNexus::NXEntry &entry);
58
59 void loadInstrumentDetails(const LegacyNexus::NXEntry &);
60 void loadTimeDetails(const LegacyNexus::NXEntry &entry);
61
62 std::vector<double> prepareAxis(const LegacyNexus::NXEntry &entry, bool convertToTOF);
63
65
66 std::string m_instrumentName;
67 std::string m_instrumentAddress;
68
69 // Variables describing the data in the detector
70 size_t m_numberOfTubes; // number of tubes - X
71 size_t m_numberOfPixelsPerTube; // number of pixels per tube - Y
72 size_t m_numberOfChannels; // time channels - Z
73 size_t m_numberOfHistograms; // number of histograms (individual detectors)
74 size_t m_numberOfMonitors; // number of monitors
75
76 // Values parsed from the nexus file
80 std::string m_monitorName;
81 bool m_isScan; // whether the loaded data is a scan measurement
82};
83
84} // namespace DataHandling
85} // 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
Loads an ILL IN4/5/6/Panther NeXus file into a Mantid workspace.
Definition LoadILLTOF2.h:23
API::MatrixWorkspace_sptr m_localWorkspace
Definition LoadILLTOF2.h:64
std::string m_instrumentAddress
Name of the instrument address.
Definition LoadILLTOF2.h:67
const std::string category() const override
Algorithm's category for identification.
Definition LoadILLTOF2.h:36
const std::string name() const override
Algorithm's name.
Definition LoadILLTOF2.h:28
std::string m_instrumentName
Name of the instrument.
Definition LoadILLTOF2.h:66
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 LoadILLTOF2.h:34
const std::string summary() const override
Summary of algorithms purpose.
Definition LoadILLTOF2.h:30
int version() const override
Algorithm's version.
Definition LoadILLTOF2.h:33
Defines a wrapper around a file whose internal structure can be accessed using the NeXus API.
Implements NXentry Nexus class.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.