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

The PeaksStatistics class is a small helper class that is used in SortHKL. More...

#include <PeakStatisticsTools.h>

Public Member Functions

 PeaksStatistics (const UniqueReflectionCollection &reflections)
 
 PeaksStatistics (const UniqueReflectionCollection &reflections, std::string &equivalentIntensities, double &sigmaCritical, bool &weightedZ)
 

Public Attributes

double m_chiSquared
 
double m_completeness
 Fraction of observed unique reflections in the resolution range defined by d_min and d_max. More...
 
double m_dspacingMax
 Upper d-spacing limit in the data set. More...
 
double m_dspacingMin
 Lower d-spacing limit in the data set, sometimes referred to as upper resolution limit. More...
 
double m_meanIOverSigma
 Average signal to noise ratio in the reflections. More...
 
int m_measuredReflections
 Total number of observed reflections - no symmetry is taken into account for this. More...
 
std::vector< DataObjects::Peakm_peaks
 
double m_redundancy
 Average number of observations for a unique reflection. More...
 
double m_rMerge
 Merging R-factor, R_merge, sometimes also called R_sym. More...
 
double m_rPim
 Precision indicating R-factor (R_{p.i.m}). More...
 
int m_uniqueReflections
 Number of unique reflections. More...
 

Private Member Functions

void calculatePeaksStatistics (const std::map< Kernel::V3D, UniqueReflection > &uniqueReflections, std::string &equivalentIntensities, double &sigmaCritical, bool &weightedZ)
 PeaksStatistics::calculatePeaksStatistics. More...
 
std::pair< double, double > getDSpacingLimits (const std::vector< DataObjects::Peak > &peaks) const
 Returns the lowest and hights wavelength in the peak list. More...
 
double getIOverSigmaSum (const std::vector< double > &sigmas, const std::vector< double > &intensities) const
 Returns the sum of all I/sigma-ratios defined by the two vectors using std::inner_product. More...
 
double getRMS (const std::vector< double > &data) const
 Returns the Root mean square of the supplied vector. More...
 

Detailed Description

The PeaksStatistics class is a small helper class that is used in SortHKL.

It takes a UniqueReflectionCollection and calculates a few data set quality indicators such as Rmerge and Rpim.

Do not rely on this class to exist forever, parts of it may change or the entire class may disappear over time.

Definition at line 109 of file PeakStatisticsTools.h.

Constructor & Destructor Documentation

◆ PeaksStatistics() [1/2]

Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::PeaksStatistics ( const UniqueReflectionCollection reflections)
inlineexplicit

◆ PeaksStatistics() [2/2]

Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::PeaksStatistics ( const UniqueReflectionCollection reflections,
std::string &  equivalentIntensities,
double &  sigmaCritical,
bool &  weightedZ 
)
inlineexplicit

Member Function Documentation

◆ calculatePeaksStatistics()

void Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::calculatePeaksStatistics ( const std::map< Kernel::V3D, UniqueReflection > &  uniqueReflections,
std::string &  equivalentIntensities,
double &  sigmaCritical,
bool &  weightedZ 
)
private

PeaksStatistics::calculatePeaksStatistics.

This function iterates through the unique reflections map and computes statistics for the reflections/peaks. It calls UniqueReflection::removeOutliers, so outliers are removed before the statistical quantities are calculated.

Furthermore it sets the intensities of each peak to the mean of the group of equivalent reflections.

Parameters
uniqueReflections:: Map of unique reflections and peaks.
equivalentIntensities:: Mean or median for statistics of equivalent peaks.
sigmaCritical:: Number of standard deviations for outliers.
weightedZ:: True for weighted Zscore

Definition at line 206 of file PeakStatisticsTools.cpp.

References getDSpacingLimits(), getIOverSigmaSum(), Mantid::Kernel::getStatistics(), m_chiSquared, m_completeness, m_dspacingMax, m_dspacingMin, m_meanIOverSigma, m_measuredReflections, m_peaks, m_redundancy, m_rMerge, m_rPim, m_uniqueReflections, Mantid::Kernel::StatOptions::Mean, Mantid::Kernel::StatOptions::Median, and Mantid::Kernel::StatOptions::UncorrectedStdDev.

◆ getDSpacingLimits()

std::pair< double, double > Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::getDSpacingLimits ( const std::vector< DataObjects::Peak > &  peaks) const
private

Returns the lowest and hights wavelength in the peak list.

Definition at line 307 of file PeakStatisticsTools.cpp.

References rhs.

Referenced by calculatePeaksStatistics().

◆ getIOverSigmaSum()

double Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::getIOverSigmaSum ( const std::vector< double > &  sigmas,
const std::vector< double > &  intensities 
) const
private

Returns the sum of all I/sigma-ratios defined by the two vectors using std::inner_product.

Definition at line 293 of file PeakStatisticsTools.cpp.

Referenced by calculatePeaksStatistics().

◆ getRMS()

double Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::getRMS ( const std::vector< double > &  data) const
private

Returns the Root mean square of the supplied vector.

Definition at line 300 of file PeakStatisticsTools.cpp.

Member Data Documentation

◆ m_chiSquared

double Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::m_chiSquared

◆ m_completeness

double Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::m_completeness

Fraction of observed unique reflections in the resolution range defined by d_min and d_max.

Definition at line 138 of file PeakStatisticsTools.h.

Referenced by calculatePeaksStatistics(), and Mantid::Crystal::SortHKL::insertStatisticsIntoTable().

◆ m_dspacingMax

double Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::m_dspacingMax

Upper d-spacing limit in the data set.

Definition at line 161 of file PeakStatisticsTools.h.

Referenced by calculatePeaksStatistics(), and Mantid::Crystal::SortHKL::insertStatisticsIntoTable().

◆ m_dspacingMin

double Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::m_dspacingMin

Lower d-spacing limit in the data set, sometimes referred to as upper resolution limit.

Definition at line 158 of file PeakStatisticsTools.h.

Referenced by calculatePeaksStatistics(), and Mantid::Crystal::SortHKL::insertStatisticsIntoTable().

◆ m_meanIOverSigma

double Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::m_meanIOverSigma

Average signal to noise ratio in the reflections.

Definition at line 154 of file PeakStatisticsTools.h.

Referenced by calculatePeaksStatistics(), and Mantid::Crystal::SortHKL::insertStatisticsIntoTable().

◆ m_measuredReflections

int Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::m_measuredReflections

Total number of observed reflections - no symmetry is taken into account for this.

Definition at line 130 of file PeakStatisticsTools.h.

Referenced by calculatePeaksStatistics().

◆ m_peaks

std::vector<DataObjects::Peak> Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::m_peaks

◆ m_redundancy

double Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::m_redundancy

Average number of observations for a unique reflection.

Definition at line 141 of file PeakStatisticsTools.h.

Referenced by calculatePeaksStatistics(), and Mantid::Crystal::SortHKL::insertStatisticsIntoTable().

◆ m_rMerge

double Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::m_rMerge

Merging R-factor, R_merge, sometimes also called R_sym.

This is a basic measure for how well the intensities of symmetry equivalent reflections agree with each other.

Definition at line 146 of file PeakStatisticsTools.h.

Referenced by calculatePeaksStatistics(), and Mantid::Crystal::SortHKL::insertStatisticsIntoTable().

◆ m_rPim

double Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::m_rPim

Precision indicating R-factor (R_{p.i.m}).

Also a measurement of agreement between equivalent reflections, but without some of the weeknesses of R_merge.

Definition at line 151 of file PeakStatisticsTools.h.

Referenced by calculatePeaksStatistics(), and Mantid::Crystal::SortHKL::insertStatisticsIntoTable().

◆ m_uniqueReflections

int Mantid::Crystal::PeakStatisticsTools::PeaksStatistics::m_uniqueReflections

Number of unique reflections.

This counts each reflection family once, according to the point group.

Definition at line 134 of file PeakStatisticsTools.h.

Referenced by calculatePeaksStatistics(), and Mantid::Crystal::SortHKL::insertStatisticsIntoTable().


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