11#include "MantidDataHandling/DllConfig.h"
21namespace DataHandling {
28#undef LOADEVENTPRENEXUS_ALLOW_PARALLEL
86 const std::string
name()
const override {
return "FilterEventsByLogValuePreNexus"; }
88 int version()
const override {
return (2); }
90 const std::string
category()
const override {
return "DataHandling\\PreNexus"; }
92 const std::string
alias()
const override {
return "LoadEventPreNeXus2"; }
94 const std::string
summary()
const override {
95 return "Load and split SNS raw neutron event data format and stores it in "
104 void init()
override;
106 void exec()
override;
109 void processProperties();
114 void loadPixelMap(
const std::string &filename);
116 void openEventFile(
const std::string &filename);
118 void readPulseidFile(
const std::string &filename,
const bool throwError);
125 std::vector<Types::Event::TofEvent> **arrayOfVectors,
DasEvent *event_buffer,
126 size_t current_event_buffer_size,
size_t fileOffset);
130 void addToWorkspaceLog(
const std::string &logtitle,
size_t mindex);
132 void processEventLogs();
144 std::vector<Types::Event::TofEvent> **arrayOfVectors,
DasEvent *event_buffer,
145 size_t current_event_buffer_size,
size_t fileOffset);
148 void unmaskVetoEventIndexes();
152 int findRunFrequency();
157 void doStatToEventLog(
size_t mindex);
159 std::unique_ptr<Mantid::API::Progress> m_progress =
nullptr;
182 std::unique_ptr<Mantid::Kernel::BinaryFile<DasEvent>>
m_eventFile;
IPeaksWorkspace_sptr workspace
Class for marking algorithms as deprecated.
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
A data loading and splitting routine for SNS pre-nexus event files.
const std::string category() const override
Algorithm's category for identification.
int m_freqHz
Accelerator operation frequency.
double m_longestTof
Longest TOF limit.
int version() const override
Algorithm's version.
std::size_t m_numPulses
the number of pulses
std::vector< std::vector< int64_t > > mSEpulseids
std::set< PixelType > wrongdetids
detector IDs. Part of error events.
const std::string name() const override
Algorithm's name.
Mantid::detid_t m_detid_max
The maximum detector ID possible.
std::vector< PixelType > m_pixelmap
Map between the DAS pixel IDs and our pixel IDs, used while loading.
bool m_parallelProcessing
Flag to allow for parallel loading.
std::vector< std::vector< double > > wrongdetid_tofs
uint32_t m_numPixel
the number of pixels
~FilterEventsByLogValuePreNexus() override
Virtual destructor.
std::size_t m_numGoodEvents
The number of good events loaded.
std::unique_ptr< Mantid::Kernel::BinaryFile< DasEvent > > m_eventFile
Handles loading from the event file.
bool m_examEventLog
Flag for examine event (log)
std::size_t m_numBadEvents
The number of bad events.
bool m_usingMappingFile
Set to true if a valid Mapping file was provided.
std::size_t m_numEvents
The number of events in the file.
std::vector< Types::Core::DateAndTime > pulsetimes
The times for each pulse.
std::vector< std::string > m_vecLogPixelTag
Log pixel Tags for filtering.
const std::string alias() const override
Algorithm's aliases.
std::size_t m_numIgnoredEvents
the number of events that were ignored (not loaded) because, e.g.
std::vector< detid_t > mSEids
sample environment event
std::vector< int > m_vecLogPixelID
Log pixel IDs for filtering.
int m_pixelid2exam
Pixel ID to exam.
std::size_t m_firstEvent
The first event to load (count from zero)
int m_numevents2write
Number of events to write out.
std::map< PixelType, size_t > wrongdetidmap
bool m_throwError
Throw error with bad pulse ID.
std::vector< std::vector< double > > mSEtofs
DataObjects::EventWorkspace_sptr m_localWorkspace
std::vector< std::size_t > m_pixelToWkspindex
The value of the vector is the workspace index.
std::map< size_t, detid_t > mSEmap
std::vector< std::vector< Types::Core::DateAndTime > > wrongdetid_pulsetimes
void debugOutput(bool doit, size_t mindex)
std::string m_pulseIDFileName
Pulse ID file.
const std::string summary() const override
Summary of algorithms purpose.
std::vector< uint64_t > m_vecEventIndex
The index of the first event in each pulse.
double m_shortestTof
Shortest TOF limit.
bool m_pulseTimesIncreasing
Whether or not the pulse times are sorted in increasing order.
bool m_loadOnlySomeSpectra
For loading only some spectra.
std::size_t m_maxNumEvents
Number of events to load.
std::vector< double > m_protonCharge
The proton charge on a pulse by pulse basis.
std::string m_functionMode
Function mode.
std::string m_eventFileName
Event file.
std::map< int64_t, bool > spectraLoadMap
Handle to the loaded spectra map.
std::size_t m_numWrongdetidEvents
The number of events with wrong.
DataObjects::EventWorkspace_sptr m_localWorkspaceBA
Output EventWorkspace for filtered event B->A.
double m_protonChargeTot
The total proton charge for the run.
std::size_t m_numErrorEvents
The number of error events encountered.
std::vector< int64_t > m_spectraList
the list of Spectra
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.
Structure that matches the form in the new pulseid files.
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.