Mantid
Loading...
Searching...
No Matches
LoadMuonNexusV2.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2020 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
14
15namespace Mantid {
16namespace DataHandling {
39class MANTID_DATAHANDLING_DLL LoadMuonNexusV2 : public API::NexusFileLoader {
40public:
41 // Default constructor
44 const std::string name() const override { return "LoadMuonNexusV2"; }
46 const std::string summary() const override {
47 return "The LoadMuonNexus algorithm will read the given NeXus Muon data "
48 "file Version 2 and use the results to populate the named "
49 "workspace. LoadMuonNexus may be invoked by Load if it is "
50 "given a NeXus file of this type.";
51 }
53 int confidence(Kernel::NexusHDF5Descriptor &descriptor) const override;
54 // Version
55 int version() const override { return 1; }
56
58 const std::string category() const override { return "DataHandling\\Nexus"; }
59
60private:
62 void init() override;
64 void execLoader() override;
65 // Determines whether entry contains multi period data
66 void isEntryMultiPeriod();
67 // Run child algorithm LoadISISNexus2
68 API::Workspace_sptr runLoadISISNexus();
69 // Load Muon specific properties
70 void loadMuonProperties(size_t numSpectra);
72 std::string m_filename;
75 // Is file multi period
77 // Are multi periods loaded
79 // Choose loader strategy
80 void chooseLoaderStrategy(const API::Workspace_sptr &workspace);
81 // The loading strategy used
82 std::unique_ptr<LoadMuonStrategy> m_loadMuonStrategy;
83 // Nexus loading helper class
84 std::unique_ptr<LoadMuonNexusV2NexusHelper> m_nexusLoader;
85 // Change the time axis unit as LoadISISNexus has the wrong one
86 void applyTimeAxisUnitCorrection(API::Workspace &workspace);
87 void loadPeriodInfo(API::Workspace &workspace);
88};
89} // namespace DataHandling
90} // namespace Mantid
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
Base Workspace Abstract Class.
Definition: Workspace.h:30
Loads a file in the Nexus Muon format V2 and stores it in a 2D workspace (Workspace2D class).
std::unique_ptr< LoadMuonStrategy > m_loadMuonStrategy
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
int version() const override
function to return a version of the algorithm, must be overridden in all algorithms
std::string m_filename
The name and path of the input file.
std::unique_ptr< LoadMuonNexusV2NexusHelper > m_nexusLoader
int64_t m_entrynumber
The number of the input entry.
const std::string summary() const override
Summary of algorithms purpose.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20
Helper class which provides the Collimation Length for SANS instruments.