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

ObjCryst::PowderPatternBackground Class Reference

Phase to compute a background contribution to a powder pattern using an interpolation. Currently only linear interpolation is available. (in the works: cubic spline interpolation background). More...

#include <PowderPattern.h>

Inheritance diagram for ObjCryst::PowderPatternBackground::

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

Public Methods

 PowderPatternBackground ()
 PowderPatternBackground (const PowderPatternBackground &)
virtual ~PowderPatternBackground ()
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 ImportUserBackground (const string &filename)
 Import background points from a file (with two columns 2theta, intensity).

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


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

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

PowderBackgroundInterpType mBackgroundType
 The kind of interpolation used.

int mBackgroundNbPoint
 Number of fitting points for background.

CrystVector_REAL mBackgroundInterpPoint2Theta
 Vector of 2theta values for the fitting points of the background.

CrystVector_REAL mBackgroundInterpPointIntensity
 Values of background at interpolating points.

RefinableObjClock mClockBackgroundPoint
 Modification of the interpolated points.

RefinableObjClock mClockBackgroundSpline
 Last time Splines were generated.

REAL mMaxSinThetaOvLambda
 Maximum sin(theta)/lambda for all calculations (10 by default). More...


Friends

class PowderPattern

Detailed Description

Phase to compute a background contribution to a powder pattern using an interpolation. Currently only linear interpolation is available. (in the works: cubic spline interpolation background).


Member Function Documentation

virtual void ObjCryst::PowderPatternBackground::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::PowderPatternBackground::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::PowderPatternBackground::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::PowderPatternBackground::SetRadiation const Radiation   rad [protected, virtual]
 

Set the radiation. This is called by PowderPattern.

For internal use only.

Reimplemented from ObjCryst::PowderPatternComponent.

virtual void ObjCryst::PowderPatternBackground::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::PowderPatternBackground::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

REAL ObjCryst::PowderPatternBackground::mMaxSinThetaOvLambda [protected]
 

Maximum sin(theta)/lambda for all calculations (10 by default).

This keeps all data in memory, but only the part which is below the max is calculated.


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