Commit 9db62ea2 authored by Zhou, Wenduo's avatar Zhou, Wenduo
Browse files

Refs #12535. Started to refactor codes for 3 types of splitters.

parent 71434eb2
......@@ -123,6 +123,9 @@ private:
/// Examine workspace
void examineEventWS();
/// Convert SplittersWorkspace to vector of time and vector of target (itarget)
void convertSplittersWorkspaceToVectors();
DataObjects::EventWorkspace_sptr m_eventWS;
DataObjects::SplittersWorkspace_sptr m_splittersWorkspace;
DataObjects::TableWorkspace_sptr m_splitterTableWorkspace;
......
......@@ -451,6 +451,36 @@ void FilterEvents::processSplittersWorkspace() {
}
}
/** Convert SplittersWorkspace to vector of time and vector of target (itarget)
* NOTE: This is designed to use a single vector/vector splitters for all types of inputs
* It is not used before vast experiment on speed comparison!
* @brief FilterEvents::convertSplittersWorkspaceToVectors
*/
void FilterEvents::convertSplittersWorkspaceToVectors()
{
// check: only applied for splitters given by SplittersWorkspace
assert (m_useSplittersWorkspace);
// clear and get ready
m_vecSplitterGroup.clear();
m_vecSplitterTime.clear();
// convert SplittersWorkspace to a set of pairs which can be sorted
size_t num_rows = this->m_splittersWorkspace->rowCount();
for (size_t irow = 0; irow < num_rows; ++irow)
{
Kernel::SplittingInterval splitter = m_splittersWorkspace->getSplitter(irow);
if (m_vecSplitterTime.size() == 0 || splitter.start() > m_vecSplitterTime.end())
{
m_vecSplitterTime.push_back(splitter.start());
m_vecSplitterTime.push_back(splitter.stop());
// 0 stands for not defined
m_vecSplitterGroup.push_back(0);
}
}
}
/** process the input splitters given by a TableWorkspace
* @brief FilterEvents::processTableSplittersWorkspace
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment