Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

ObjCryst::PowderPatternDiffraction Class Reference

Class to compute the contribution to a powder pattern from a crystalline phase. More...

#include <PowderPattern.h>

Inheritance diagram for ObjCryst::PowderPatternDiffraction::

ObjCryst::PowderPatternComponent ObjCryst::ScatteringData ObjCryst::RefinableObj ObjCryst::RefinableObj List of all members.

Public Methods

 PowderPatternDiffraction ()
 PowderPatternDiffraction (const PowderPatternDiffraction &)
virtual ~PowderPatternDiffraction ()
virtual PowderPatternDiffraction * CreateCopy () const
 So-called virtual copy constructor.

virtual const string & GetClassName () const
 Name for this class ("RefinableObj", "Crystal",...). This is only useful to distinguish different classes when picking up objects from the RefinableObj Global Registry.

virtual void SetParentPowderPattern (const PowderPattern &)
 Set the PowderPattern object which uses this component. This sets all necessary spectrum parameters (2theta range, wavelength, radiation type...) accordingly. More...

virtual const CrystVector_REAL & GetPowderPatternCalc () const
 Get the calculated powder spectrum for this component. Note that the spectrum is not scaled.

void SetReflectionProfilePar (const ReflectionProfileType prof, const REAL fwhmCagliotiW, const REAL fwhmCagliotiU=0, const REAL fwhmCagliotiV=0, const REAL eta0=0.5, const REAL eta1=0.)
 Set reflection profile parameters. More...

virtual void GenHKLFullSpace ()
virtual void XMLOutput (ostream &os, int indent=0) const
 Output to stream in well-formed XML. More...

virtual void XMLInput (istream &is, const XMLCrystTag &tag)
 Input From stream. More...

virtual void GetGeneGroup (const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const
 Get the gene group assigned to each parameter. More...

virtual void BeginOptimization (const bool allowApproximations=false, const bool enableRestraints=false)
 This should be called by any optimization class at the begining of an optimization. More...

virtual void EndOptimization ()
 This should be called by any optimization class at the end of an optimization. More...


Protected Methods

virtual void CalcPowderPattern () const
 Calc the powder spectrum. As always, recomputation is only done if necessary (ie if a parameter has changed since the last computation).

void CalcPowderReflProfile () const
 Calc reflection profiles for ALL reflections (powder diffraction). More...

void CalcLorentzPolarCorr () const
 Calc Lorentz-Polarisation-APerture correction. More...

virtual void CalcIhkl () const
 Compute the intensity for all reflections (taking into account corrections, but not the multiplicity). More...

virtual void SetRadiation (const Radiation &rad)
 Set the radiation. This is called by PowderPattern. More...

virtual void Prepare ()
 This will be called by the parent PowderPattern object, before calculating the first powder spectrum. Or maybe it should be called automatically by the object itself... More...

virtual void InitOptions ()
virtual void GetBraggLimits (CrystVector_long *&min, CrystVector_long *&max) const
 Get the integration limits (first and last pixels) around each reflection, if this component has Bragg reflections. Used for integrated R(w) factors. The limits currently go from -2*FWHM to +2*FWHM. returns a pointer to the min and max pixels arrays (null pointers if no reflection for this phase).

virtual void SetMaxSinThetaOvLambda (const REAL max)
 Set the maximum value for sin(theta)/lambda. All data above still exist but are ignored for all calculations.


Protected Attributes

RefinableObjClock mClockProfilePar
 Last time the reflection parameters were changed.

RefinableObjClock mClockLorentzPolarSlitCorrPar
 Last time the.

RefinableObjClock mClockLorentzPolarSlitCorrCalc
 Last time the Lorentz-Polar-Slit correction was computed.

RefinableObjClock mClockProfileCalc
 Last time the reflection profiles were computed.

RefinableObjClock mClockIhklCalc
 Last time intensities were computed.

RefObjOpt mReflectionProfileType
 Gaussian ? Lorentzian ? Pseudo-Voigt ?

REAL mFullProfileWidthFactor
 The 'full' profile of each reflection os taken equal to the FWHM, multiplied by this factor.

REAL mCagliotiU
 FWHM parameters, following Caglioti's law.

REAL mCagliotiV
 FWHM parameters, following Caglioti's law.

REAL mCagliotiW
 FWHM parameters, following Caglioti's law.

REAL mPseudoVoigtEta0
 Pseudo-Voigt mixing parameter : eta=eta0 +2*theta*eta1 eta=1 -> pure Lorentzian ; eta=0 -> pure Gaussian.

REAL mPseudoVoigtEta1
 Pseudo-Voigt mixing parameter : eta=eta0 +2*theta*eta1 eta=1 -> pure Lorentzian ; eta=0 -> pure Gaussian.

bool mUseAsymmetricProfile
 Use asymmetric profiles ? (unused yet).

CrystVector_REAL mLorentzPolarSlitCorr
 Calculated corrections for all reflections. Calc F^2 must be multiplied by this factor to yield intensities. More...

bool mNeedLorentzCorr
 Need to apply Lorentz correction ?

bool mNeedPolarCorr
 Need to apply Polarization correction ? This should be false for (unpolarized) neutrons.

bool mNeedSlitApertureCorr
 Need to apply Slit aperture correction ?

REAL mPolarAfactor
 the A factor in the polarization correction. Default value=1, corresponding to an X-Ray tube without monochromator.

CrystVector_REAL mIhklCalc
 Computed intensities for all reflections.

CrystMatrix_REAL mSavedPowderReflProfile
 Reflection profiles for ALL reflections during the last powder spectrum generation.

long mSavedPowderReflProfileNbPoint
 Number of points used to describe each individual profile. More...

CrystVector_long mReflectionProfileFirstPixel
 The 1st pixel for each reflection. More...

CrystVector_long mIntegratedReflMin
 First and last pixel for integrated R-factors around each reflection.

CrystVector_long mIntegratedReflMax
 First and last pixel for integrated R-factors around each reflection.


Detailed Description

Class to compute the contribution to a powder pattern from a crystalline phase.


Member Function Documentation

virtual void ObjCryst::PowderPatternDiffraction::BeginOptimization const bool    allowApproximations = false,
const bool    enableRestraints = false
[virtual]
 

This should be called by any optimization class at the begining of an optimization.

This will also check that everything is ready, eg call the RefinableObj::Prepare() function. This also affects all sub-objects.

Note:
this may be called several time for some objects which are used by several other objects.
Parameters:
allowApproximations:  if true, then the object can use faster but less precise functions during the optimization. This is useful for global optimization not using derivatives.
enableRestraints:  if true, then restrained parameters will be allowed to go beyond theur hard limits. This implies that the algorithm will take into account the cost (penalty) related to the restraints. Objects which do not use restraints will simply ignore this.

Reimplemented from ObjCryst::ScatteringData.

virtual void ObjCryst::PowderPatternDiffraction::CalcIhkl   const [protected, virtual]
 

Compute the intensity for all reflections (taking into account corrections, but not the multiplicity).

For internal use only.

void ObjCryst::PowderPatternDiffraction::CalcLorentzPolarCorr   const [protected]
 

Calc Lorentz-Polarisation-APerture correction.

For internal use only.

void ObjCryst::PowderPatternDiffraction::CalcPowderReflProfile   const [protected]
 

Calc reflection profiles for ALL reflections (powder diffraction).

For internal use only.

virtual void ObjCryst::PowderPatternDiffraction::EndOptimization   [virtual]
 

This should be called by any optimization class at the end of an optimization.

This also affects all sub-objects.

Note:
this may be called several time for some objects which are used by several other objects.

Reimplemented from ObjCryst::ScatteringData.

virtual void ObjCryst::PowderPatternDiffraction::GetGeneGroup const RefinableObj   obj,
CrystVector_uint &    groupIndex,
unsigned int &    firstGroup
const [virtual]
 

Get the gene group assigned to each parameter.

Each parameter (a gene in terms of genetic algorithms) can be assigned to a gene group. Thus when mating two configurations, genes will be exchanged by groups. By default (in the base RefinabeObj class), each parameter is alone in its group. Derived classes can group genes for a better s** life.

The number identifying a gene group only has a meaning in a given object. It can also change on subsequent calls, and thus is not unique.

Parameters:
obj  the \RefinableObj, supplied by an algorithm class (OptimizationObj,..), which contains a list of parameters, some of which (but possibly all or none) are parameters belonging to this object.
groupIndex  a vector of unsigned integers, one for each parameter in the input object, giving an unsigned integer value as gene group index. At the beginning this vector should contain only zeros (no group assigned).
firstGroup  this is the number of groups which have already been assigned, plus one. The gene groups returned by this object will start from this value, and increment firstGroup for each gene group used, so that different RefinableObj cannot share a gene group.
Note:
this function is not optimized, and should only be called at the beginning of a refinement.

Reimplemented from ObjCryst::RefinableObj.

virtual void ObjCryst::PowderPatternDiffraction::Prepare   [protected, virtual]
 

This will be called by the parent PowderPattern object, before calculating the first powder spectrum. Or maybe it should be called automatically by the object itself...

For internal use only.

Reimplemented from ObjCryst::PowderPatternComponent.

virtual void ObjCryst::PowderPatternDiffraction::SetParentPowderPattern const PowderPattern   [virtual]
 

Set the PowderPattern object which uses this component. This sets all necessary spectrum parameters (2theta range, wavelength, radiation type...) accordingly.

For internal use only.

Reimplemented from ObjCryst::PowderPatternComponent.

virtual void ObjCryst::PowderPatternDiffraction::SetRadiation const Radiation   rad [protected, virtual]
 

Set the radiation. This is called by PowderPattern.

For internal use only.

Reimplemented from ObjCryst::PowderPatternComponent.

void ObjCryst::PowderPatternDiffraction::SetReflectionProfilePar const ReflectionProfileType    prof,
const REAL    fwhmCagliotiW,
const REAL    fwhmCagliotiU = 0,
const REAL    fwhmCagliotiV = 0,
const REAL    eta0 = 0.5,
const REAL    eta1 = 0.
 

Set reflection profile parameters.

:TODO: assymmetric profiles

Parameters:
fwhmCagliotiW,fwhmCagliotiU,fwhmCagliotiV  : these are the U,V and W parameters in the Caglioti's law : if only W is given, the width is constant
eta0,eta1:  these are the mixing parameters in the case of a pseudo-Voigt function.

virtual void ObjCryst::PowderPatternDiffraction::XMLInput istream &    is,
const XMLCrystTag   tag
[virtual]
 

Input From stream.

Todo:
Add an bool XMLInputTag(is,tag) function to recognize all the tags from the stream. So that each inherited class can use the XMLInputTag function from its parent (ie take advantage of inheritance). The children class would first try to interpret the tag, then if unsuccessful would pass it to its parent (thus allowing overloading), etc...

Reimplemented from ObjCryst::RefinableObj.

virtual void ObjCryst::PowderPatternDiffraction::XMLOutput ostream &    os,
int    indent = 0
const [virtual]
 

Output to stream in well-formed XML.

Todo:
Use inheritance.. as for XMLInputTag()...

Reimplemented from ObjCryst::RefinableObj.


Member Data Documentation

CrystVector_REAL ObjCryst::PowderPatternDiffraction::mLorentzPolarSlitCorr [protected]
 

Calculated corrections for all reflections. Calc F^2 must be multiplied by this factor to yield intensities.

Thus we have :

with (Lorentz factor). (Polarization factor), with , where f is the polarization rate of the incident beam in the plane which (i) includes the incident beam, and (ii) is perpendicular to the diffracting plane. For an X-Ray Tube without monochromator, A=1, and if there is a monochromator : The factor takes into account the fraction of the diffracted cone which falls in the detector slit.

CrystVector_long ObjCryst::PowderPatternDiffraction::mReflectionProfileFirstPixel [protected]
 

The 1st pixel for each reflection.

For internal use only.

long ObjCryst::PowderPatternDiffraction::mSavedPowderReflProfileNbPoint [protected]
 

Number of points used to describe each individual profile.

For internal use only.


The documentation for this class was generated from the following file:
Generated on Tue Feb 5 17:37:23 2002 for ObjCryst++ by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001