Mantid
Loading...
Searching...
No Matches
LoadMuonNexus1.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//----------------------------------------------------------------------
15
16// Forward declaration (here, because is not in Mantid namespace)
17class MuonNexusReader;
18
19namespace Mantid {
20//----------------------------------------------------------------------
21// Forward declaration
22//----------------------------------------------------------------------
23namespace NeXus {
24class NXRoot;
25}
26
27namespace DataHandling {
55class MANTID_DATAHANDLING_DLL LoadMuonNexus1 : public LoadMuonNexus {
56public:
60 const std::string name() const override { return "LoadMuonNexus"; }
62 const std::string summary() const override {
63 return "The LoadMuonNexus algorithm will read the given NeXus Muon data "
64 "file Version 1 and use the results to populate the named "
65 "workspace. LoadMuonNexus may be invoked by LoadNexus if it is "
66 "given a NeXus file of this type.";
67 }
68
70 int version() const override { return 1; }
72 const std::string category() const override { return "DataHandling\\Nexus;Muon\\DataHandling"; }
73
75 int confidence(Kernel::NexusDescriptor &descriptor) const override;
76
77protected:
79 void exec() override;
80
81private:
82 void loadData(size_t hist, specnum_t &i, specnum_t specNo, MuonNexusReader &nxload, const int64_t lengthIn,
83 const DataObjects::Workspace2D_sptr &localWorkspace);
85 void runLoadLog(const DataObjects::Workspace2D_sptr &);
86 void loadRunDetails(const DataObjects::Workspace2D_sptr &localWorkspace);
87 void addPeriodLog(const DataObjects::Workspace2D_sptr &localWorkspace, int64_t period);
88 void addGoodFrames(const DataObjects::Workspace2D_sptr &localWorkspace, int64_t period, int nperiods);
89
91 void loadDeadTimes(Mantid::NeXus::NXRoot &root);
92
94 DataObjects::TableWorkspace_sptr createDeadTimeTable(std::vector<int> specToLoad, std::vector<double> deadTimes);
95
97 API::Workspace_sptr loadDetectorGrouping(Mantid::NeXus::NXRoot &root,
99
101 DataObjects::TableWorkspace_sptr createDetectorGroupingTable(std::vector<int> specToLoad, std::vector<int> grouping);
102};
103
104} // namespace DataHandling
105} // namespace Mantid
int version() const override
Algorithm's version for identification overriding a virtual method.
const std::string summary() const override
Summary of algorithms purpose.
void runLoadMappingTable(DataObjects::Workspace2D_sptr)
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
It is a base class for loaders for versions 1 and 2 of the muon nexus file format.
Definition: LoadMuonNexus.h:50
Defines a wrapper around a file whose internal structure can be accessed using the NeXus API.
Implements NXroot Nexus class.
Definition: NexusClasses.h:922
MuunNexusReader opens a Nexus file and reads certain fields expected for a ISIS Muon data file (old f...
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
Definition: Workspace_fwd.h:20
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
std::shared_ptr< TableWorkspace > TableWorkspace_sptr
shared pointer to Mantid::DataObjects::TableWorkspace
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
Helper class which provides the Collimation Length for SANS instruments.
int32_t specnum_t
Typedef for a spectrum Number.
Definition: IDTypes.h:16