Commit 6e93c13c authored by Walsh, Michael's avatar Walsh, Michael
Browse files

added doc strings

parent 88743037
......@@ -66,10 +66,32 @@ private:
/// Execution code
void exec() override;
/// Helper functions
/** Iterates through spectrum in the input workspace finding the center of mass until
* we converge to within the tolerance specified in meters
*
* @param inputWS :: workspace to find the center of mass of
* @param centerX :: save the real center of mass x coord here
* @param centerY :: save the real center of mass y coord here
* @param numSpec :: number of spectrum in the workspace to iterate through
* @param progress :: object for reporting progress of the operation
*/
void findCenterOfMass(API::MatrixWorkspace_sptr inputWS, double &centerX, double &centerY, const int numSpec,
API::Progress &progress);
/** Integrate events in the inputEventWS to determine thier sum and error values
*
* @param inputEventWS :: event workspace to ingegrate
* @param numSpec :: number of events in the workspace to iterate through
* @param progress :: object for reporting progress of the operation
* @return workspace containing the calculated x, y, and e data over numSpec
*/
API::MatrixWorkspace_sptr sumUsingSpectra(DataObjects::EventWorkspace_const_sptr inputEventWS, const int numSpec,
API::Progress &progress);
/** Package the algorithm outputs one of two ways depending on whether or
* not it was given an input EventWorkspace to start with
*
* @param centerX :: center of mass x coord to package
* @param centerY :: center of mass y coord to package
*/
void storeOutputWorkspace(double centerX, double centerY);
// Iteration cutoff
const int m_maxIteration = 200;
......
......@@ -38,12 +38,52 @@ public:
double calculateDistance();
double calculateRadiusX();
double calculateRadiusY();
/** Sets member variables x/y to new x/y based on
* spectrum info and historgram data at the given index
*
* @param index :: index of spectrum data
* @return number of points of histogram data at index
*/
double updatePositionAndReturnCount(int index);
/** Searches for the first valid spectrum info in member variable `workspace`
*
* @param numSpec :: the number of spectrum in the workspace to search through
* @return index of first valid spectrum
*/
int findFirstValidWs(const int numSpec);
/** Performs checks on the spectrum located at index to determine if
* it is acceptable to be operated on
*
* @param index :: index of spectrum data
* @return true/false if its valid
*/
bool isValidWs(int index);
bool isOutOfBoundsOfNonDirectBeam(const double beam_radius, int index, const bool direct_beam);
/** Checks to see if spectrum at index is within the diameter of the given beamRadius
*
* @param beamRadius :: radius of beam in meters
* @param index :: index of spectrum data
* @param directBeam :: whether or not the spectrum is subject to the beam
* @return number of points of histogram data at index
*/
bool isOutOfBoundsOfNonDirectBeam(const double beamRadius, int index, const bool directBeam);
/** Checks if a given x/y coord is within the bounding box
*
* @param x :: x coordinate
* @param y :: y coordinate
* @return true/false if it is within the mins/maxs of the box
*/
bool containsPoint(double x, double y);
/** Perform normalization on x/y coords over given values
*
* @param x :: value to normalize member x over
* @param y :: value to normalize member y over
*/
void normalizePosition(double x, double y);
/** Compare current mins and maxs to the coordinates of the spectrum at index
* expnd mins and maxs to include this spectrum
*
* @param index :: index of spectrum data
*/
void updateMinMax(int index);
private:
......
Supports Markdown
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