Mantid
Loading...
Searching...
No Matches
LoadTOFRawNexus.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
13#include "MantidAPI/Sample.h"
15#include "MantidDataHandling/DllConfig.h"
20
21#include <mutex>
22
23namespace Mantid {
24
25namespace DataHandling {
30class MANTID_DATAHANDLING_DLL LoadTOFRawNexus : public API::IFileLoader<Kernel::NexusDescriptor> {
31public:
34
36 const std::string name() const override { return "LoadTOFRawNexus"; }
37
39 const std::string summary() const override { return "Loads a NeXus file confirming to the TOFRaw format"; }
40
42 int version() const override { return 1; }
43 const std::vector<std::string> seeAlso() const override { return {"LoadNexus"}; }
44
46 const std::string category() const override { return "DataHandling\\Nexus"; }
47
48 static std::string getEntryName(const std::string &filename);
49
51 int confidence(Kernel::NexusDescriptor &descriptor) const override;
52
53 void countPixels(const std::string &nexusfilename, const std::string &entry_name,
54 std::vector<std::string> &bankNames);
55
58
61
62protected:
63 void init() override;
64 void exec() override;
65
68
71
74
75 void loadBank(const std::string &nexusfilename, const std::string &entry_name, const std::string &bankName,
76 const API::MatrixWorkspace_sptr &WS, const detid2index_map &id_to_wi);
77
79 std::vector<Types::Core::DateAndTime> pulseTimes;
80
82 size_t m_numBins;
83
85 specnum_t m_spec_min, m_spec_max;
86
88 std::string m_dataField;
89
91 std::string m_axisField;
92
94 std::string m_xUnits;
95
97 std::mutex m_fileMutex;
98
101};
102
103} // namespace DataHandling
104} // 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 a NeXus file that conforms to the TOFRaw instrument definition format and stores it in a 2D wor...
void runLoadInstrument(DataObjects::Workspace2D_sptr)
Run LoadInstrument as a ChildAlgorithm.
std::string m_dataField
Name of the 'data' field to load (depending on Signal)
int m_signalNo
Signal # to load. Default 1.
bool m_assumeOldFile
Flag for whether or not to assume the data is old SNS raw files;.
int version() const override
Algorithm's version for identification overriding a virtual method.
void loadSampleData(DataObjects::Workspace2D_sptr, Mantid::NeXus::NXEntry &entry)
Load in details about the sample.
std::mutex m_fileMutex
Mutex to avoid simultaneous file access.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
size_t m_numPixels
Number of pixels.
std::string m_axisField
Name of the 'axis' field to load (depending on Signal)
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
const std::string summary() const override
Summary of algorithms purpose.
std::string m_xUnits
Units of the X axis found.
void checkOptionalProperties()
Validate the optional input properties.
std::vector< Types::Core::DateAndTime > pulseTimes
List of the absolute time of each pulse.
Defines a wrapper around a file whose internal structure can be accessed using the NeXus API.
Implements NXentry Nexus class.
Definition: NexusClasses.h:898
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
Helper class which provides the Collimation Length for SANS instruments.
std::unordered_map< detid_t, size_t > detid2index_map
Map with key = detector ID, value = workspace index.
int32_t specnum_t
Typedef for a spectrum Number.
Definition: IDTypes.h:16