Mantid
Loading...
Searching...
No Matches
LoadPLN.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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// Mantid Repository : https://github.com/mantidproject/mantid
8//
9// Copyright © 2010 ISIS Rutherford Appleton Laboratory UKRI,
10// NScD Oak Ridge National Laboratory, European Spallation Source
11// & Institut Laue - Langevin
12// SPDX - License - Identifier: GPL - 3.0 +
13#pragma once
14
15//---------------------------------------------------
16// Includes
17//---------------------------------------------------
18
19#include "LoadANSTOEventFile.h"
20#include "LoadANSTOHelper.h"
23#include "MantidDataHandling/DllConfig.h"
28
29namespace Mantid {
30namespace DataHandling {
31
33
34/*
35Loads an ANSTO Pelican event file and stores it in an event workspace.
36
37@author Geish Miladinovic (ANSTO)
38*/
39
59class MANTID_DATAHANDLING_DLL LoadPLN : public API::IFileLoader<Kernel::NexusDescriptor> {
60
61public:
62 int version() const override;
63 const std::vector<std::string> seeAlso() const override;
64 const std::string category() const override;
65 const std::string name() const override;
66 const std::string summary() const override;
67 int confidence(Kernel::NexusDescriptor &descriptor) const override;
68
69private:
70 void exec() override;
71 void init() override;
72 void exec(const std::string &hdfFile, const std::string &eventFile);
73
74 // region of intereset
75 std::vector<bool> createRoiVector(const std::string &seltubes, const std::string &maskfile);
76
77protected:
78 // load parameters from input file
79 void loadParameters(const std::string &hdfFile, API::LogManager &logm);
80 void loadEnvironParameters(const std::string &hdfFile, API::LogManager &logm);
81
82 // load the instrument definition and instrument parameters
83 void loadInstrument();
84
85 // get the L2 distance indexed by detector id
86 void loadDetectorL2Values();
87
88 // create workspace
89 void createWorkspace(const std::string &title);
90
91 // prepare event storage
92 void prepareEventStorage(ANSTO::ProgressTracker &prog, std::vector<size_t> &eventCounts,
93 std::vector<EventVector_pt> &eventVectors);
94
95 // set up the detector masks
96 void setupDetectorMasks(const std::vector<bool> &roi);
97
98 // shared member variables
100 int32_t m_datasetIndex{0};
101 std::string m_startRun;
102 std::vector<double> m_detectorL2;
103};
104
105} // namespace DataHandling
106} // namespace Mantid
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
Definition: IFileLoader.h:19
This class contains the information about the log entries.
Definition: LogManager.h:44
helper class to keep track of progress
LoadPLN : Loads an ANSTO PLN Hdf and linked event file into a workspace.
Definition: LoadPLN.h:59
std::vector< double > m_detectorL2
Definition: LoadPLN.h:102
DataObjects::EventWorkspace_sptr m_localWorkspace
Definition: LoadPLN.h:99
Defines a wrapper around a file whose internal structure can be accessed using the NeXus API.
std::shared_ptr< T > createWorkspace(InitArgs... args)
std::vector< Types::Event::TofEvent > * EventVector_pt
pointer to the vector of events
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
Helper class which provides the Collimation Length for SANS instruments.