Mantid
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | List of all members
Mantid::Crystal::DataModeHandler Class Reference

Integrates each time slice using the BivariateNormal formula, adding the results to the peak object. More...

#include <IntegratePeakTimeSlices.h>

Public Member Functions

std::string CalcConstraints (std::vector< std::pair< double, double > > &Bounds, bool CalcVariances)
 Calculates the string form of the constraints to be sent to the Fit Algorithm and also saves it in a vector form. More...
 
double CalcISAWIntensity (const double *params)
 Calculates the Intensity designed for Edge Peaks. More...
 
double CalcISAWIntensityVariance (const double *params, const double *errs, double chiSqOvDOF)
 Calculates the Error in the Intensity designed for Edge Peaks. More...
 
double CalcSampleIntensityMultiplier (const double *params) const
 For Edge Peaks. More...
 
bool CalcVariances ()
 Determines whether the Variances can be calculated. More...
 
void CalcVariancesFromData (double background, double meanx, double meany, double &Varxx, double &Varxy, double &Varyy, const std::vector< double > &StatBase)
 Utility method to calculate variances from data given background and means. More...
 
 DataModeHandler ()
 
 DataModeHandler (const DataModeHandler &handler)
 Constructor for class that holds mode and various settings. More...
 
 DataModeHandler (double baseRCRadius, double lastRCRadius, double lastRow, double lastCol, double CellWidth, double CellHeight, bool CalcVariance, int MinCol, int MaxCol, int MinRow, int MaxRow)
 
Kernel::V3D getCurrentCenter ()
 
double getCurrentRadius ()
 
double getInitBackground ()
 
double getInitCol ()
 
double getInitIntensity ()
 
double getInitRow ()
 
double getInitVarx ()
 
double getInitVarxy ()
 
double getInitVary ()
 
double getNewRCRadius ()
 Calculates the new radius for neighborhoods so as to include almost all of a peak. More...
 
std::vector< double > GetParams (double b)
 Calculates the initial values of the parameters given background b. More...
 
std::string getTies ()
 
std::vector< double > InitValues (double Varx, double Vary, double b)
 Returns init values with background and variances replaced by arguments. More...
 
bool isEdgePeak (const double *params, int nparams)
 Determines if a Peak is an edge peak. More...
 
bool IsEnoughData (const double *ParameterValues, Kernel::Logger &)
 Calculates if there is enough data to for there to be a peak. More...
 
void setCurrentCenter (const Kernel::V3D &newCenter)
 
void setCurrentRadius (double radius)
 
void setHeightHalfWidthInfo (const MantidVec &xvals, const MantidVec &yvals, const MantidVec &counts)
 For edge peaks, the sample standard deviations do not work. More...
 
bool setStatBase (std::vector< double > const &StatBase)
 Sets the Accumulated data values into this class, then updates other information like initial values. More...
 
void setTime (double time)
 
double StatBaseVals (int index)
 
void updateEdgeXsize (double newsize)
 
void updateEdgeYsize (double newsize)
 

Public Attributes

double back_calc
 
double baseRCRadius
 
double calcNewRCRadius
 
bool CalcVariance
 
bool case4
 
double CellHeight
 
double CellWidth
 
double col_calc
 
Kernel::V3D currentPosition
 
double currentRadius
 
double EdgeX
 
double EdgeY
 
double HalfWidthAtHalfHeightRadius
 
double Intensity_calc
 
double lastCol
 
double lastISAWIntensity
 
double lastISAWVariance
 
double lastRCRadius
 
double lastRow
 
int MaxCol
 
int MaxRow
 
int MinCol
 
int MinRow
 
double row_calc
 
std::vector< double > StatBase
 
double time
 
double VarxHW
 
double VaryHW
 
double Vx_calc
 
double Vxy_calc
 
double Vy_calc
 

Private Member Functions

void init ()
 

Detailed Description

Integrates each time slice using the BivariateNormal formula, adding the results to the peak object.

Author
Ruth Mikkelson, SNS, ORNL
Date
06/06/2011

Definition at line 47 of file IntegratePeakTimeSlices.h.

Constructor & Destructor Documentation

◆ DataModeHandler() [1/3]

Mantid::Crystal::DataModeHandler::DataModeHandler ( )
inline

Definition at line 49 of file IntegratePeakTimeSlices.h.

References init().

◆ DataModeHandler() [2/3]

Mantid::Crystal::DataModeHandler::DataModeHandler ( const DataModeHandler handler)

Constructor for class that holds mode and various settings.

Parameters
handlerCopy(deep) constructor. The other handler to copy info from.

Definition at line 1652 of file IntegratePeakTimeSlices.cpp.

References back_calc, baseRCRadius, calcNewRCRadius, CalcVariance, case4, CellHeight, CellWidth, col_calc, currentPosition, currentRadius, EdgeX, EdgeY, HalfWidthAtHalfHeightRadius, Intensity_calc, lastCol, lastISAWIntensity, lastISAWVariance, lastRCRadius, lastRow, MaxCol, MaxRow, MinCol, MinRow, row_calc, StatBase, time, VarxHW, VaryHW, Vx_calc, Vxy_calc, and Vy_calc.

◆ DataModeHandler() [3/3]

Mantid::Crystal::DataModeHandler::DataModeHandler ( double  baseRCRadius,
double  lastRCRadius,
double  lastRow,
double  lastCol,
double  CellWidth,
double  CellHeight,
bool  CalcVariance,
int  MinCol,
int  MaxCol,
int  MinRow,
int  MaxRow 
)
inline

Member Function Documentation

◆ CalcConstraints()

std::string Mantid::Crystal::DataModeHandler::CalcConstraints ( std::vector< std::pair< double, double > > &  Bounds,
bool  CalcVariances 
)

Calculates the string form of the constraints to be sent to the Fit Algorithm and also saves it in a vector form.

Parameters
BoundsThe vector form for the constraints
CalcVariancesThe to trigger variance calculation

Definition at line 1732 of file IntegratePeakTimeSlices.cpp.

References back_calc, CalcVariances(), col_calc, IIntensities, INBoundary, Intensity_calc, ISS1, ITotBoundary, IVarBoundary, IVariance, MaxCol, MaxRow, MinCol, MinRow, NParameters, row_calc, StatBase, VarxHW, VaryHW, Vx_calc, and Vy_calc.

◆ CalcISAWIntensity()

double Mantid::Crystal::DataModeHandler::CalcISAWIntensity ( const double *  params)

Calculates the Intensity designed for Edge Peaks.

Parameters
paramsThe Fitted parameters
Returns
this calculated intensity

Also the variable lastISAWIntensity was updated.

Definition at line 2400 of file IntegratePeakTimeSlices.cpp.

References CalcSampleIntensityMultiplier(), IBACK, IIntensities, ISS1, lastISAWIntensity, and StatBase.

◆ CalcISAWIntensityVariance()

double Mantid::Crystal::DataModeHandler::CalcISAWIntensityVariance ( const double *  params,
const double *  errs,
double  chiSqOvDOF 
)

Calculates the Error in the Intensity designed for Edge Peaks.

Parameters
paramsThe fitted parameter values
errsThe error in these fitted parameters
chiSqOvDOFThe fitting error
Returns
this calculated error in the intensity

Definition at line 2422 of file IntegratePeakTimeSlices.cpp.

References CalcSampleIntensityMultiplier(), IBACK, ISS1, IVariance, lastISAWVariance, and StatBase.

◆ CalcSampleIntensityMultiplier()

double Mantid::Crystal::DataModeHandler::CalcSampleIntensityMultiplier ( const double *  params) const

For Edge Peaks.

Calculates the multiplier of TotIntensity - background for edge peaks to correspond to the missing data.

Parameters
paramsthe parameter values
Returns
The multiplier the should adjust the TotIntensity-background for an EdgePeak

Definition at line 2450 of file IntegratePeakTimeSlices.cpp.

References INCol, INRows, IStartCol, IStartRow, IVXX, IVYY, IXMEAN, IYMEAN, MaxCol, MaxRow, MinCol, MinRow, and StatBase.

Referenced by CalcISAWIntensity(), CalcISAWIntensityVariance(), and setStatBase().

◆ CalcVariances()

bool Mantid::Crystal::DataModeHandler::CalcVariances ( )

Determines whether the Variances can be calculated.

If specified yes and the peak is an edge peak then the Variances cannot be calculated.

Returns
true if the Variances desire to be and can be calculated, otherwise false

Definition at line 2383 of file IntegratePeakTimeSlices.cpp.

References back_calc, CalcVariance, col_calc, Intensity_calc, isEdgePeak(), row_calc, Vx_calc, Vxy_calc, and Vy_calc.

Referenced by CalcConstraints(), CalcVariancesFromData(), and IsEnoughData().

◆ CalcVariancesFromData()

void Mantid::Crystal::DataModeHandler::CalcVariancesFromData ( double  background,
double  meanx,
double  meany,
double &  Varxx,
double &  Varxy,
double &  Varyy,
const std::vector< double > &  StatBase 
)

Utility method to calculate variances from data given background and means.

Parameters
background- the background to use
meanx- the mean x( col) value to use
meany- the mean y( row) value to use
Varxx- The resultant variance in the x values around above mean with background removed
Varyy- The resultant variance in the y values around above mean with background removed
Varxy- The resultant covariance in the x and values around above mean with background removed
StatBase- The "data".

Definition at line 1700 of file IntegratePeakTimeSlices.cpp.

References CalcVariances(), getInitVarx(), getInitVary(), IIntensities, ISS1, ISSIx, ISSIxx, ISSIxy, ISSIy, ISSIyy, ISSx, ISSxx, ISSxy, ISSy, ISSyy, and StatBase.

Referenced by IsEnoughData().

◆ getCurrentCenter()

Kernel::V3D Mantid::Crystal::DataModeHandler::getCurrentCenter ( )
inline

Definition at line 84 of file IntegratePeakTimeSlices.h.

References currentPosition.

◆ getCurrentRadius()

double Mantid::Crystal::DataModeHandler::getCurrentRadius ( )
inline

Definition at line 83 of file IntegratePeakTimeSlices.h.

References currentRadius.

◆ getInitBackground()

double Mantid::Crystal::DataModeHandler::getInitBackground ( )
inline

Definition at line 112 of file IntegratePeakTimeSlices.h.

References back_calc.

◆ getInitCol()

double Mantid::Crystal::DataModeHandler::getInitCol ( )
inline

Definition at line 116 of file IntegratePeakTimeSlices.h.

References col_calc.

◆ getInitIntensity()

double Mantid::Crystal::DataModeHandler::getInitIntensity ( )
inline

Definition at line 118 of file IntegratePeakTimeSlices.h.

References Intensity_calc.

◆ getInitRow()

double Mantid::Crystal::DataModeHandler::getInitRow ( )
inline

Definition at line 114 of file IntegratePeakTimeSlices.h.

References row_calc.

◆ getInitVarx()

double Mantid::Crystal::DataModeHandler::getInitVarx ( )
inline

Definition at line 120 of file IntegratePeakTimeSlices.h.

References Vx_calc.

Referenced by CalcVariancesFromData().

◆ getInitVarxy()

double Mantid::Crystal::DataModeHandler::getInitVarxy ( )
inline

Definition at line 124 of file IntegratePeakTimeSlices.h.

References Vxy_calc.

◆ getInitVary()

double Mantid::Crystal::DataModeHandler::getInitVary ( )
inline

Definition at line 122 of file IntegratePeakTimeSlices.h.

References Vy_calc.

Referenced by CalcVariancesFromData().

◆ getNewRCRadius()

double Mantid::Crystal::DataModeHandler::getNewRCRadius ( )

Calculates the new radius for neighborhoods so as to include almost all of a peak.

Returns
the new radius

Definition at line 1102 of file IntegratePeakTimeSlices.cpp.

References baseRCRadius, CellHeight, CellWidth, EdgeX, EdgeY, HalfWidthAtHalfHeightRadius, lastRCRadius, VarxHW, VaryHW, Vx_calc, and Vy_calc.

◆ GetParams()

std::vector< double > Mantid::Crystal::DataModeHandler::GetParams ( double  b)

Calculates the initial values of the parameters given background b.

Used only in the PreFit method that is not used.

Parameters
bthe background
Returns
The vector of parameter values.

Definition at line 952 of file IntegratePeakTimeSlices.cpp.

References CellHeight, CellWidth, EdgeX, EdgeY, HalfWidthAtHalfHeightRadius, IBACK, IIntensities, InitValues(), ISS1, ISSIx, ISSIxx, ISSIxy, ISSIy, ISSIyy, ISSx, ISSxx, ISSxy, ISSy, ISSyy, ITINTENS, IVXX, IVXY, IVYY, IXMEAN, IYMEAN, lastRCRadius, StatBase, VarxHW, and VaryHW.

◆ getTies()

std::string Mantid::Crystal::DataModeHandler::getTies ( )
inline

Definition at line 127 of file IntegratePeakTimeSlices.h.

◆ init()

void Mantid::Crystal::DataModeHandler::init ( )
inlineprivate

◆ InitValues()

std::vector< double > Mantid::Crystal::DataModeHandler::InitValues ( double  Varx,
double  Vary,
double  b 
)

Returns init values with background and variances replaced by arguments.

Finds and saves the initial values and modes( like isEdge) for this data.

Varxy=0

Parameters
VarxThe Variance of the x(column) values
VaryThe Variance of the y(row) values
bThe background

NOTE:Used only in GetParams which is used only in PreFit which is not currently used.

Definition at line 895 of file IntegratePeakTimeSlices.cpp.

References CellHeight, CellWidth, currentRadius, EdgeX, EdgeY, IBACK, IIntensities, INCol, INRows, ISS1, ISSIx, ISSIy, ISSx, ISSy, IStartCol, IStartRow, ITINTENS, IVXX, IVXY, IVYY, IXMEAN, IYMEAN, StatBase, and Mantid::Geometry::x.

Referenced by GetParams().

◆ isEdgePeak()

bool Mantid::Crystal::DataModeHandler::isEdgePeak ( const double *  params,
int  nparams 
)

Determines if a Peak is an edge peak.

Parameters
paramsThe list of parameter values
nparamsThe number of parameters
Returns
true if it is an edge peak, otherwise false.

Definition at line 1584 of file IntegratePeakTimeSlices.cpp.

References CellHeight, CellWidth, EdgeX, EdgeY, HalfWidthAtHalfHeightRadius, IVXX, IVYY, lastRCRadius, VarxHW, and VaryHW.

Referenced by CalcVariances().

◆ IsEnoughData()

bool Mantid::Crystal::DataModeHandler::IsEnoughData ( const double *  ParameterValues,
Kernel::Logger  
)

Calculates if there is enough data to for there to be a peak.

Parameters
ParameterValuespointer to the parameter values
Returns
true if there is enough data, otherwise false

Definition at line 2155 of file IntegratePeakTimeSlices.cpp.

References CalcVariances(), CalcVariancesFromData(), IIntensities, ISSIx, ISSIy, IVXX, IVXY, IVYY, and StatBase.

◆ setCurrentCenter()

void Mantid::Crystal::DataModeHandler::setCurrentCenter ( const Kernel::V3D newCenter)
inline

Definition at line 78 of file IntegratePeakTimeSlices.h.

References currentPosition.

◆ setCurrentRadius()

void Mantid::Crystal::DataModeHandler::setCurrentRadius ( double  radius)
inline

Definition at line 77 of file IntegratePeakTimeSlices.h.

References currentRadius, and radius.

◆ setHeightHalfWidthInfo()

void Mantid::Crystal::DataModeHandler::setHeightHalfWidthInfo ( const MantidVec xvals,
const MantidVec yvals,
const MantidVec counts 
)

For edge peaks, the sample standard deviations do not work.

This attempts to estimate the peak widths by using half width at half max idea

Parameters
xvalsThe x(column) values of the data to be considered
yvalsThe y(row) values of the data to be considered
countsThe intensity at the given row and column (and timeslice)

Definition at line 1144 of file IntegratePeakTimeSlices.cpp.

References fabs, HalfWidthAtHalfHeightRadius, VarxHW, VaryHW, Mantid::Geometry::X, and Mantid::Geometry::Y.

◆ setStatBase()

bool Mantid::Crystal::DataModeHandler::setStatBase ( std::vector< double > const &  statBase)

Sets the Accumulated data values into this class, then updates other information like initial values.

Parameters
statBaseThe accumulated data that is to be considered.

Definition at line 1003 of file IntegratePeakTimeSlices.cpp.

References back_calc, CalcSampleIntensityMultiplier(), CellHeight, CellWidth, col_calc, currentRadius, EdgeX, EdgeY, HalfWidthAtHalfHeightRadius, IIntensities, INBoundary, INCol, INRows, Intensity_calc, ISS1, ISSIx, ISSIxx, ISSIxy, ISSIy, ISSIyy, ISSx, ISSxx, ISSxy, ISSy, ISSyy, ITotBoundary, lastCol, lastRCRadius, lastRow, row_calc, StatBase, VarxHW, VaryHW, Vx_calc, Vxy_calc, and Vy_calc.

◆ setTime()

void Mantid::Crystal::DataModeHandler::setTime ( double  time)
inline

Definition at line 68 of file IntegratePeakTimeSlices.h.

References time.

◆ StatBaseVals()

double Mantid::Crystal::DataModeHandler::StatBaseVals ( int  index)
inline

Definition at line 133 of file IntegratePeakTimeSlices.h.

References StatBase.

◆ updateEdgeXsize()

void Mantid::Crystal::DataModeHandler::updateEdgeXsize ( double  newsize)
inline

Definition at line 85 of file IntegratePeakTimeSlices.h.

References EdgeX.

◆ updateEdgeYsize()

void Mantid::Crystal::DataModeHandler::updateEdgeYsize ( double  newsize)
inline

Definition at line 95 of file IntegratePeakTimeSlices.h.

References EdgeY.

Member Data Documentation

◆ back_calc

double Mantid::Crystal::DataModeHandler::back_calc

◆ baseRCRadius

double Mantid::Crystal::DataModeHandler::baseRCRadius

Definition at line 154 of file IntegratePeakTimeSlices.h.

Referenced by DataModeHandler(), getNewRCRadius(), and init().

◆ calcNewRCRadius

double Mantid::Crystal::DataModeHandler::calcNewRCRadius

Definition at line 157 of file IntegratePeakTimeSlices.h.

Referenced by DataModeHandler(), and init().

◆ CalcVariance

bool Mantid::Crystal::DataModeHandler::CalcVariance

Definition at line 174 of file IntegratePeakTimeSlices.h.

Referenced by CalcVariances(), DataModeHandler(), and init().

◆ case4

bool Mantid::Crystal::DataModeHandler::case4

Definition at line 175 of file IntegratePeakTimeSlices.h.

Referenced by DataModeHandler(), and init().

◆ CellHeight

double Mantid::Crystal::DataModeHandler::CellHeight

◆ CellWidth

double Mantid::Crystal::DataModeHandler::CellWidth

◆ col_calc

double Mantid::Crystal::DataModeHandler::col_calc

◆ currentPosition

Kernel::V3D Mantid::Crystal::DataModeHandler::currentPosition

◆ currentRadius

double Mantid::Crystal::DataModeHandler::currentRadius

◆ EdgeX

double Mantid::Crystal::DataModeHandler::EdgeX

◆ EdgeY

double Mantid::Crystal::DataModeHandler::EdgeY

◆ HalfWidthAtHalfHeightRadius

double Mantid::Crystal::DataModeHandler::HalfWidthAtHalfHeightRadius

◆ Intensity_calc

double Mantid::Crystal::DataModeHandler::Intensity_calc

◆ lastCol

double Mantid::Crystal::DataModeHandler::lastCol

Definition at line 161 of file IntegratePeakTimeSlices.h.

Referenced by DataModeHandler(), init(), and setStatBase().

◆ lastISAWIntensity

double Mantid::Crystal::DataModeHandler::lastISAWIntensity

Definition at line 173 of file IntegratePeakTimeSlices.h.

Referenced by CalcISAWIntensity(), DataModeHandler(), and init().

◆ lastISAWVariance

double Mantid::Crystal::DataModeHandler::lastISAWVariance

Definition at line 173 of file IntegratePeakTimeSlices.h.

Referenced by CalcISAWIntensityVariance(), DataModeHandler(), and init().

◆ lastRCRadius

double Mantid::Crystal::DataModeHandler::lastRCRadius

◆ lastRow

double Mantid::Crystal::DataModeHandler::lastRow

Definition at line 159 of file IntegratePeakTimeSlices.h.

Referenced by DataModeHandler(), init(), and setStatBase().

◆ MaxCol

int Mantid::Crystal::DataModeHandler::MaxCol

◆ MaxRow

int Mantid::Crystal::DataModeHandler::MaxRow

◆ MinCol

int Mantid::Crystal::DataModeHandler::MinCol

◆ MinRow

int Mantid::Crystal::DataModeHandler::MinRow

◆ row_calc

double Mantid::Crystal::DataModeHandler::row_calc

◆ StatBase

std::vector<double> Mantid::Crystal::DataModeHandler::StatBase

◆ time

double Mantid::Crystal::DataModeHandler::time

Definition at line 163 of file IntegratePeakTimeSlices.h.

Referenced by DataModeHandler(), init(), and setTime().

◆ VarxHW

double Mantid::Crystal::DataModeHandler::VarxHW

◆ VaryHW

double Mantid::Crystal::DataModeHandler::VaryHW

◆ Vx_calc

double Mantid::Crystal::DataModeHandler::Vx_calc

◆ Vxy_calc

double Mantid::Crystal::DataModeHandler::Vxy_calc

◆ Vy_calc

double Mantid::Crystal::DataModeHandler::Vy_calc

The documentation for this class was generated from the following files: