11#include "MantidDataHandling/DllConfig.h"
15namespace DataHandling {
96 virtual void addEvent(
double &minToF,
double &maxToF,
const double tof,
const double binWidth,
97 const size_t pixel) = 0;
98 virtual void addFrame(
int &rawFrames,
int &goodFrames,
const int eventCountInFrame,
const int minEventsReq,
99 const int maxEventsReq, MantidVec &frameEventCounts) = 0;
105 void addEvent(
double &minToF,
double &maxToF,
const double tof,
const double binWidth,
const size_t pixel)
override;
106 void addFrame(
int &rawFrames,
int &goodFrames,
const int eventCountInFrame,
const int minEventsReq,
107 const int maxEventsReq,
MantidVec &frameEventCounts)
override;
108 inline std::vector<std::vector<double>> &
getCounts() {
return m_counts; }
120 void addEvent(
double &minToF,
double &maxToF,
const double tof,
const double binWidth,
const size_t pixel)
override;
121 void addFrame(
int &rawFrames,
int &goodFrames,
const int eventCountInFrame,
const int minEventsReq,
122 const int maxEventsReq,
MantidVec &frameEventCounts)
override;
133 const std::string
name()
const override {
return "LoadNGEM"; }
136 return "Load a file or range of files created by the nGEM detector into a "
142 const std::string
category()
const override {
return "DataHandling\\NGEM"; };
152 void init()
override;
154 void exec()
override;
156 void loadSingleFile(
const std::vector<std::string> &filePath,
int &eventCountInFrame,
double &minToF,
double &maxToF,
157 const double binWidth,
int &rawFrames,
int &goodFrames,
const int minEventsReq,
158 const int maxEventsReq, MantidVec &frameEventCounts,
const size_t totalFilePaths,
159 std::shared_ptr<LoadDataStrategyBase> strategy);
161 size_t verifyFileSize(std::ifstream &file);
163 bool reportProgressAndCheckCancel(
size_t &numProcessedEvents,
int &eventCountInFrame,
const size_t totalNumEvents,
164 const size_t totalFilePaths);
166 void createCountWorkspace(
const std::vector<double> &frameEventCounts);
170 std::map<std::string, std::string> validateInputs()
override;
172 std::vector<std::pair<std::string, std::string>> validateEventsPerFrame();
174 std::vector<std::pair<std::string, std::string>> validateMinMaxToF();
176 LoadDataResult readDataAsHistograms(
double &minToF,
double &maxToF,
const double binWidth,
const int minEventsReq,
177 const int maxEventsReq,
const std::vector<std::vector<std::string>> &filePaths);
179 LoadDataResult readDataAsEvents(
double &minToF,
double &maxToF,
const double binWidth,
const int minEventsReq,
180 const int maxEventsReq,
const std::vector<std::vector<std::string>> &filePaths);
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
virtual void addEvent(double &minToF, double &maxToF, const double tof, const double binWidth, const size_t pixel)=0
virtual void addFrame(int &rawFrames, int &goodFrames, const int eventCountInFrame, const int minEventsReq, const int maxEventsReq, MantidVec &frameEventCounts)=0
void addFrame(int &rawFrames, int &goodFrames, const int eventCountInFrame, const int minEventsReq, const int maxEventsReq, MantidVec &frameEventCounts) override
Add a completed frame to the event list.
std::vector< DataObjects::EventList > m_eventsInFrame
std::vector< DataObjects::EventList > m_events
std::vector< DataObjects::EventList > & getEvents()
void addEvent(double &minToF, double &maxToF, const double tof, const double binWidth, const size_t pixel) override
Add an event to the event list.
std::vector< std::vector< double > > & getCounts()
std::vector< std::vector< double > > m_counts
std::vector< double > & getBinEdges()
std::vector< std::vector< double > > m_countsInFrame
std::vector< double > m_binEdges
const std::string name() const override
Algorithm's name for identification.
int version() const override
Algorithm's Version for identification.
bool loadMutipleAsOne() override
Should the loader load multiple files into one workspace.
const std::string summary() const override
The purpose of the algorithm.
const std::string category() const override
Algorithm's category for identification.
Defines a wrapper around an open file.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
static constexpr uint64_t CONTIN_ID_VALUE
static constexpr uint64_t EVENT_ID_MASK
Helper class which provides the Collimation Length for SANS instruments.
std::vector< double > MantidVec
typedef for the data storage used in Mantid matrix workspaces
uint64_t getPixel() const
static constexpr int COINCIDENCE_IDENTIFIER
Holds the 128 bit words from the detector.
Generic event to separate bits.
Holds variables tracking the data load across all files.
API::MatrixWorkspace_sptr dataWorkspace
std::vector< double > frameEventCounts
Indicate time 0, the start of a new frame.
static constexpr int T0_IDENTIFIER
Is able to hold all versions of the data words in the same memory location.
CoincidenceEvent coincidence