Mantid
Loading...
Searching...
No Matches
LoadCSNSNexus.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#ifndef MANTID_DATAHANDLING_LOADCSNSNEXUS_H_
8#define MANTID_DATAHANDLING_LOADCSNSNEXUS_H_
9
10#include "MantidAPI/Algorithm.h"
11#include "MantidDataHandling/DllConfig.h"
13#include <nexus/NeXusFile.hpp>
14/****************************************/
15
16namespace Mantid {
17namespace DataHandling {
18
21class MANTID_DATAHANDLING_DLL LoadCSNSNexus final : public API::Algorithm {
22public:
23 const std::string name() const override;
25 const std::string summary() const override { return "Loads an CSNS NeXus file into a group workspace."; }
26
27 int version() const override;
28 const std::vector<std::string> seeAlso() const override { return {""}; }
29 const std::string category() const override;
30
31 Types::Core::DateAndTime getExperimentTime(const std::string &typeName);
32
33 std::vector<std::string> getModules(const std::string &inst, const std::vector<std::string> &inputNames);
34 bool checkBanknames(const std::vector<std::string> &inputNames);
35 std::vector<std::string> getGPPDModules(const std::string &bankName);
36 std::vector<int64_t> getPixelId(const std::vector<std::string> &inputList);
37 std::vector<uint32_t> getTimeBin(const std::string &typeName);
38 std::vector<uint32_t> getHistData(const std::vector<std::string> &inputList);
39 void loadHistData(API::MatrixWorkspace_sptr &workspace, const std::vector<uint32_t> &timeOfFlight, size_t pidNums,
40 const std::vector<uint32_t> &histData);
41
42 std::multimap<uint32_t, std::pair<float, int64_t>> getEventData(const std::vector<std::string> &inputList,
43 const std::vector<uint32_t> &startList,
44 const std::vector<uint32_t> &endList,
45 const std::vector<int64_t> &pids);
46 void loadEventData(DataObjects::EventWorkspace_sptr &workspace, const std::vector<uint32_t> &timeOfFlight,
47 size_t pidNums, const std::multimap<uint32_t, std::pair<float, int64_t>> &evtData);
48
49private:
50 void init() override;
51 void exec() override;
52 std::unique_ptr<::NeXus::File> m_file;
53 std::string m_entry;
54 std::vector<std::string> m_modules;
55 std::vector<std::string> m_monitors;
56};
57
58} // namespace DataHandling
59} // namespace Mantid
60
61#endif /* MANTID_DATAHANDLING_LOADCSNSNEXUS_H_ */
IPeaksWorkspace_sptr workspace
Definition: IndexPeaks.cpp:114
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
LoadCSNSNexus : TODO: DESCRIPTION.
Definition: LoadCSNSNexus.h:21
std::vector< std::string > m_modules
Definition: LoadCSNSNexus.h:54
const std::string summary() const override
Summary of algorithms purpose.
Definition: LoadCSNSNexus.h:25
std::unique_ptr<::NeXus::File > m_file
Definition: LoadCSNSNexus.h:52
std::vector< std::string > m_monitors
Definition: LoadCSNSNexus.h:55
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: LoadCSNSNexus.h:28
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
Helper class which provides the Collimation Length for SANS instruments.