Mantid
Loading...
Searching...
No Matches
Namespaces | Functions
IntegrateMDHistoWorkspace.cpp File Reference
#include "MantidMDAlgorithms/IntegrateMDHistoWorkspace.h"
#include "MantidKernel/ArrayProperty.h"
#include "MantidKernel/MultiThreaded.h"
#include "MantidAPI/FrameworkManager.h"
#include "MantidAPI/IMDHistoWorkspace.h"
#include "MantidAPI/IMDIterator.h"
#include "MantidAPI/Progress.h"
#include "MantidDataObjects/MDHistoWorkspace.h"
#include "MantidDataObjects/MDHistoWorkspaceIterator.h"
#include "MantidGeometry/MDGeometry/MDBoxImplicitFunction.h"
#include "MantidGeometry/MDGeometry/MDHistoDimension.h"
#include <algorithm>
#include <cmath>
#include <map>
#include <utility>
#include <memory>

Go to the source code of this file.

Namespaces

namespace  Mantid
 Helper class which provides the Collimation Length for SANS instruments.
 
namespace  Mantid::MDAlgorithms
 

Functions

MDHistoWorkspace_sptr createShapedOutput (IMDHistoWorkspace const *const inWS, std::vector< std::vector< double > > pbins, Logger &logger)
 Create the output workspace in the right shape. More...
 
void performWeightedSum (MDHistoWorkspaceIterator const *const iterator, const MDBoxImplicitFunction &box, double &sumSignal, double &sumSQErrors, double &sumNEvents)
 Perform a weighted sum at the iterator position. More...
 

Function Documentation

◆ createShapedOutput()

MDHistoWorkspace_sptr createShapedOutput ( IMDHistoWorkspace const *const  inWS,
std::vector< std::vector< double > >  pbins,
Logger logger 
)

Create the output workspace in the right shape.

Parameters
inWS: Input workspace for dimensionality
pbins: User provided binning
logger: Logging object
Returns

Definition at line 178 of file IntegrateMDHistoWorkspace.cpp.

References Mantid::API::MDGeometry::getDimension(), and Mantid::API::MDGeometry::getNumDims().

Referenced by Mantid::MDAlgorithms::IntegrateMDHistoWorkspace::exec().

◆ performWeightedSum()

void performWeightedSum ( MDHistoWorkspaceIterator const *const  iterator,
const MDBoxImplicitFunction box,
double &  sumSignal,
double &  sumSQErrors,
double &  sumNEvents 
)

Perform a weighted sum at the iterator position.

This function does not increment the iterator. Masked bins do not contribute.

Parameters
iterator: Iterator to use in sum
box: Box implicit function defining valid region.
sumSignal: Accumlation in/out ref.
sumSQErrors: Accumulation error in/out ref. Squared value.
sumNEvents: Accumulation n_event in/out ref.

Definition at line 217 of file IntegrateMDHistoWorkspace.cpp.

References error, Mantid::Geometry::MDBoxImplicitFunction::fraction(), Mantid::DataObjects::MDHistoWorkspaceIterator::getBoxExtents(), Mantid::DataObjects::MDHistoWorkspaceIterator::getError(), Mantid::DataObjects::MDHistoWorkspaceIterator::getIsMasked(), Mantid::DataObjects::MDHistoWorkspaceIterator::getNumEventsFraction(), and Mantid::DataObjects::MDHistoWorkspaceIterator::getSignal().

Referenced by Mantid::MDAlgorithms::IntegrateMDHistoWorkspace::exec().