22 : m_cell(cell), m_dmin(dMin), m_dmax(dMax) {
28 std::ostringstream strm;
36 double d = m_cell.d(hkl);
38 return d >= m_dmin &&
d <= m_dmax;
44 throw std::range_error(
"dMin cannot be <= 0.");
48 throw std::range_error(
"dMax cannot be <= 0.");
52 throw std::range_error(
"dMax cannot be smaller than dMin.");
59 throw std::runtime_error(
"Cannot construct HKLFilterSpaceGroup from null space group.");
65 return "(Space group: " +
m_spaceGroup->hmSymbol() +
")";
71 return m_spaceGroup->isAllowedReflection(hkl);
76 : m_calculator(
std::move(calculator)), m_fSquaredMin(fSquaredMin) {
78 throw std::runtime_error(
"Cannot construct HKLFilterStructureFactor from null calculator.");
84 std::ostringstream strm;
92 return m_calculator->getFSquared(hkl) > m_fSquaredMin;
98 throw std::runtime_error(
"Cannot construct HKLFilterCentering from null centering.");
104 return "(Centering: " +
m_centering->getSymbol() +
")";
109 return m_centering->isAllowed(
static_cast<int>(hkl.X()),
static_cast<int>(hkl.Y()),
static_cast<int>(hkl.Z()));
bool isAllowed(const Kernel::V3D &hkl) const noexcept override
Returns true if the HKL is allowed according to the lattice centering.
HKLFilterCentering(ReflectionCondition_sptr centering)
Constructor, throws exception if pointer is null.
ReflectionCondition_sptr m_centering
std::string getDescription() const noexcept override
Returns a description with the centering symbol.
bool isAllowed(const Kernel::V3D &hkl) const noexcept override
Returns true if the d-value of the HKL is within the specified range.
std::string getDescription() const noexcept override
Returns a description containing the parameters of the filter.
HKLFilterDRange(const UnitCell &cell, double dMin)
Constructor, dMax is set to the largest lattice parameter.
void checkProperDRangeValues()
Throws exception if m_dMin or m_dMax is <= 0 or if m_dMax < m_dMin.
std::string getDescription() const noexcept override
Returns a description of the filter that contains the space group symbol.
SpaceGroup_const_sptr m_spaceGroup
bool isAllowed(const Kernel::V3D &hkl) const noexcept override
Returns true if the reflection is allowed by the space group reflection conditions.
HKLFilterSpaceGroup(SpaceGroup_const_sptr spaceGroup)
Constructor, throws exception if the supplied pointer is invalid.
StructureFactorCalculator_sptr m_calculator
HKLFilterStructureFactor(StructureFactorCalculator_sptr calculator, double fSquaredMin=1.0e-6)
Constructor, throws exception if the calculator pointer is invalid.
std::string getDescription() const noexcept override
Returns a description for the filter that contains the minimum F^2.
bool isAllowed(const Kernel::V3D &hkl) const noexcept override
Returns true if F^2(hkl) is larger than the stored minimum.
Class to implement unit cell of crystals.
double a(int nd) const
Get lattice parameter a1-a3 as function of index (0-2)
double c() const
Get lattice parameter.
double b() const
Get lattice parameter.
std::shared_ptr< ReflectionCondition > ReflectionCondition_sptr
Shared pointer to a ReflectionCondition.
std::shared_ptr< StructureFactorCalculator > StructureFactorCalculator_sptr
std::shared_ptr< const SpaceGroup > SpaceGroup_const_sptr