11#include "MantidAlgorithms/DllConfig.h"
51 const std::string
name()
const override {
return "GenerateEventsFilter"; }
53 const std::string
summary()
const override {
54 return "Generate one or a set of event filters according to time or "
55 "specified log's value.";
59 int version()
const override {
return 1; }
60 const std::vector<std::string>
seeAlso()
const override {
61 return {
"FilterEvents",
"FilterByTime",
"FilterByLogValue"};
64 const std::string
category()
const override {
return "Events\\EventFiltering"; }
73 void processInOutWorkspaces();
75 void processInputTime();
76 void setFilterByTimeOnly();
77 void setFilterByLogValue(
const std::string &logname);
79 void processSingleValueFilter(
double minvalue,
double maxvalue,
bool filterincrease,
bool filterdecrease);
81 void processMultipleValueFilters(
double minvalue,
double valueinterval,
double maxvalue,
bool filterincrease,
84 void makeFilterBySingleValue(
double min,
double max,
double TimeTolerance,
bool centre,
bool filterIncrease,
85 bool filterDecrease, Types::Core::DateAndTime startTime,
86 Types::Core::DateAndTime stopTime,
int wsindex);
89 void makeMultipleFiltersByValues(std::map<size_t, int> indexwsindexmap,
const std::vector<double> &logvalueranges,
90 bool centre,
bool filterIncrease,
bool filterDecrease,
91 Types::Core::DateAndTime startTime, Types::Core::DateAndTime stopTime);
94 void makeMultipleFiltersByValuesParallel(
const std::map<size_t, int> &indexwsindexmap,
95 const std::vector<double> &logvalueranges,
bool centre,
bool filterIncrease,
96 bool filterDecrease, Types::Core::DateAndTime startTime,
97 Types::Core::DateAndTime stopTime);
100 void makeMultipleFiltersByValuesPartialLog(
int istart,
int iend, std::vector<Types::Core::DateAndTime> &vecSplitTime,
101 std::vector<int> &vecSplitGroup, std::map<size_t, int> indexwsindexmap,
102 const std::vector<double> &logvalueranges,
103 const Types::Core::time_duration &tol,
bool filterIncrease,
104 bool filterDecrease, Types::Core::DateAndTime startTime,
105 Types::Core::DateAndTime stopTime);
108 void processIntegerValueFilter(
int minvalue,
int maxvalue,
bool filterIncrease,
bool filterDecrease,
109 Types::Core::DateAndTime runend);
112 size_t searchValue(
const std::vector<double> &sorteddata,
double value);
115 void addNewTimeFilterSplitter(Types::Core::DateAndTime starttime, Types::Core::DateAndTime stoptime,
int wsindex,
116 const std::string &info);
119 Types::Core::DateAndTime makeSplitterInVector(std::vector<Types::Core::DateAndTime> &vecSplitTime,
120 std::vector<int> &vecGroupIndex, Types::Core::DateAndTime start,
121 Types::Core::DateAndTime stop,
int group, int64_t tol_ns,
122 Types::Core::DateAndTime lasttime);
125 void generateSplittersInMatrixWorkspace();
128 void generateSplittersInMatrixWorkspaceParallel();
131 void generateSplittersInSplitterWS();
134 bool identifyLogEntry(
const int &
index,
const Types::Core::DateAndTime &currT,
const bool &lastgood,
135 const double &minvalue,
const double &maxvalue,
const Types::Core::DateAndTime &startT,
136 const Types::Core::DateAndTime &stopT,
const bool &filterIncrease,
const bool &filterDecrease);
139 int determineChangingDirection(
int startindex);
142 Types::Core::DateAndTime findRunEnd();
180 bool m_isReverseLogarithmic =
false;
double value
The value of the point.
std::map< DeltaEMode::Type, std::string > index
Base class from which all concrete algorithm classes should be derived.
GenerateEventsFilter : Generate an events-filter, i.e., a SplittersWorkspace according to user's requ...
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
bool m_forFastLog
Flag to output matrix workspace for fast log.
double m_timeUnitConvertFactorToNS
std::vector< Types::Core::DateAndTime > m_vecSplitterTime
Vector as date and time.
Types::Core::DateAndTime m_startTime
Types::Core::DateAndTime m_runEndTime
Run end time.
std::vector< std::vector< Types::Core::DateAndTime > > m_vecSplitterTimeSet
Kernel::TimeSplitterType m_splitters
SplitterType.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
API::ITableWorkspace_sptr m_filterInfoWS
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
API::MatrixWorkspace_const_sptr m_dataWS
API::MatrixWorkspace_sptr m_filterWS
Matrix workspace containing splitters.
Kernel::TimeSeriesProperty< int > * m_intLog
Types::Core::DateAndTime m_stopTime
const std::string summary() const override
Summary of algorithms purpose.
Kernel::TimeSeriesProperty< double > * m_dblLog
DataObjects::SplittersWorkspace_sptr m_splitWS
SplitterWorkspace.
double m_logTimeTolerance
int version() const override
Algorithm's version for identification overriding a virtual method.
std::vector< std::vector< int > > m_vecGroupIndexSet
bool m_useParallel
Processing algorithm type.
std::vector< int > m_vecSplitterGroup
A specialised Property class for holding a series of time-value pairs.
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< SplittersWorkspace > SplittersWorkspace_sptr
std::vector< SplittingInterval > TimeSplitterType
A typedef for splitting events according their pulse time.
Helper class which provides the Collimation Length for SANS instruments.