Mantid
Loading...
Searching...
No Matches
SumEventsByLogValue.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------------------------------------------
10// Includes
11//----------------------------------------------------------------------
12#include "MantidAPI/Algorithm.h"
14#include "MantidAlgorithms/DllConfig.h"
17
18namespace Mantid {
19namespace Algorithms {
25class MANTID_ALGORITHMS_DLL SumEventsByLogValue final : public API::Algorithm {
26public:
28 const std::string name() const override { return "SumEventsByLogValue"; }
30 int version() const override { return (1); }
31 const std::vector<std::string> seeAlso() const override { return {"FilterByLogValue"}; }
33 const std::string category() const override { return "Events"; }
35 const std::string summary() const override {
36 return "Produces a single spectrum workspace containing the "
37 "total summed events in the workspace as a function of a specified "
38 "log.";
39 }
40
41 std::map<std::string, std::string> validateInputs() override;
42
43private:
44 void init() override;
45 void exec() override;
46
47 void createTableOutput(const Kernel::TimeSeriesProperty<int> *log);
48
49 template <typename T> void createBinnedOutput(const Kernel::TimeSeriesProperty<T> *log);
50
51 void filterEventList(const API::IEventList &eventList, const int minVal, const int maxVal,
52 const Kernel::TimeSeriesProperty<int> *log, std::vector<int> &Y);
53 void addMonitorCounts(const API::ITableWorkspace_sptr &outputWorkspace, const Kernel::TimeSeriesProperty<int> *log,
54 const int minVal, const int maxVal);
55 std::vector<std::pair<std::string, const Kernel::ITimeSeriesProperty *>> getNumberSeriesLogs();
56 double sumProtonCharge(const Kernel::TimeSeriesProperty<double> *protonChargeLog,
57 const Kernel::TimeSplitterType &filter);
58
60 std::string m_logName;
61 std::vector<double> m_binningParams;
62};
63
64} // namespace Algorithms
65} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
IEventList : Interface to Mantid::DataObjects::EventList class, used to expose to PythonAPI.
Definition: IEventList.h:26
Produces a table or single spectrum workspace containing the total summed events in the workspace as ...
std::vector< double > m_binningParams
The optional binning parameters.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
std::string m_logName
The name of the log to sum against.
const std::string summary() const override
Summary of algorithms purpose.
DataObjects::EventWorkspace_const_sptr m_inputWorkspace
The input workspace.
int version() const override
Algorithm's version for identification overriding a virtual method.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
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 EventWorkspace > EventWorkspace_const_sptr
shared pointer to a const Workspace2D
std::vector< SplittingInterval > TimeSplitterType
A typedef for splitting events according their pulse time.
Definition: LogManager.h:31
Helper class which provides the Collimation Length for SANS instruments.