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

ObjCryst::ScatteringData Class Reference

Class to compute structure factors for a set of reflections and a Crystal. More...

#include <ScatteringData.h>

Inheritance diagram for ObjCryst::ScatteringData::

ObjCryst::RefinableObj ObjCryst::DiffractionDataSingleCrystal ObjCryst::PowderPatternDiffraction List of all members.

Public Methods

 ScatteringData ()
 ScatteringData (const ScatteringData &old)
 ~ScatteringData ()
virtual ScatteringData * CreateCopy () const=0
 So-called virtual copy constructor.

virtual void SetHKL (CrystVector_double const &h, CrystVector_double const &k, CrystVector_double const &l)
 input H,K,L. More...

virtual void GenHKLFullSpace (const double maxTheta, const bool useMultiplicity=false)
 Generate a list of h,k,l to describe a full reciprocal space, up to a given maximum theta value. More...

virtual void SetRadiationType (const RadiationType radiation)
 Set : neutron or x-ray experiment ? Wavelength ?

RadiationType GetRadiationType () const
 Neutron or x-ray experiment ? Wavelength ?

virtual void SetCrystal (Crystal &crystal)
 Set the crystal for this experiment.

const CrystalGetCrystal () const
 Const access to the data's crystal.

CrystalGetCrystal ()
 Access to the data's crystal.

long GetNbRefl () const
 Return the number of reflections in this experiment.

const CrystVector_double & GetH () const
 Return the 1D array of H coordinates for all reflections.

const CrystVector_double & GetK () const
 Return the 1D array of K coordinates.

const CrystVector_double & GetL () const
 Return the 1D array of L coordinates.

const CrystVector_double & GetH2Pi () const
 Return the 1D array of H coordinates for all reflections, multiplied by 2*pi Should be private.

const CrystVector_double & GetK2Pi () const
 Return the 1D array of K coordinates for all reflections, multiplied by 2*pi Should be private.

const CrystVector_double & GetL2Pi () const
 Return the 1D array of L coordinates for all reflections, multiplied by 2*pi Should be private.

const CrystVector_double & GetSinThetaOverLambda () const
 Return an array with for all reflections.

const CrystVector_double & GetFhklCalcSq () const
 Returns the Array of calculated |F(hkl)|^2 for all reflections.

const CrystVector_double & GetFhklCalcReal () const
 Access to real part of F(hkl)calc.

const CrystVector_double & GetFhklCalcImag () const
 Access to imaginary part of F(hkl)calc.

void SetWavelength (const double lambda)
 Set the wavelength of the experiment (in Angstroems). This is used to calculate theta angles and get X-Ray anomalous factors.

void SetWavelength (const string &XRayTubeElementName, const double alpha2Alpha1ratio=0.5)
 Set the wavelength of the experiment to that of an X-Ray tube. More...

void SetEnergy (const double energy)
 Set the energy of the experiment (in keV). This is used to calculate theta angles and get X-Ray anomalous factors.

CrystVector_double GetWavelength () const
 wavelength of the experiment (in Angstroems).

void SetUseFastLessPreciseFunc (const bool useItOrNot)
 Use of faster, less precise approximations to compute structure factorsand interatomic distances ? (DiffractionData::mUseFastLessPreciseFunc).

void SetIsIgnoringImagScattFact (const bool b)
 If true, then the imaginary part of the scattering factor is ignored during Structure factor computation. (default value=false) computation of Structure Factors for Fridel/Bijvoet mates using an internal list of 'fully unique' reflections. Then only one of the mates need to be computed.. More...

bool IsIgnoringImagScattFact () const
 If true, then the imaginary part of the scattering factor is ignored during Structure factor computation.

virtual void PrintFhklCalc () const
 Print H, K, L F^2 Re(F) Im(F) theta sin(theta)/lambda for all reflections.


Protected Methods

virtual void PrepareHKLarrays ()
  This function is called after H,K and L arrays have been initialized or modified.

CrystVector_long SortReflectionByTheta (const double maxTheta=-1.)
  sort reflections by theta values (also get rid of [0,0,0] if present) If maxTheta >0, then only reflections where theta<maxTheta are kept
Returns:
an array with the subscript of the kept reflections (for inherited classes).


CrystVector_long EliminateExtinctReflections ()
  Get rid of extinct reflections. Useful after GenHKLFullSpace(). Do not use this if you have a list of observed reflections ! Currently done using (brute-force) numerical evaluation. Should rather use SpaceGroup info... To do !
Returns:
an array with the subscript of the kept reflections (for inherited classes).


virtual void PrepareCalcStructFactor () const
  Get the list of scattering components, and check what needs to be recomputed to get the new structure factors. No calculation is made in this function. Just getting prepared... Currently using flags to decide what should be recomputed, whereas Clocks should be used. a LOT of cleaning is necessary. More...

virtual void CalcSinThetaLambda () const
  Compute sin(theta)/lambda. theta and tan(theta) values are also re-computed, provided a wavelength has been supplied.

void CalcScattFactor () const
  Get scattering factors for all ScatteringPower & reflections.

void CalcTemperatureFactor () const
  Compute thermic factors for all ScatteringPower & reflections.

virtual void CalcResonantScattFactor () const
  get f' and f" for ScatteringPower of the crystal, at the exp. wavelength This could be specialized for multi-wavelength experiments...

void CalcStructFactor () const
 Compute the overall structure factor (real and imaginary part). This function is optimized for speed (geometrical structure factors are computed for all atoms and all reflections in two loops, avoiding re-calculation). So use this function for repetitive calculations. More...

void CalcGeomStructFactor (const ScatteringComponentList &scattCompList, const SpaceGroup &spg, const CrystVector_long &structFactorIndex, CrystVector_double *rsf2, CrystVector_double *isf2, bool useFastTabulatedTrigFunctions=false) const
 Compute the 'Geometrical Structure Factor' for each ScatteringPower of the Crystal.


Protected Attributes

long mNbRefl
 Number of H,K,L reflections.

CrystVector_double mH
 H,K,L coordinates.

CrystVector_double mK
 H,K,L coordinates.

CrystVector_double mL
 H,K,L coordinates.

CrystVector_long mIntH
 H,K,L integer coordinates.

CrystVector_long mIntK
 H,K,L integer coordinates.

CrystVector_long mIntL
 H,K,L integer coordinates.

CrystVector_double mH2Pi
 H,K,L coordinates, multiplied by 2PI.

CrystVector_double mK2Pi
 H,K,L coordinates, multiplied by 2PI.

CrystVector_double mL2Pi
 H,K,L coordinates, multiplied by 2PI.

CrystVector_int mMultiplicity
 Multiplicity for each reflections (mostly for powder diffraction).

CrystVector_double mFhklCalcReal
 real &imaginary parts of F(HKL)calc.

CrystVector_double mFhklCalcImag
 real &imaginary parts of F(HKL)calc.

CrystVector_double mFhklCalcSq
 F(HKL)^2 calc for each reflection.

Radiation mRadiation
 Radiation.

CrystalmpCrystal
 Pointer to the crystal corresponding to this experiment. More...

bool mUseFastLessPreciseFunc
 Use faster, but less precise, approximations for functions? (integerapproximations to compute sin and cos in structure factors, and alsoto compute interatomic distances).

CrystVector_double mSinThetaLambda
  for the crystal and the reflections in ReciprSpace.

CrystVector_double mTheta
 theta for the crystal and the HKL in ReciprSpace (in radians).

CrystVector_double mTanTheta
 tan(theta) for the crystal and the HKL in ReciprSpace (for Caglioti's law)
Note:
this should be moved to DiffractionDataPowder.


CrystVector_double mFprime
 Anomalous X-Ray scattering term f' and f" are stored here for each ScatteringPower We assume yet that data is monochromatic, but this could be specialized.

CrystVector_double mFsecond
 Anomalous X-Ray scattering term f' and f" are stored here for each ScatteringPower We assume yet that data is monochromatic, but this could be specialized.

CrystVector_double * mpTemperatureFactor
 Thermic factors as mNbScatteringPower vectors with NbRefl elements.

CrystVector_double * mpScatteringFactor
 Scattering factors as mNbScatteringPower vectors with NbRefl elements.

CrystVector_double * mpRealGeomSF
 Geometrical Structure factor for all reflection and ScatteringPower.

CrystVector_double * mpImagGeomSF
 Geometrical Structure factor for all reflection and ScatteringPower.

RefinableObjClock mClockHKL
 Clock for the list of hkl.

RefinableObjClock mClockStructFactor
 Clock for the structure factor.

RefinableObjClock mClockStructFactorSq
 Clock for the square modulus of the structure factor.

RefinableObjClock mClockTheta
 Clock the last time theta was computed.

RefinableObjClock mClockScattFactor
 Clock the last time scattering factors were computed.

RefinableObjClock mClockScattFactorResonant
 Clock the last time resonant scattering factors were computed.

RefinableObjClock mClockGeomStructFact
 Clock the last time the geometrical structure factors were computed.

RefinableObjClock mClockThermicFact
 Clock the last time temperature factors were computed.

const ScatteringComponentListmpScattCompList
 Pointer to the ScatteringComponentList of the crystal.

CrystVector_long mScatteringPowerIndex
 Index of the storage for scattering information. This array as the same size as the total number of ScatteringPower, and for each we give the index of where their scattering, temperature and resonant factors are stored. THIS IS AWFULLY KLUDGE-ESQUE !!!

CrystVector_long mScatteringPowerIndex2
 This is the reverse index. KLUDGEEEEEEEE !!!

long mNbScatteringPower
 Total number os ScatteringPower used for this DiffractionData.

ScatteringComponentList mLastScattCompList
bool mAnomalousNeedRecalc
bool mThermicNeedRecalc
bool mScattFactNeedRecalc
bool mGeomFhklCalcNeedRecalc
bool mFhklCalcNeedRecalc
bool mIgnoreImagScattFact
 Ignore imaginary part of scattering factor. More...


Detailed Description

Class to compute structure factors for a set of reflections and a Crystal.

This class only computes structure factor, but no intensity. i.e. it does not include any correction such as absorption, Lorentz or Polarization.

Does this really need to be a RefinableObj ?

Todo:
Optimize computation for Bijvoet/Friedel mates. To do this, generate an internal list of 'true independent reflections', with two entries for each, for both mates, and make the 'real' reflections only a reference to these reflections.

a lot of cleaning is necessary in the computing of structure factors, for (1) the 'preparation' part (deciding what needs to be recomputed) and (2) to allow anisotropic temperature factors (or other anisotropic parts)


Member Function Documentation

void CalcStructFactor   const [protected]
 

Compute the overall structure factor (real and imaginary part). This function is optimized for speed (geometrical structure factors are computed for all atoms and all reflections in two loops, avoiding re-calculation). So use this function for repetitive calculations.

This function recognizes the type of radiation (XRay or neutron) and uses the corresponding scattering factor/length.

Returns:
the result (real and imaginary part of the structure factor) (mRealFhklCalc, mImagFhklCalc) are stored within ScatteringData.

virtual void GenHKLFullSpace const double    maxTheta,
const bool    useMultiplicity = false
[virtual]
 

Generate a list of h,k,l to describe a full reciprocal space, up to a given maximum theta value.

Parameters:
maxTheta:maximum  theta value
useMultiplicity:  if set to true, equivalent reflections will be removed. Bijvoet (Friedel) pairs are NOT merged, for 'anomalous' reasons, unless you have chosen to ignore the imaginary part of the scattering factor. If true, then multiplicity is stored in the mMultiplicity data member.
Warning:
The ScatteringData object must already have been assigned a crystal object using SetCrystal(), and the experimental wavelength must also have been set before calling this function.
Todo:
smarter generation, using spacegroup information to remove extinct reflection rather than brute-force computation.

virtual void PrepareCalcStructFactor   const [protected, virtual]
 

Get the list of scattering components, and check what needs to be recomputed to get the new structure factors. No calculation is made in this function. Just getting prepared... Currently using flags to decide what should be recomputed, whereas Clocks should be used. a LOT of cleaning is necessary.

Todo:
Clean up the code, which is a really unbelievable mess (but working!)

virtual void SetHKL CrystVector_double const &    h,
CrystVector_double const &    k,
CrystVector_double const &    l
[virtual]
 

input H,K,L.

Parameters:
h,k,l:  double arrays (vectors with NbRefl elements -same size), with the h, k and l coordinates of all reflections.

void SetIsIgnoringImagScattFact const bool    b
 

If true, then the imaginary part of the scattering factor is ignored during Structure factor computation. (default value=false) computation of Structure Factors for Fridel/Bijvoet mates using an internal list of 'fully unique' reflections. Then only one of the mates need to be computed..

Todo:
this should become useless once we take fully advantage of coupled

void SetWavelength const string &    XRayTubeElementName,
const double    alpha2Alpha1ratio = 0.5
 

Set the wavelength of the experiment to that of an X-Ray tube.

Parameters:
XRayTubeElementName  : name of the anticathode element name. Known ones are Cr, Fe, Cu, Mo, Ag.
alpha2Alpha2ratio:  Kalpha2/Kalpha1 ratio (0.5 by default)
Alpha1 and alpha2 wavelength are taken from R. Grosse-Kunstleve package, and the average wavelength is calculated using the alpha2/alpha1 weight. All structure factors computation are made using the average wavelength, and for powder diffraction, profiles are output at the alpha1 and alpha 2 ratio for the calculated pattern.

NOTE : if the name of the wavelength is generic (eg"Cu"), then the program considers that there are both Alpha1 and Alpha2, and thus automatically changes the WavelengthType to WAVELENGTH_ALPHA12. If instead either alpha1 or alpha2 (eg "CuA1") is asked for, the WavelengthType is set to WAVELENGTH_MONOCHROMATIC.


Member Data Documentation

bool mIgnoreImagScattFact [protected]
 

Ignore imaginary part of scattering factor.

This can be used either to speed up computation, or when f" has a small effect on calculated intensities, mostly for powder diffraction (GenHKLFullSpace will not generate Friedel pairs, reducing the number of reflections by a factor up to 2 for some structures).

Practically this makes f"=0 during computation. The real resonant contribution (f') is not affected.

This may be removed later on...

Crystal* mpCrystal [protected]
 

Pointer to the crystal corresponding to this experiment.

This gives an access to the UB matrix for the crystal, as well as to the list of Scatterer.


The documentation for this class was generated from the following file:
Generated on Wed Nov 14 19:48:38 2001 for ObjCryst++ by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001