Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

ObjCryst::PowderPatternDiffraction Class Reference

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

Inheritance diagram for ObjCryst::PowderPatternDiffraction:

Inheritance graph
[legend]
Collaboration diagram for ObjCryst::PowderPatternDiffraction:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

virtual const string & GetClassName () const
 Name for this class ("RefinableObj", "Crystal",...).

virtual void SetParentPowderPattern (const PowderPattern &)
 Set the PowderPattern object which uses this component.

virtual const CrystVector_REAL & GetPowderPatternCalc () const
 Get the calculated powder pattern for this component.

virtual pair< const CrystVector_REAL *,
const RefinableObjClock * > 
GetPowderPatternIntegratedCalc () const
 Get the integrated values of the powder pattern.

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.

void SetProfile (ReflectionProfile *prof)
 Assign a new profile.

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

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

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

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.

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

virtual const RadiationGetRadiation () const
 Get the radiation object for this data.

virtual const CrystVector_REAL & GetPowderPatternCalcVariance () const
 Get the variance associated to each point of the calculated powder pattern, for this component.

virtual pair< const CrystVector_REAL *,
const RefinableObjClock * > 
GetPowderPatternIntegratedCalcVariance () const
 Get the variance associated to each point of the calculated powder pattern, for this component (integrated version).

virtual bool HasPowderPatternCalcVariance () const
 Does this component have a variance associated with each calculated point ? i.e., do we use maximum likelihood to take into account incomplete models ?


Protected Member Functions

virtual void CalcPowderPattern () const
 Calc the powder pattern.

virtual void CalcPowderPatternIntegrated () const
 Calc the integrated powder pattern.

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

void CalcIntensityCorr () const
 Calc Lorentz-Polarisation-APerture correction.

virtual void CalcIhkl () const
virtual void Prepare ()
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.

virtual void SetMaxSinThetaOvLambda (const REAL max)
 exist but are ignored for all calculations.

void PrepareIntegratedProfile () const

Protected Attributes

RefinableObjClock mClockProfilePar
 Last time the reflection parameters were changed.

RefinableObjClock mClockLorentzPolarSlitCorrPar
 Last time the.

RefinableObjClock mClockIntensityCorr
 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.

ReflectionProfilempReflectionProfile
 Profile.

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

LorentzCorr mCorrLorentz
 Lorentz correction.

PolarizationCorr mCorrPolar
 Polarization correction.

PowderSlitApertureCorr mCorrSlitAperture
 Slit aperture correction.

TextureMarchDollase mCorrTextureMarchDollase
 Preferred orientation (texture) correction following the March-Dollase model.

TOFCorr mCorrTOF
 Time-Of-Flight intensity correction.

CrystVector_REAL mIhklCalc
 Computed intensities for all reflections.

CrystVector_REAL mIhklCalcVariance
 Variance on computed intensities for all reflections.

vector< ReflProfilemvReflProfile
 Reflection profiles for ALL reflections during the last powder pattern generation.

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.

vector< pair< unsigned long,
CrystVector_REAL > > 
mIntegratedProfileFactor
 For each reflection, store the integrated value of the normalized profile over all integration intervals.

RefinableObjClock mClockIntegratedProfileFactor
 Last time the integrated values of normalized profiles was calculated.


Detailed Description

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


Constructor & Destructor Documentation

ObjCryst::PowderPatternDiffraction::PowderPatternDiffraction  ) 
 

ObjCryst::PowderPatternDiffraction::PowderPatternDiffraction const PowderPatternDiffraction  ) 
 

virtual ObjCryst::PowderPatternDiffraction::~PowderPatternDiffraction  )  [virtual]
 


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. WARNING: this parameter may be removed with the new likelihood scheme.

Reimplemented from ObjCryst::ScatteringData.

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

For internal use only.

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

void ObjCryst::PowderPatternDiffraction::CalcIntensityCorr  )  const [protected]
 

Calc Lorentz-Polarisation-APerture correction.

virtual void ObjCryst::PowderPatternDiffraction::CalcPowderPattern  )  const [protected, virtual]
 

Calc the powder pattern.

As always, recomputation is only done if necessary (ie if a parameter has changed since the last computation)

Implements ObjCryst::PowderPatternComponent.

virtual void ObjCryst::PowderPatternDiffraction::CalcPowderPatternIntegrated  )  const [protected, virtual]
 

Calc the integrated powder pattern.

This should be optimized so that the full powder pattern is not explicitely computed.

Implements ObjCryst::PowderPatternComponent.

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

Calc reflection profiles for ALL reflections (powder diffraction).

virtual PowderPatternDiffraction* ObjCryst::PowderPatternDiffraction::CreateCopy  )  const [virtual]
 

So-called virtual copy constructor.

Implements ObjCryst::ScatteringData.

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::GenHKLFullSpace  )  [virtual]
 

virtual void ObjCryst::PowderPatternDiffraction::GetBraggLimits CrystVector_long *&  min,
CrystVector_long *&  max
const [protected, virtual]
 

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).

Implements ObjCryst::PowderPatternComponent.

virtual const string& ObjCryst::PowderPatternDiffraction::GetClassName  )  const [virtual]
 

Name for this class ("RefinableObj", "Crystal",...).

This is only useful to distinguish different classes when picking up objects from the RefinableObj Global Registry

Reimplemented from ObjCryst::PowderPatternComponent.

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 , 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 const CrystVector_REAL& ObjCryst::PowderPatternDiffraction::GetPowderPatternCalc  )  const [virtual]
 

Get the calculated powder pattern for this component.

Note that the pattern is not scaled.

Implements ObjCryst::PowderPatternComponent.

virtual const CrystVector_REAL& ObjCryst::PowderPatternDiffraction::GetPowderPatternCalcVariance  )  const [virtual]
 

Get the variance associated to each point of the calculated powder pattern, for this component.

Warning:
: this is experimental, with the aim of using Maximum Likelihood to improve structure determination.

Implements ObjCryst::PowderPatternComponent.

virtual pair<const CrystVector_REAL*,const RefinableObjClock*> ObjCryst::PowderPatternDiffraction::GetPowderPatternIntegratedCalc  )  const [virtual]
 

Get the integrated values of the powder pattern.

Note:
: the integration intervals are those given by the parent PowderPattern, so that all PowderPatternComponent's intervals are taken into account
This avoids explicitely calculating the full profile powder pattern.

Implements ObjCryst::PowderPatternComponent.

virtual pair<const CrystVector_REAL*,const RefinableObjClock*> ObjCryst::PowderPatternDiffraction::GetPowderPatternIntegratedCalcVariance  )  const [virtual]
 

Get the variance associated to each point of the calculated powder pattern, for this component (integrated version).

Warning:
: this is experimental, with the aim of using Maximum Likelihood to improve structure determination.

Implements ObjCryst::PowderPatternComponent.

virtual const Radiation& ObjCryst::PowderPatternDiffraction::GetRadiation  )  const [virtual]
 

Get the radiation object for this data.

Implements ObjCryst::ScatteringData.

virtual bool ObjCryst::PowderPatternDiffraction::HasPowderPatternCalcVariance  )  const [virtual]
 

Does this component have a variance associated with each calculated point ? i.e., do we use maximum likelihood to take into account incomplete models ?

Implements ObjCryst::PowderPatternComponent.

virtual void ObjCryst::PowderPatternDiffraction::InitOptions  )  [protected, virtual]
 

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

For internal use only.

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

Implements ObjCryst::PowderPatternComponent.

void ObjCryst::PowderPatternDiffraction::PrepareIntegratedProfile  )  const [protected]
 

virtual void ObjCryst::PowderPatternDiffraction::SetMaxSinThetaOvLambda const REAL  max  )  [protected, virtual]
 

exist but are ignored for all calculations.

All data above still

Implements ObjCryst::PowderPatternComponent.

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

Set the PowderPattern object which uses this component.

This sets all necessary pattern parameters (2theta/tof range, wavelength, radiation type...) accordingly.

Implements ObjCryst::PowderPatternComponent.

void ObjCryst::PowderPatternDiffraction::SetProfile ReflectionProfile prof  ) 
 

Assign a new profile.

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 : $ fwhm^2= U \tan^2(\theta) + V \tan(\theta) +W $ 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

RefinableObjClock ObjCryst::PowderPatternDiffraction::mClockIhklCalc [mutable, protected]
 

Last time intensities were computed.

RefinableObjClock ObjCryst::PowderPatternDiffraction::mClockIntegratedProfileFactor [mutable, protected]
 

Last time the integrated values of normalized profiles was calculated.

RefinableObjClock ObjCryst::PowderPatternDiffraction::mClockIntensityCorr [mutable, protected]
 

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

RefinableObjClock ObjCryst::PowderPatternDiffraction::mClockLorentzPolarSlitCorrPar [protected]
 

Last time the.

RefinableObjClock ObjCryst::PowderPatternDiffraction::mClockProfileCalc [mutable, protected]
 

Last time the reflection profiles were computed.

RefinableObjClock ObjCryst::PowderPatternDiffraction::mClockProfilePar [protected]
 

Last time the reflection parameters were changed.

LorentzCorr ObjCryst::PowderPatternDiffraction::mCorrLorentz [protected]
 

Lorentz correction.

PolarizationCorr ObjCryst::PowderPatternDiffraction::mCorrPolar [protected]
 

Polarization correction.

PowderSlitApertureCorr ObjCryst::PowderPatternDiffraction::mCorrSlitAperture [protected]
 

Slit aperture correction.

TextureMarchDollase ObjCryst::PowderPatternDiffraction::mCorrTextureMarchDollase [protected]
 

Preferred orientation (texture) correction following the March-Dollase model.

TOFCorr ObjCryst::PowderPatternDiffraction::mCorrTOF [protected]
 

Time-Of-Flight intensity correction.

CrystVector_REAL ObjCryst::PowderPatternDiffraction::mIhklCalc [mutable, protected]
 

Computed intensities for all reflections.

CrystVector_REAL ObjCryst::PowderPatternDiffraction::mIhklCalcVariance [mutable, protected]
 

Variance on computed intensities for all reflections.

vector< pair<unsigned long, CrystVector_REAL> > ObjCryst::PowderPatternDiffraction::mIntegratedProfileFactor [mutable, protected]
 

For each reflection, store the integrated value of the normalized profile over all integration intervals.

The first field is the first integration interval to which the reflection contributes, and the second field is a vector with all the integrated values for the intervals, listed in ascending 2theta(tof) order.

CrystVector_long ObjCryst::PowderPatternDiffraction::mIntegratedReflMax [mutable, protected]
 

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

CrystVector_long ObjCryst::PowderPatternDiffraction::mIntegratedReflMin [mutable, protected]
 

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

CrystVector_REAL ObjCryst::PowderPatternDiffraction::mIntensityCorr [mutable, protected]
 

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

Thus we have : $ I_{hkl} = L \times P \times SlitAp \times F_{hkl}^2 $

with $ L = \frac{1}{\sin(2\theta)} $ (Lorentz factor). $ P = \frac{1}{1+A}\left(1+A\cos^2(2\theta)\right) $ (Polarization factor), with $ A = \frac{1-f}{1+f} $, 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 : $ A = \cos^2(2\theta_{mono}) $ The factor $ SlitAp = \frac{1}{\sin(\theta)} $ takes into account the fraction of the diffracted cone which falls in the detector slit.

If there is prefereed orientation, this also holds the associated correction.

Todo:
: store all corrections in a registry, so that other corrections can more easily be added (? Maybe not that useful, especially since these correction do not need to be displayed to the user ?).

ReflectionProfile* ObjCryst::PowderPatternDiffraction::mpReflectionProfile [protected]
 

Profile.

vector<ReflProfile> ObjCryst::PowderPatternDiffraction::mvReflProfile [mutable, protected]
 

Reflection profiles for ALL reflections during the last powder pattern generation.


The documentation for this class was generated from the following file:
Generated on Tue Nov 14 15:04:31 2006 for ObjCryst++ by doxygen 1.3.6