Mantid
|
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 () |
Integrates each time slice using the BivariateNormal formula, adding the results to the peak object.
Definition at line 47 of file IntegratePeakTimeSlices.h.
|
inline |
Definition at line 49 of file IntegratePeakTimeSlices.h.
References init().
Mantid::Crystal::DataModeHandler::DataModeHandler | ( | const DataModeHandler & | handler | ) |
Constructor for class that holds mode and various settings.
handler | Copy(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.
|
inline |
Definition at line 52 of file IntegratePeakTimeSlices.h.
References baseRCRadius, CalcVariance, CellHeight, CellWidth, init(), lastCol, lastRCRadius, lastRow, MaxCol, MaxRow, MinCol, and MinRow.
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.
Bounds | The vector form for the constraints |
CalcVariances | The 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.
double Mantid::Crystal::DataModeHandler::CalcISAWIntensity | ( | const double * | params | ) |
Calculates the Intensity designed for Edge Peaks.
params | The Fitted parameters |
Also the variable lastISAWIntensity was updated.
Definition at line 2400 of file IntegratePeakTimeSlices.cpp.
References CalcSampleIntensityMultiplier(), IBACK, IIntensities, ISS1, lastISAWIntensity, and StatBase.
double Mantid::Crystal::DataModeHandler::CalcISAWIntensityVariance | ( | const double * | params, |
const double * | errs, | ||
double | chiSqOvDOF | ||
) |
Calculates the Error in the Intensity designed for Edge Peaks.
params | The fitted parameter values |
errs | The error in these fitted parameters |
chiSqOvDOF | The fitting error |
Definition at line 2422 of file IntegratePeakTimeSlices.cpp.
References CalcSampleIntensityMultiplier(), IBACK, ISS1, IVariance, lastISAWVariance, and StatBase.
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.
params | the parameter values |
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().
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.
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().
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.
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().
|
inline |
Definition at line 84 of file IntegratePeakTimeSlices.h.
References currentPosition.
|
inline |
Definition at line 83 of file IntegratePeakTimeSlices.h.
References currentRadius.
|
inline |
Definition at line 112 of file IntegratePeakTimeSlices.h.
References back_calc.
|
inline |
Definition at line 116 of file IntegratePeakTimeSlices.h.
References col_calc.
|
inline |
Definition at line 118 of file IntegratePeakTimeSlices.h.
References Intensity_calc.
|
inline |
Definition at line 114 of file IntegratePeakTimeSlices.h.
References row_calc.
|
inline |
Definition at line 120 of file IntegratePeakTimeSlices.h.
References Vx_calc.
Referenced by CalcVariancesFromData().
|
inline |
Definition at line 124 of file IntegratePeakTimeSlices.h.
References Vxy_calc.
|
inline |
Definition at line 122 of file IntegratePeakTimeSlices.h.
References Vy_calc.
Referenced by CalcVariancesFromData().
double Mantid::Crystal::DataModeHandler::getNewRCRadius | ( | ) |
Calculates the new radius for neighborhoods so as to include almost all of a peak.
Definition at line 1102 of file IntegratePeakTimeSlices.cpp.
References baseRCRadius, CellHeight, CellWidth, EdgeX, EdgeY, HalfWidthAtHalfHeightRadius, lastRCRadius, VarxHW, VaryHW, Vx_calc, and Vy_calc.
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.
b | the background |
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.
|
inline |
Definition at line 127 of file IntegratePeakTimeSlices.h.
|
inlineprivate |
Definition at line 179 of file IntegratePeakTimeSlices.h.
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, time, VarxHW, VaryHW, Vx_calc, Vxy_calc, and Vy_calc.
Referenced by DataModeHandler().
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
Varx | The Variance of the x(column) values |
Vary | The Variance of the y(row) values |
b | The 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().
bool Mantid::Crystal::DataModeHandler::isEdgePeak | ( | const double * | params, |
int | nparams | ||
) |
Determines if a Peak is an edge peak.
params | The list of parameter values |
nparams | The number of parameters |
Definition at line 1584 of file IntegratePeakTimeSlices.cpp.
References CellHeight, CellWidth, EdgeX, EdgeY, HalfWidthAtHalfHeightRadius, IVXX, IVYY, lastRCRadius, VarxHW, and VaryHW.
Referenced by CalcVariances().
bool Mantid::Crystal::DataModeHandler::IsEnoughData | ( | const double * | ParameterValues, |
Kernel::Logger & | |||
) |
Calculates if there is enough data to for there to be a peak.
ParameterValues | pointer to the parameter values |
Definition at line 2155 of file IntegratePeakTimeSlices.cpp.
References CalcVariances(), CalcVariancesFromData(), IIntensities, ISSIx, ISSIy, IVXX, IVXY, IVYY, and StatBase.
|
inline |
Definition at line 78 of file IntegratePeakTimeSlices.h.
References currentPosition.
|
inline |
Definition at line 77 of file IntegratePeakTimeSlices.h.
References currentRadius, and radius.
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
xvals | The x(column) values of the data to be considered |
yvals | The y(row) values of the data to be considered |
counts | The 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.
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.
statBase | The 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.
|
inline |
Definition at line 68 of file IntegratePeakTimeSlices.h.
References time.
|
inline |
Definition at line 133 of file IntegratePeakTimeSlices.h.
References StatBase.
|
inline |
Definition at line 85 of file IntegratePeakTimeSlices.h.
References EdgeX.
|
inline |
Definition at line 95 of file IntegratePeakTimeSlices.h.
References EdgeY.
double Mantid::Crystal::DataModeHandler::back_calc |
Definition at line 176 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), CalcVariances(), DataModeHandler(), getInitBackground(), init(), and setStatBase().
double Mantid::Crystal::DataModeHandler::baseRCRadius |
Definition at line 154 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), getNewRCRadius(), and init().
double Mantid::Crystal::DataModeHandler::calcNewRCRadius |
Definition at line 157 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), and init().
bool Mantid::Crystal::DataModeHandler::CalcVariance |
Definition at line 174 of file IntegratePeakTimeSlices.h.
Referenced by CalcVariances(), DataModeHandler(), and init().
bool Mantid::Crystal::DataModeHandler::case4 |
Definition at line 175 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), and init().
double Mantid::Crystal::DataModeHandler::CellHeight |
Definition at line 165 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), getNewRCRadius(), GetParams(), init(), InitValues(), isEdgePeak(), and setStatBase().
double Mantid::Crystal::DataModeHandler::CellWidth |
Definition at line 164 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), getNewRCRadius(), GetParams(), init(), InitValues(), isEdgePeak(), and setStatBase().
double Mantid::Crystal::DataModeHandler::col_calc |
Definition at line 176 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), CalcVariances(), DataModeHandler(), getInitCol(), init(), and setStatBase().
Kernel::V3D Mantid::Crystal::DataModeHandler::currentPosition |
Definition at line 169 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), getCurrentCenter(), init(), and setCurrentCenter().
double Mantid::Crystal::DataModeHandler::currentRadius |
Definition at line 168 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), getCurrentRadius(), init(), InitValues(), setCurrentRadius(), and setStatBase().
double Mantid::Crystal::DataModeHandler::EdgeX |
Definition at line 172 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), getNewRCRadius(), GetParams(), init(), InitValues(), isEdgePeak(), setStatBase(), and updateEdgeXsize().
double Mantid::Crystal::DataModeHandler::EdgeY |
Definition at line 172 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), getNewRCRadius(), GetParams(), init(), InitValues(), isEdgePeak(), setStatBase(), and updateEdgeYsize().
double Mantid::Crystal::DataModeHandler::HalfWidthAtHalfHeightRadius |
Definition at line 156 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), getNewRCRadius(), GetParams(), init(), isEdgePeak(), setHeightHalfWidthInfo(), and setStatBase().
double Mantid::Crystal::DataModeHandler::Intensity_calc |
Definition at line 176 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), CalcVariances(), DataModeHandler(), getInitIntensity(), init(), and setStatBase().
double Mantid::Crystal::DataModeHandler::lastCol |
Definition at line 161 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), init(), and setStatBase().
double Mantid::Crystal::DataModeHandler::lastISAWIntensity |
Definition at line 173 of file IntegratePeakTimeSlices.h.
Referenced by CalcISAWIntensity(), DataModeHandler(), and init().
double Mantid::Crystal::DataModeHandler::lastISAWVariance |
Definition at line 173 of file IntegratePeakTimeSlices.h.
Referenced by CalcISAWIntensityVariance(), DataModeHandler(), and init().
double Mantid::Crystal::DataModeHandler::lastRCRadius |
Definition at line 155 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), getNewRCRadius(), GetParams(), init(), isEdgePeak(), and setStatBase().
double Mantid::Crystal::DataModeHandler::lastRow |
Definition at line 159 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), init(), and setStatBase().
int Mantid::Crystal::DataModeHandler::MaxCol |
Definition at line 162 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), CalcSampleIntensityMultiplier(), DataModeHandler(), and init().
int Mantid::Crystal::DataModeHandler::MaxRow |
Definition at line 160 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), CalcSampleIntensityMultiplier(), DataModeHandler(), and init().
int Mantid::Crystal::DataModeHandler::MinCol |
Definition at line 162 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), CalcSampleIntensityMultiplier(), DataModeHandler(), and init().
int Mantid::Crystal::DataModeHandler::MinRow |
Definition at line 160 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), CalcSampleIntensityMultiplier(), DataModeHandler(), and init().
double Mantid::Crystal::DataModeHandler::row_calc |
Definition at line 176 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), CalcVariances(), DataModeHandler(), getInitRow(), init(), and setStatBase().
std::vector<double> Mantid::Crystal::DataModeHandler::StatBase |
Definition at line 170 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), CalcISAWIntensity(), CalcISAWIntensityVariance(), CalcSampleIntensityMultiplier(), CalcVariancesFromData(), DataModeHandler(), GetParams(), InitValues(), IsEnoughData(), setStatBase(), and StatBaseVals().
double Mantid::Crystal::DataModeHandler::time |
Definition at line 163 of file IntegratePeakTimeSlices.h.
Referenced by DataModeHandler(), init(), and setTime().
double Mantid::Crystal::DataModeHandler::VarxHW |
Definition at line 167 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), DataModeHandler(), getNewRCRadius(), GetParams(), init(), isEdgePeak(), setHeightHalfWidthInfo(), and setStatBase().
double Mantid::Crystal::DataModeHandler::VaryHW |
Definition at line 167 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), DataModeHandler(), getNewRCRadius(), GetParams(), init(), isEdgePeak(), setHeightHalfWidthInfo(), and setStatBase().
double Mantid::Crystal::DataModeHandler::Vx_calc |
Definition at line 176 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), CalcVariances(), DataModeHandler(), getInitVarx(), getNewRCRadius(), init(), and setStatBase().
double Mantid::Crystal::DataModeHandler::Vxy_calc |
Definition at line 176 of file IntegratePeakTimeSlices.h.
Referenced by CalcVariances(), DataModeHandler(), getInitVarxy(), init(), and setStatBase().
double Mantid::Crystal::DataModeHandler::Vy_calc |
Definition at line 176 of file IntegratePeakTimeSlices.h.
Referenced by CalcConstraints(), CalcVariances(), DataModeHandler(), getInitVary(), getNewRCRadius(), init(), and setStatBase().