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"
14
15namespace Mantid {
16namespace DataHandling {
20class MANTID_DATAHANDLING_DLL LoadILLTOF2 : public API::IFileLoader<Kernel::NexusDescriptor> {
21public:
25 const std::string name() const override { return "LoadILLTOF"; }
27 const std::string summary() const override { return "Loads an ILL TOF NeXus file."; }
28
30 int version() const override { return 2; }
31 const std::vector<std::string> seeAlso() const override { return {"LoadNexus"}; }
33 const std::string category() const override { return "DataHandling\\Nexus;ILL\\Direct"; }
34
36 int confidence(Kernel::NexusDescriptor &descriptor) const override;
37
38private:
39 // Initialisation code
40 void init() override;
41 // Execution code
42 void exec() override;
43
44 void loadInstrumentDetails(const NeXus::NXEntry &);
45 std::vector<std::vector<int>> getMonitorInfo(const NeXus::NXEntry &firstEntry);
46 void initWorkSpace(NeXus::NXEntry &entry, const std::vector<std::vector<int>> &);
48 void addAllNexusFieldsAsProperties(const std::string &filename);
49 void addEnergyToRun();
50 void addFacility();
51 void addPulseInterval();
52
53 void loadTimeDetails(const NeXus::NXEntry &entry);
54 void loadDataIntoTheWorkSpace(NeXus::NXEntry &entry, const std::vector<std::vector<int>> &, bool convertToTOF);
55 void loadSpectra(size_t &spec, const size_t numberOfTubes, const std::vector<Mantid::detid_t> &detectorIDs,
56 const NeXus::NXInt &data, Mantid::API::Progress &progress);
57
58 void runLoadInstrument();
59
61 static double calculateError(double in) { return sqrt(in); }
62
64
65 std::string m_instrumentName;
66 std::string m_instrumentPath;
67
68 // Variables describing the data in the detector
69 size_t m_numberOfTubes; // number of tubes - X
70 size_t m_numberOfPixelsPerTube; // number of pixels per tube - Y
71 size_t m_numberOfChannels; // time channels - Z
73
74 /* Values parsed from the nexus file */
78 std::string m_monitorName;
79};
80
81} // namespace DataHandling
82} // 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
Helper class for reporting progress from algorithms.
Definition: Progress.h:25
Loads an ILL IN4/5/6/Panther NeXus file into a Mantid workspace.
Definition: LoadILLTOF2.h:20
API::MatrixWorkspace_sptr m_localWorkspace
Definition: LoadILLTOF2.h:63
const std::string category() const override
Algorithm's category for identification.
Definition: LoadILLTOF2.h:33
std::string m_instrumentPath
Name of the instrument path.
Definition: LoadILLTOF2.h:66
const std::string name() const override
Algorithm's name.
Definition: LoadILLTOF2.h:25
static double calculateError(double in)
Calculate error for y.
Definition: LoadILLTOF2.h:61
std::string m_instrumentName
Name of the instrument.
Definition: LoadILLTOF2.h:65
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:31
const std::string summary() const override
Summary of algorithms purpose.
Definition: LoadILLTOF2.h:27
int version() const override
Algorithm's version.
Definition: LoadILLTOF2.h:30
Defines a wrapper around a file whose internal structure can be accessed using the NeXus API.
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.