Mantid
Loading...
Searching...
No Matches
LoadMuonNexus.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 "MantidDataHandling/DllConfig.h"
16
17//----------------------------------------------------------------------
18// Forward declaration
19//----------------------------------------------------------------------
20class MuonNexusReader;
21
22namespace Mantid {
23namespace DataHandling {
50class MANTID_DATAHANDLING_DLL LoadMuonNexus : public API::IFileLoader<Kernel::NexusDescriptor> {
51public:
55 const std::string name() const override { return "LoadMuonNexus"; }
57 const std::string summary() const override {
58 return "The LoadMuonNexus algorithm will read the given NeXus Muon data "
59 "file Version 1 and use the results to populate the named "
60 "workspace. LoadMuonNexus may be invoked by LoadNexus if it is "
61 "given a NeXus file of this type.";
62 }
63
65 int version() const override { return 1; }
67 const std::string category() const override { return "DataHandling\\Nexus;Muon\\DataHandling"; }
68
70 int confidence(Kernel::NexusDescriptor &descriptor) const override;
71
72protected:
74 void checkOptionalProperties();
75 void runLoadInstrument(const DataObjects::Workspace2D_sptr &);
77 void addToSampleLog(const std::string &logName, const int logNumber, DataObjects::Workspace2D_sptr &ws);
78 void addToSampleLog(const std::string &logName, const std::string &log, DataObjects::Workspace2D_sptr &ws);
79
81 std::string m_filename;
83 std::string m_entry_name;
85 std::string m_instrument_name;
87 std::string m_samplename;
95 bool m_list;
99 std::vector<specnum_t> m_spec_list;
105 std::vector<detid_t> m_groupings;
106
107private:
109 void init() override;
110};
111
112} // namespace DataHandling
113} // 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
It is a base class for loaders for versions 1 and 2 of the muon nexus file format.
Definition: LoadMuonNexus.h:50
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: LoadMuonNexus.h:67
std::string m_filename
The name and path of the input file.
Definition: LoadMuonNexus.h:81
specnum_t m_spec_min
The value of the spectrum_min property.
const std::string summary() const override
Summary of algorithms purpose.
Definition: LoadMuonNexus.h:57
std::string m_entry_name
The first top-level entry name in the file.
Definition: LoadMuonNexus.h:83
std::string m_instrument_name
The instrument name from Nexus.
Definition: LoadMuonNexus.h:85
int64_t m_numberOfPeriods
The number of periods in the raw file.
Definition: LoadMuonNexus.h:93
bool m_interval
Have the spectrum_min/max properties been set?
Definition: LoadMuonNexus.h:97
virtual void runLoadInstrumentFromNexus(DataObjects::Workspace2D_sptr)
Definition: LoadMuonNexus.h:73
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: LoadMuonNexus.h:65
bool m_list
Has the spectrum_list property been set?
Definition: LoadMuonNexus.h:95
specnum_t m_spec_max
The value of the spectrum_max property.
std::string m_samplename
The sample name read from Nexus.
Definition: LoadMuonNexus.h:87
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: LoadMuonNexus.h:55
std::vector< specnum_t > m_spec_list
The value of the spectrum_list property.
Definition: LoadMuonNexus.h:99
int64_t m_entrynumber
The number of the input entry.
Definition: LoadMuonNexus.h:89
std::vector< detid_t > m_groupings
The group which each detector belongs to in order.
specnum_t m_numberOfSpectra
The number of spectra in the raw file.
Definition: LoadMuonNexus.h:91
Defines a wrapper around a file whose internal structure can be accessed using the NeXus API.
MuunNexusReader opens a Nexus file and reads certain fields expected for a ISIS Muon data file (old f...
std::shared_ptr< Algorithm > Algorithm_sptr
Typedef for a shared pointer to an Algorithm.
Definition: Algorithm.h:61
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
Helper class which provides the Collimation Length for SANS instruments.
int32_t specnum_t
Typedef for a spectrum Number.
Definition: IDTypes.h:16