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"
27
28namespace Mantid {
29namespace DataHandling {
30
32
33/*
34Loads an ANSTO Pelican event file and stores it in an event workspace.
35
36@author Geish Miladinovic (ANSTO)
37*/
38
58class MANTID_DATAHANDLING_DLL LoadPLN : public API::IFileLoader<Nexus::NexusDescriptor> {
59
60public:
61 int version() const override;
62 const std::vector<std::string> seeAlso() const override;
63 const std::string category() const override;
64 const std::string name() const override;
65 const std::string summary() const override;
66 int confidence(Nexus::NexusDescriptor &descriptor) const override;
67
68private:
69 void exec() override;
70 void init() override;
71 void exec(const std::string &hdfFile, const std::string &eventFile);
72
73 // region of intereset
74 std::vector<bool> createRoiVector(const std::string &seltubes, const std::string &maskfile);
75
76protected:
77 // load parameters from input file
78 void loadParameters(const std::string &hdfFile, API::LogManager &logm);
79 void loadEnvironParameters(const std::string &hdfFile, API::LogManager &logm);
80
81 // load the instrument definition and instrument parameters
82 void loadInstrument();
83
84 // get the L2 distance indexed by detector id
85 void loadDetectorL2Values();
86
87 // create workspace
88 void createWorkspace(const std::string &title);
89
90 // prepare event storage
91 void prepareEventStorage(ANSTO::ProgressTracker &prog, std::vector<size_t> &eventCounts,
92 std::vector<EventVector_pt> &eventVectors);
93
94 // set up the detector masks
95 void setupDetectorMasks(const std::vector<bool> &roi);
96
97 // shared member variables
99 int32_t m_datasetIndex{0};
100 std::string m_startRun;
101 std::vector<double> m_detectorL2;
102};
103
104} // namespace DataHandling
105} // namespace Mantid
std::string name
Definition Run.cpp:60
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:58
std::vector< double > m_detectorL2
Definition LoadPLN.h:101
DataObjects::EventWorkspace_sptr m_localWorkspace
Definition LoadPLN.h:98
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.