10#include "MantidDataHandling/DllConfig.h"
20namespace DataHandling {
27#undef LOADEVENTPRENEXUS_ALLOW_PARALLEL
47struct IntermediateEvent {
82 const std::string
name()
const override {
return "LoadEventPreNexus"; }
84 int version()
const override {
return (2); }
85 const std::vector<std::string>
seeAlso()
const override {
return {
"LoadPreNexus",
"FilterEventsByLogValuePreNexus"}; }
87 const std::string
category()
const override {
return "DataHandling\\PreNexus"; }
89 const std::string
alias()
const override {
return "LoadEventPreNeXus2"; }
91 const std::string
summary()
const override {
92 return "Loads SNS raw neutron event data format and stores it in a "
100 void init()
override;
102 void exec()
override;
104 std::unique_ptr<Mantid::API::Progress> prog =
nullptr;
127 std::unique_ptr<Mantid::Kernel::BinaryFile<DasEvent>>
eventfile;
180 void loadPixelMap(
const std::string &filename);
182 void openEventFile(
const std::string &filename);
184 void readPulseidFile(
const std::string &filename,
const bool throwError);
188 inline void fixPixelId(
PixelType &pixel, uint32_t &period)
const;
193 std::vector<Types::Event::TofEvent> **arrayOfVectors,
DasEvent *event_buffer,
194 size_t current_event_buffer_size,
size_t fileOffset,
bool dbprint);
198 void addToWorkspaceLog(
const std::string &logtitle,
size_t mindex);
200 void processImbedLogs();
204 void unmaskVetoEventIndex();
208 void createOutputWorkspace(
const std::string &event_filename);
211 void processInvestigationInputs();
IPeaksWorkspace_sptr workspace
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
A data loading routine for SNS pre-nexus event files.
Mantid::detid_t detid_max
The maximum detector ID possible.
std::vector< double > proton_charge
The proton charge on a pulse by pulse basis.
std::size_t num_good_events
The number of good events loaded.
std::map< int64_t, bool > spectraLoadMap
Handle to the loaded spectra map.
const std::string alias() const override
Algorithm's aliases.
std::vector< int64_t > spectra_list
the list of Spectra
std::vector< detid_t > mSEids
sample environment event
bool loadOnlySomeSpectra
For loading only some spectra.
std::vector< Types::Core::DateAndTime > pulsetimes
The times for each pulse.
bool using_mapping_file
Set to true if a valid Mapping file was provided.
double longest_tof
Longest TOF limit.
double shortest_tof
Shortest TOF limit.
std::size_t num_error_events
The number of error events encountered.
uint32_t numpixel
the number of pixels
const std::string summary() const override
Summary of algorithms purpose.
int version() const override
Algorithm's version.
std::vector< PixelType > pixelmap
Map between the DAS pixel IDs and our pixel IDs, used while loading.
std::vector< std::vector< Types::Core::DateAndTime > > wrongdetid_pulsetimes
const std::string category() const override
Algorithm's category for identification.
std::vector< std::vector< double > > mSEtofs
double proton_charge_tot
The total proton charge for the run.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
bool pulsetimesincreasing
Whether or not the pulse times are sorted in increasing order.
std::size_t num_events
The number of events in the file.
std::vector< std::vector< double > > wrongdetid_tofs
std::map< size_t, detid_t > mSEmap
bool m_dbOutput
Investigation properties.
std::set< PixelType > wrongdetids
detector IDs. Part of error events.
void debugOutput(bool doit, size_t mindex)
std::size_t num_bad_events
The number of bad events.
const std::string name() const override
Algorithm's name.
std::vector< uint64_t > event_indices
The index of the first event in each pulse.
std::size_t first_event
The first event to load (count from zero)
std::size_t num_pulses
the number of pulses
std::vector< std::vector< int64_t > > mSEpulseids
std::size_t num_wrongdetid_events
The number of events with wrong.
std::map< PixelType, size_t > wrongdetidmap
std::size_t num_ignored_events
the number of events that were ignored (not loaded) because, e.g.
std::unique_ptr< Mantid::Kernel::BinaryFile< DasEvent > > eventfile
Handles loading from the event file.
bool parallelProcessing
Flag to allow for parallel loading.
DataObjects::EventWorkspace_sptr localWorkspace
std::vector< std::size_t > pixel_to_wkspindex
The value of the vector is the workspace index.
std::size_t max_events
Number of events to load.
Defines a wrapper around an open file.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
int DasTofType
Type for the DAS time of flight (data file)
int PixelType
DetermineChunking : Workflow algorithm to determine chunking.
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
Helper class which provides the Collimation Length for SANS instruments.
int32_t detid_t
Typedef for a detector ID.
Structure that matches the form in the binary event list.
DasTofType tof
Time of flight.
PixelType pid
Pixel identifier as published by the DAS/DAE/DAQ.
uint32_t nanoseconds
The number of nanoseconds since the seconds field.
uint64_t event_index
The index of the first event for this pulse.
double pCurrent
The proton charge for the pulse.
uint32_t seconds
The number of seconds since January 1, 1990.