21#include "MantidCrystal/DllConfig.h"
33namespace HistogramData {
74 bool isEdgePeak(
const double *params,
int nparams);
91 else if (newsize <
EdgeX)
101 else if (newsize <
EdgeY)
106 void CalcVariancesFromData(
double background,
double meanx,
double meany,
double &Varxx,
double &Varxy,
double &Varyy,
107 const std::vector<double> &
StatBase);
135 if (index < 0 || index >= (
int)
StatBase.size())
154 std::vector<double>
InitValues(
double Varx,
double Vary,
double b);
216 const std::string
name()
const override {
return "IntegratePeakTimeSlices"; }
220 return "The algorithm uses CurveFitting::BivariateNormal for fitting a "
226 const std::vector<std::string>
seeAlso()
const override {
return {
"PeakIntegration"}; }
229 const std::string
category()
const override {
return "Crystal\\Integration"; }
232 void init()
override;
233 void exec()
override;
237 std::string m_AttributeNames[20];
239 std::string m_ParameterNames[7];
261 const std::shared_ptr<Geometry::IComponent> &comp,
const int chanMin,
const int chanMax,
double CentX,
264 double &neighborRadius,
265 double Radius, std::string &spec_idList);
267 bool getNeighborPixIDs(
const std::shared_ptr<Geometry::IComponent> &comp,
const Kernel::V3D &Center,
double &Radius,
270 int CalculateTimeChannelSpan(
Geometry::IPeak const &peak,
const double dQ,
const Mantid::HistogramData::HistogramX &X,
271 const int specNum,
int &Centerchan);
280 const int chanMax,
double Radius,
const Kernel::V3D &CentPos, std::string &spec_idList
288 std::vector<double> ¶ms, std::vector<double> &errs,
double lastRow,
double lastCol,
289 double neighborRadius);
292 std::vector<double> ¶ms, std::vector<double> &errs,
double lastRow,
double lastCol,
293 double neighborRadius);
295 std::string CalculateFunctionProperty_Fit();
297 bool isGoodFit(std::vector<double>
const ¶ms, std::vector<double>
const &errs,
298 std::vector<std::string>
const &names,
double chisqOverDOF);
301 std::vector<double>
const ¶ms, std::vector<double>
const &errs,
302 std::vector<std::string>
const &names,
const double Chisq,
const double time,
303 std::string spec_idList);
305 void updatePeakInformation(std::vector<double>
const ¶ms, std::vector<double>
const &errs,
306 std::vector<std::string>
const &names,
double &TotVariance,
double &TotIntensity,
307 double const TotSliceIntensity,
double const TotSliceVariance,
double const chisqdivDOF,
310 void updateStats(
const double intensity,
const double variance,
const double row,
const double col,
311 std::vector<double> &StatBase);
313 int findNameInVector(std::string
const &oneName, std::vector<std::string>
const &nameList);
315 double CalculateIsawIntegrateError(
const double background,
const double backError,
const double ChiSqOverDOF,
316 const double TotVariance,
const int ncells);
319 int &NCOLS,
double &pixWidthx,
double &pixHeighty,
DataObjects::Peak const &peak)
const;
321 int findTimeChannel(
const Mantid::HistogramData::HistogramX &X,
const double time);
324 bool updateNeighbors(
const std::shared_ptr<Geometry::IComponent> &comp,
const Kernel::V3D &CentPos,
325 const Kernel::V3D &oldCenter,
double NewRadius,
double &neighborRadius);
Base class from which all concrete algorithm classes should be derived.
Class for marking algorithms as deprecated.
Integrates each time slice using the BivariateNormal formula, adding the results to the peak object.
void setHeightHalfWidthInfo(const MantidVec &xvals, const MantidVec &yvals, const MantidVec &counts)
For edge peaks, the sample standard deviations do not work.
double CalcISAWIntensity(const double *params)
Calculates the Intensity designed for Edge Peaks.
double CalcISAWIntensityVariance(const double *params, const double *errs, double chiSqOvDOF)
Calculates the Error in the Intensity designed for Edge Peaks.
std::vector< double > InitValues(double Varx, double Vary, double b)
Returns init values with background and variances replaced by arguments.
bool isEdgePeak(const double *params, int nparams)
Determines if a Peak is an edge peak.
double getInitBackground()
Kernel::V3D currentPosition
bool CalcVariances()
Determines whether the Variances can be calculated.
double getNewRCRadius()
Calculates the new radius for neighborhoods so as to include almost all of a peak.
void updateEdgeXsize(double newsize)
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.
double HalfWidthAtHalfHeightRadius
double getCurrentRadius()
double getInitIntensity()
void updateEdgeYsize(double newsize)
double CalcSampleIntensityMultiplier(const double *params) const
For Edge Peaks.
std::vector< double > GetParams(double b)
Calculates the initial values of the parameters given background b.
DataModeHandler(double baseRCRadius, double lastRCRadius, double lastRow, double lastCol, double CellWidth, double CellHeight, bool CalcVariance, int MinCol, int MaxCol, int MinRow, int MaxRow)
bool IsEnoughData(const double *ParameterValues, Kernel::Logger &)
Calculates if there is enough data to for there to be a peak.
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 ...
void setCurrentRadius(double radius)
bool setStatBase(std::vector< double > const &StatBase)
Sets the Accumulated data values into this class, then updates other information like initial values.
std::vector< double > StatBase
void setTime(double time)
double StatBaseVals(int index)
Kernel::V3D getCurrentCenter()
void setCurrentCenter(const Kernel::V3D &newCenter)
double m_COL
for Describing the Column(or 0) describing the center of the
std::array< double, 7 > m_ParameterValues
Mantid::detid2index_map m_wi_to_detid_map
Kernel::V3D m_center
for Describing the Plane at the Peak
Kernel::V3D m_yvec
for Describing the Plane at the Peak
Kernel::V3D m_xvec
for Describing the Plane at the Peak
std::shared_ptr< DataModeHandler > m_AttributeValues
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
double m_ROW
for Describing the Row(or 0) describing the center of the Peak
double m_cellHeight
for Describing the Plane at the Peak
int version() const override
Algorithm's version for identification overriding a virtual method.
double m_R0
for Weak Peaks, these can be set using info from close
const std::string summary() const override
Summary of algorithms purpose.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
A generic fitting algorithm.
Structure describing a single-crystal peak.
Structure describing a single-crystal peak.
The Logger class is in charge of the publishing messages from the framework through various channels.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< TableWorkspace > TableWorkspace_sptr
shared pointer to Mantid::DataObjects::TableWorkspace
Helper class which provides the Collimation Length for SANS instruments.
std::unordered_map< detid_t, size_t > detid2index_map
Map with key = detector ID, value = workspace index.
std::vector< double > MantidVec
typedef for the data storage used in Mantid matrix workspaces
Peak indexing algorithm, which works by assigning multiple possible HKL values to each peak and then ...