-
Notifications
You must be signed in to change notification settings - Fork 122
/
FilterEvents.h
133 lines (95 loc) · 4.02 KB
/
FilterEvents.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#ifndef MANTID_ALGORITHMS_FILTEREVENTS_H_
#define MANTID_ALGORITHMS_FILTEREVENTS_H_
#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"
#include "MantidDataObjects/EventWorkspace.h"
#include "MantidDataObjects/SplittersWorkspace.h"
#include "MantidDataObjects/TableWorkspace.h"
#include "MantidAPI/ISplittersWorkspace.h"
#include "MantidKernel/TimeSplitter.h"
#include "MantidAPI/ITableWorkspace.h"
#include "MantidKernel/TimeSeriesProperty.h"
namespace Mantid
{
namespace Algorithms
{
/** FilterEvents : Filter Events in EventWorkspace to multiple EventsWorkspace by Splitters
@date 2012-04-04
Copyright © 2012 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport FilterEvents : public API::Algorithm
{
public:
FilterEvents();
virtual ~FilterEvents();
/// Algorithm's name for identification overriding a virtual method
virtual const std::string name() const { return "FilterEvents";};
/// Algorithm's version for identification overriding a virtual method
virtual int version() const { return 1;};
/// Algorithm's category for identification overriding a virtual method
virtual const std::string category() const { return "Events\\EventFiltering";}
private:
/// Sets documentation strings for this algorithm
virtual void initDocs();
// Implement abstract Algorithm methods
void init();
// Implement abstract Algorithm methods
void exec();
/// Process user input properties
void processProperties();
void processSplittersWorkspace();
///
void processMatrixSplitterWorkspace();
void createOutputWorkspaces();
void importDetectorTOFCalibration();
void filterEventsBySplitters(double progressamount);
///
void filterEventsByVectorSplitters(double progressamount);
DataObjects::EventWorkspace_sptr m_eventWS;
DataObjects::SplittersWorkspace_sptr m_splittersWorkspace;
API::MatrixWorkspace_const_sptr m_matrixSplitterWS;
DataObjects::TableWorkspace_sptr m_detCorrectWorkspace;
/// Flag to use matrix splitters or table splitters
bool m_useTableSplitters;
std::set<int> m_workGroupIndexes;
Kernel::TimeSplitterType m_splitters;
std::map<int, DataObjects::EventWorkspace_sptr> m_outputWS;
std::vector<std::string> m_wsNames;
std::vector<detid_t> m_detectorIDs;
std::vector<double> m_detTofOffsets;
bool mFilterByPulseTime;
DataObjects::TableWorkspace_sptr m_informationWS;
bool mWithInfo;
double mProgress;
void getTimeSeriesLogNames(std::vector<std::string>& lognames);
void generateSplitters(int wsindex, Kernel::TimeSplitterType& splitters);
void splitLog(DataObjects::EventWorkspace_sptr eventws, std::string logname, Kernel::TimeSplitterType& splitters);
/// Flag to do TOF correction
bool m_doTOFCorrection;
/// Flag to generate TOF correction
bool m_genTOFCorrection;
/// Base of output workspace's name
std::string m_outputWSNameBase;
///
bool m_toGroupWS;
///
std::vector<int64_t> m_vecSplitterTime;
///
std::vector<int> m_vecSplitterGroup;
};
} // namespace Algorithms
} // namespace Mantid
#endif /* MANTID_ALGORITHMS_FILTEREVENTS_H_ */