Mantid
|
Performs removal of constant (and possibly non-constant after simple modification) background calculated in TOF units from a matrix workspace, expressed in units, different from TOF. More...
#include <RemoveBackground.h>
Public Member Functions | |
BackgroundHelper () | |
Constructor. More... | |
BackgroundHelper (const BackgroundHelper &)=delete | |
void | initialize (const API::MatrixWorkspace_const_sptr &bkgWS, const API::MatrixWorkspace_sptr &sourceWS, Kernel::DeltaEMode::Type emode, Kernel::Logger *pLog=nullptr, int nThreads=1, bool inPlace=true, bool nullifyNegative=false) |
Initialization method: More... | |
BackgroundHelper & | operator= (const BackgroundHelper &)=delete |
void | removeBackground (int nHist, HistogramData::HistogramX &x_data, HistogramData::HistogramY &y_data, HistogramData::HistogramE &e_data, int threadNum=0) const |
Method removes background from vectors which represent a histogram data for a single spectra. More... | |
Private Attributes | |
API::MatrixWorkspace_const_sptr | m_bgWs |
double | m_dtBg |
Kernel::DeltaEMode::Type | m_Emode |
double | m_ErrSq |
bool | m_inPlace |
double | m_NBg |
bool | m_nullifyNegative |
Kernel::Logger * | m_pgLog |
bool | m_previouslyRemovedBkgMode |
bool | m_singleValueBackground |
const API::SpectrumInfo * | m_spectrumInfo |
API::MatrixWorkspace_const_sptr | m_wkWS |
std::vector< std::unique_ptr< Kernel::Unit > > | m_WSUnit |
Performs removal of constant (and possibly non-constant after simple modification) background calculated in TOF units from a matrix workspace, expressed in units, different from TOF.
Definition at line 40 of file RemoveBackground.h.
Mantid::Algorithms::BackgroundHelper::BackgroundHelper | ( | ) |
Constructor.
Definition at line 147 of file RemoveBackground.cpp.
|
delete |
void Mantid::Algorithms::BackgroundHelper::initialize | ( | const API::MatrixWorkspace_const_sptr & | bkgWS, |
const API::MatrixWorkspace_sptr & | sourceWS, | ||
Kernel::DeltaEMode::Type | emode, | ||
Kernel::Logger * | pLog = nullptr , |
||
int | nThreads = 1 , |
||
bool | inPlace = true , |
||
bool | nullifyNegative = false |
||
) |
Initialization method:
bkgWS | – shared pointer to the workspace which contains background |
sourceWS | – shared pointer to the workspace to remove background from |
emode | – energy conversion mode used during internal units conversion (0 – elastic, 1-direct, 2 indirect, as defined in Units conversion |
pLog | – pointer to the logger class which would report errors |
nThreads | – number of threads to be used for background removal |
inPlace | – if the background removal occurs from the existing workspace |
nullifyNegative | – if true, negative signals are nullified and error is modified appropriately or target workspace has to be cloned. |
Definition at line 164 of file RemoveBackground.cpp.
References m_bgWs, m_dtBg, m_Emode, m_ErrSq, m_inPlace, m_NBg, m_nullifyNegative, m_pgLog, m_previouslyRemovedBkgMode, m_singleValueBackground, m_spectrumInfo, m_wkWS, and m_WSUnit.
Referenced by Mantid::Algorithms::RemoveBackground::exec().
|
delete |
void Mantid::Algorithms::BackgroundHelper::removeBackground | ( | int | nHist, |
HistogramData::HistogramX & | x_data, | ||
HistogramData::HistogramY & | y_data, | ||
HistogramData::HistogramE & | e_data, | ||
int | threadNum = 0 |
||
) | const |
Method removes background from vectors which represent a histogram data for a single spectra.
nHist | – number (workspaceID) of the spectra in the workspace, where background going to be removed |
x_data | – the spectra x-values (presumably not in TOF units) |
y_data | – the spectra signal |
e_data | – the spectra errors |
threadNum | – the number of thread doing conversion (by default 0, single thread, in multithreading – result of omp_get_thread_num() ) |
The error estimate must go up in this nonideal situation and the value of background is a good estimate for it. However, don't reduce the error if it was already more than that
Definition at line 226 of file RemoveBackground.cpp.
References Mantid::Kernel::Logger::debug(), Mantid::API::SpectrumInfo::getDetectorValues(), Mantid::Kernel::Unit::initialize(), Mantid::API::SpectrumInfo::l1(), m_bgWs, m_dtBg, m_Emode, m_ErrSq, m_inPlace, m_NBg, m_nullifyNegative, m_pgLog, m_previouslyRemovedBkgMode, m_singleValueBackground, m_spectrumInfo, m_wkWS, m_WSUnit, Mantid::Kernel::Unit::singleToTOF(), and Mantid::Geometry::X.
Referenced by Mantid::Algorithms::RemoveBackground::exec().
|
private |
Definition at line 60 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().
|
private |
Definition at line 77 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().
|
private |
Definition at line 82 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().
|
private |
Definition at line 80 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().
|
private |
Definition at line 69 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().
|
private |
Definition at line 75 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().
|
private |
Definition at line 84 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().
|
private |
Definition at line 67 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().
|
private |
Definition at line 86 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().
|
private |
Definition at line 72 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().
|
private |
Definition at line 64 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().
|
private |
Definition at line 62 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().
|
private |
Definition at line 57 of file RemoveBackground.h.
Referenced by initialize(), and removeBackground().