Mantid
Loading...
Searching...
No Matches
LoadNexusProcessed2.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2019 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
10#include "MantidDataHandling/DllConfig.h"
13#include "MantidIndexing/SpectrumNumber.h"
15#include <string>
16#include <unordered_map>
17
18namespace Mantid {
19namespace API {
20class Workspace;
21class MatrixWorkspace;
22} // namespace API
23namespace Nexus {
24class NXEntry;
25}
26namespace DataHandling {
29
37class MANTID_DATAHANDLING_DLL LoadNexusProcessed2 : public LoadNexusProcessed {
38public:
39 // algorithm "name" is still "LoadNexusProcessed" (not "LoadNexusProcessed2"):
40 // `cppcheck` has an issue with any "useless" override.
41 // const std::string name() const override;
42
43 int version() const override;
44 int confidence(Nexus::NexusDescriptor &descriptor) const override;
45
46private:
47 void readSpectraToDetectorMapping(Mantid::Nexus::NXEntry &mtd_entry, Mantid::API::MatrixWorkspace &ws) override;
48
50 bool loadNexusGeometry(Mantid::API::Workspace &ws, size_t entryNumber, Kernel::Logger &logger,
51 const std::string &filePath) override;
52
54 void extractMappingInfoNew(const Mantid::Nexus::NXEntry &mtd_entry);
55
56 InstrumentLayout m_instrumentLayout = InstrumentLayout::Mantid;
57
58 // Local cache vectors:
59 // spectral mapping information is accumulated before
60 // the instrument geometry has been completely loaded.
61 //
62 // The key is the NXentry-group name (in order to allow for group workspaces).
63 std::unordered_map<std::string, std::vector<Indexing::SpectrumNumber>> m_spectrumNumberss;
64 std::unordered_map<std::string, std::vector<Mantid::detid_t>> m_detectorIdss;
65 std::unordered_map<std::string, std::vector<int>> m_detectorCountss;
66};
67
68} // namespace DataHandling
69} // namespace Mantid
Base MatrixWorkspace Abstract Class.
Base Workspace Abstract Class.
Definition Workspace.h:29
LoadNexusProcessed2 : Second variation of LoadNexusProcess, built to handle ESS file specifics in add...
std::unordered_map< std::string, std::vector< Indexing::SpectrumNumber > > m_spectrumNumberss
std::unordered_map< std::string, std::vector< int > > m_detectorCountss
std::unordered_map< std::string, std::vector< Mantid::detid_t > > m_detectorIdss
Loads a workspace from a NeXus Processed entry in a NeXus file.
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition Logger.h:51
Implements NXentry Nexus class.
InstrumentLayout
Layout information relating to detector-spectra mappings.
Helper class which provides the Collimation Length for SANS instruments.