Mantid
Loading...
Searching...
No Matches
CalculateCountRate.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2016 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
10#include "MantidAlgorithms/DllConfig.h"
13
14namespace Mantid {
15namespace Algorithms {
16
29class MANTID_ALGORITHMS_DLL CalculateCountRate : public API::Algorithm {
30public:
31 const std::string name() const override;
32 int version() const override;
33 const std::vector<std::string> seeAlso() const override { return {"ChangePulsetime"}; }
34 const std::string category() const override;
35 const std::string summary() const override;
38 bool normalizeCountRate() const;
40 bool useLogDerivative() const;
42 bool buildVisWS() const;
43
44private:
45 void init() override;
46 void exec() override;
47 // holder of the temporary log, used for normalization, binning source etc...
48 std::unique_ptr<Kernel::TimeSeriesProperty<double>> m_tmpLogHolder;
49 // diable log normalization
50 void disableNormalization(const std::string &NormLogError);
51
52protected: // for testing, actually private
55 bool m_normalizeResult{false};
56 Kernel::TimeSeriesProperty<double> const *m_pNormalizationLog{nullptr};
58 int m_numLogSteps{200};
61 bool m_rangeExplicit{false};
62 bool m_useLogDerivative{false};
64 double m_XRangeMin{0}, m_XRangeMax{0};
66 Types::Core::DateAndTime m_TRangeMin{0}, m_TRangeMax{0};
69
70 void setSourceWSandXRanges(DataObjects::EventWorkspace_sptr &InputWorkspace);
71
72 void setOutLogParameters(const DataObjects::EventWorkspace_sptr &InputWorkspace);
73
74 void calcRateLog(DataObjects::EventWorkspace_sptr &InputWorkspace, Kernel::TimeSeriesProperty<double> *const targLog);
75
76 void checkAndInitVisWorkspace();
77
78 void histogramEvents(const DataObjects::EventList &el, std::mutex *spectraLocks);
79
80 void buildVisWSNormalization(std::vector<double> &normalization);
81
83 bool m_doVis{false};
86 // variables used in 2D histogramming of the visualization workspace
87 double m_visX0, m_visDX, m_visT0, m_visDT, m_visTmax;
88 // vector used in normalization of the visualization workspace
89 std::vector<double> m_visNorm;
90};
91
92} // namespace Algorithms
93} // namespace Mantid
std::string name
Definition Run.cpp:60
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
In normal circumstances an instrument in event mode counts neutrons with constant steady rate which d...
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
DataObjects::EventWorkspace_sptr m_workingWS
temporary workspace used to keep intermediate results
DataObjects::Workspace2D_sptr m_visWs
shared pointer to the optional visualization workspace
std::unique_ptr< Kernel::TimeSeriesProperty< double > > m_tmpLogHolder
A class for holding :
Definition EventList.h:57
A specialised Property class for holding a series of time-value pairs.
std::shared_ptr< Workspace2D > Workspace2D_sptr
shared pointer to Mantid::DataObjects::Workspace2D
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
Helper class which provides the Collimation Length for SANS instruments.