Mantid
Loading...
Searching...
No Matches
LoadMuonStrategy.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
9#include "MantidDataHandling/DllConfig.h"
13#include "MantidKernel/Logger.h"
14
15#include <optional>
16
17namespace Mantid {
18namespace DataHandling {
19class LoadMuonNexusV2NexusHelper;
20
21// Create time zero table
22DataObjects::TableWorkspace_sptr createTimeZeroTable(const size_t numSpec, const std::vector<double> &timeZeros);
23
24class MANTID_DATAHANDLING_DLL LoadMuonStrategy {
25public:
26 // Constructor
27 LoadMuonStrategy(Kernel::Logger &g_log, std::string filename, LoadMuonNexusV2NexusHelper &nexusLoader);
28 // Virtual destructor
29 virtual ~LoadMuonStrategy() = default;
30 // Load muon log data
31 virtual void loadMuonLogData() = 0;
32 // Returns the good frames from the nexus entry
33 virtual void loadGoodFrames() = 0;
34 // Apply time zero correction
35 virtual void applyTimeZeroCorrection() = 0;
36 // Load detector grouping
38 // Load dead time table
40 // Get time zero table
42
43protected:
44 // Create grouping table
45 std::optional<DataObjects::TableWorkspace_sptr>
46 createDetectorGroupingTable(const std::vector<detid_t> &specToLoad,
47 const std::optional<std::vector<detid_t>> &grouping) const;
48 // Create deadtimes table
49 DataObjects::TableWorkspace_sptr createDeadTimeTable(const std::vector<detid_t> &detectorsLoaded,
50 const std::vector<double> &deadTimes) const;
51
52 API::Workspace_sptr loadDefaultDetectorGrouping(const DataObjects::Workspace2D &localWorkspace) const;
53
54 std::vector<detid_t> getLoadedDetectorsFromWorkspace(const DataObjects::Workspace2D &localWorkspace) const;
55 // Logger
57 // Filename, used for running child algorithms
58 const std::string m_filename;
59 // Nexus file loader, used for manipulating the nexus entry
61};
62} // namespace DataHandling
63} // namespace Mantid
virtual API::Workspace_sptr loadDeadTimeTable() const =0
virtual API::Workspace_sptr loadDetectorGrouping() const =0
LoadMuonNexusV2NexusHelper & m_nexusLoader
virtual API::Workspace_sptr getTimeZeroTable()=0
Concrete workspace implementation.
Definition Workspace2D.h:29
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition Logger.h:51
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
DataObjects::TableWorkspace_sptr createTimeZeroTable(const size_t numSpec, const std::vector< double > &timeZeros)
Creates a timezero table for the loaded detectors.
std::shared_ptr< TableWorkspace > TableWorkspace_sptr
shared pointer to Mantid::DataObjects::TableWorkspace
Helper class which provides the Collimation Length for SANS instruments.