Logo Search packages:      
Sourcecode: objcryst-fox version File versions  Download package

ObjCryst::ScatteringData Class Reference

#include <ScatteringData.h>

Inheritance diagram for ObjCryst::ScatteringData:

ObjCryst::RefinableObj ObjCryst::DiffractionDataSingleCrystal ObjCryst::PowderPatternDiffraction

List of all members.


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

Definition at line 276 of file ScatteringData.h.


Public Member Functions

void AddPar (RefinableObj &newRefParList, const bool copyParam=false)
void AddPar (RefinablePar *newRefPar)
void AddPar (const RefinablePar &newRefPar)
void AddRestraint (Restraint *pNewRestraint)
void BeginGlobalOptRandomMove ()
virtual void BeginOptimization (const bool allowApproximations=false, const bool enableRestraints=false)
void ClearParamSet (const unsigned long id) const
 Erase the param set with the given id, releasing memory.
virtual ScatteringDataCreateCopy () const =0
 So-called virtual copy constructor.
unsigned long CreateParamSet (const string name="") const
 Save the current set of refined values in a new set.
virtual void DeRegisterClient (RefinableObj &) const
 Deregister an object (which not any more) using this object.
virtual void EndOptimization ()
const void EraseAllParamSet ()
 Erase all saved refpar sets.
void FixAllPar ()
 Fix All parameters.
virtual void GenHKLFullSpace (const REAL maxTheta, const bool unique=false)
 Generate a list of h,k,l to describe a full reciprocal space, up to a given maximum theta value.
virtual void GenHKLFullSpace2 (const REAL maxsithsl, const bool unique=false)
 Generate a list of h,k,l to describe a full reciprocal space, up to a given maximum theta value.
virtual const string & GetClassName () const
virtual ObjRegistry
< RefinableObj > & 
GetClientRegistry ()
 Get the list of clients.
virtual const ObjRegistry
< RefinableObj > & 
GetClientRegistry () const
 Get the list of clients.
const RefinableObjClockGetClockMaster () const
 This clocks records _any_ change in the object. See refinableObj::mClockMaster.
const RefinableObjClockGetClockNbReflBelowMaxSinThetaOvLambda () const
 Clock the last time the number of reflections used was changed.
const RefinableObjClockGetClockTheta () const
 Clock the last time the sin(theta)/lambda and theta arrays were re-computed.
CrystalGetCrystal ()
 Access to the data's crystal.
const CrystalGetCrystal () const
 Const access to the data's crystal.
const CrystVector_REAL & GetFhklCalcImag () const
 Access to imaginary part of F(hkl)calc.
const CrystVector_REAL & GetFhklCalcReal () const
 Access to real part of F(hkl)calc.
const CrystVector_REAL & GetFhklCalcSq () const
 Returns the Array of calculated |F(hkl)|^2 for all reflections.
const CrystVector_REAL & GetFhklObsSq () const
 Returns the Array of observed |F(hkl)|^2 for all reflections.
virtual void GetGeneGroup (const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const
 Get the gene group assigned to each parameter.
const CrystVector_REAL & GetH () const
 Return the 1D array of H coordinates for all reflections.
const CrystVector_REAL & GetH2Pi () const
const CrystVector_REAL & GetK () const
 Return the 1D array of K coordinates for all reflections.
const CrystVector_REAL & GetK2Pi () const
const CrystVector_REAL & GetL () const
 Return the 1D array of L coordinates for all reflections.
const CrystVector_REAL & GetL2Pi () const
virtual REAL GetLogLikelihood () const
virtual const CrystVector_REAL & GetLSQCalc (const unsigned int) const
 Get the current calculated value for the LSQ function.
virtual const CrystVector_REAL & GetLSQDeriv (const unsigned int, RefinablePar &)
virtual const CrystVector_REAL & GetLSQObs (const unsigned int) const
 Get the observed values for the LSQ function.
virtual const CrystVector_REAL & GetLSQWeight (const unsigned int) const
 Get the weight values for the LSQ function.
REAL GetMaxSinThetaOvLambda () const
 Get the maximum value for sin(theta)/lambda.
virtual const string & GetName () const
 Name of the object.
virtual unsigned int GetNbLSQFunction () const
 Number of LSQ functions.
unsigned int GetNbOption () const
 Number of Options for this object.
long GetNbPar () const
long GetNbParNotFixed () const
 Total number of non-fixed parameters. Is initialized by PrepareForRefinement().
long GetNbRefl () const
 Return the number of reflections in this experiment.
virtual long GetNbReflBelowMaxSinThetaOvLambda () const
const RefObjOptGetOption (const unsigned int i) const
 const access to the options
RefObjOptGetOption (const unsigned int i)
 Access to the options.
const RefinableParGetPar (const REAL *) const
 Access parameter from its adress.
RefinableParGetPar (const REAL *)
 Access parameter from its adress.
const RefinableParGetPar (const string &name) const
 Access all parameters from their name.
RefinableParGetPar (const string &name)
 Access all parameters from their name.
const RefinableParGetPar (const long i) const
 Access all parameters in the order they were inputted.
RefinableParGetPar (const long i)
 Access all parameters in the order they were inputted.
CrystVector_REAL & GetParamSet (const unsigned long setId)
 Access one save refpar set.
const CrystVector_REAL & GetParamSet (const unsigned long setId) const
 Access one save refpar set.
REAL GetParamSet_ParNotFixedHumanValue (const unsigned long setId, const long parNumber) const
 Access the (human) value of one refined parameter in a saved set of parameters.
const string & GetParamSetName (const unsigned long setId) const
 Get the name associated to a refpar set.
const RefinableParGetParNotFixed (const long i) const
RefinableParGetParNotFixed (const long i)
virtual const RadiationGetRadiation () const =0
 Get the radiation object for this data.
RadiationType GetRadiationType () const
 Neutron or x-ray experiment ? Wavelength ?
const CrystVector_REAL & GetReflX () const
 Return the 1D array of orthonormal x coordinates for all reflections (recipr. space).
const CrystVector_REAL & GetReflY () const
 Return the 1D array of orthonormal y coordinates for all reflections (recipr. space).
const CrystVector_REAL & GetReflZ () const
 Return the 1D array of orthonormal z coordinates for all reflections (recipr. space).
const RefinableObjClockGetRefParListClock () const
virtual REAL GetRestraintCost () const
const map< const
ScatteringPower
*, CrystVector_REAL > & 
GetScatteringFactor () const
 Scattering factors for each ScatteringPower, as vectors with NbRefl elements.
const CrystVector_REAL & GetSinThetaOverLambda () const
const ObjRegistry< RefinableObj > & GetSubObjRegistry () const
 Access to the registry of RefinableObj used by this object.
ObjRegistry< RefinableObj > & GetSubObjRegistry ()
 Access to the registry of RefinableObj used by this object.
const CrystVector_REAL & GetTheta () const
 Return an array with theta values for all reflections.
CrystVector_REAL GetWavelength () const
 wavelength of the experiment (in Angstroems)
virtual void GlobalOptRandomMove (const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
bool IsBeingRefined () const
 Is the object being refined ? (Can be refined by one algorithm at a time only.).
bool IsIgnoringImagScattFact () const
void PrepareForRefinement () const
virtual void Print () const
virtual void PrintFhklCalc (ostream &os=cout) const
 Print H, K, L F^2 Re(F) Im(F) theta sin(theta)/lambda for all reflections.
virtual void PrintFhklCalcDetail (ostream &os=cout) const
 Print H, K, L sin(theta)/lambda theta F^2 Re(F) Im(F) [Re(F) Im(F)]_i, where [Re(F) Im(F)]_i are the real and imaginary contribution of the different scattering powers to the overall structure factor.
virtual void RandomizeConfiguration ()
virtual void RegisterClient (RefinableObj &) const
vector< RefinablePar * >::iterator RemovePar (RefinablePar *refPar)
vector< Restraint * >::iterator RemoveRestraint (Restraint *pRestraint)
void ResetParList ()
void RestoreParamSet (const unsigned long id)
 Restore a saved set of values.
void SaveParamSet (const unsigned long id) const
 Save the current set of refined values over a previously-created set of saved values.
 ScatteringData (const ScatteringData &old)
virtual void SetCrystal (Crystal &crystal)
void SetDeleteRefParInDestructor (const bool b)
void SetGlobalOptimStep (const RefParType *type, const REAL step)
 Change the maximum step to use during Global Optimization algorithms.
virtual void SetHKL (const CrystVector_REAL &h, const CrystVector_REAL &k, const CrystVector_REAL &l)
 input H,K,L
void SetIsIgnoringImagScattFact (const bool b)
void SetLimitsAbsolute (const RefParType *type, const REAL min, const REAL max)
 Change the limits for a category of parameters, giving absolute new limits.
void SetLimitsAbsolute (const string &parName, const REAL min, const REAL max)
 Change the limits for a given parameter, giving absolute new limits.
void SetLimitsProportional (const RefParType *type, const REAL min, const REAL max)
void SetLimitsProportional (const string &parName, const REAL min, const REAL max)
void SetLimitsRelative (const RefParType *type, const REAL min, const REAL max)
void SetLimitsRelative (const string &parName, const REAL min, const REAL max)
virtual void SetMaxSinThetaOvLambda (const REAL max)
virtual void SetName (const string &name)
 Name of the object.
void SetParIsFixed (const RefParType *type, const bool fix)
 Fix/un-fix one family of parameters.
void SetParIsFixed (const string &parName, const bool fix)
 Fix/un-fix one parameter from its name.
void SetParIsFixed (const long parIndex, const bool fix)
 Fix/un-fix one parameter from its #.
void SetParIsUsed (const RefParType *type, const bool use)
 Set whether a family of parameters is used.
void SetParIsUsed (const string &parName, const bool use)
 Set whether a parameter is used.
virtual void TagNewBestConfig () const
void UnFixAllPar ()
 UnFix All parameters.
virtual void UpdateDisplay () const
virtual void XMLInput (istream &is, const XMLCrystTag &tag)
 Input From stream.
virtual void XMLOutput (ostream &os, int indent=0) const
 Output to stream in well-formed XML.

Protected Member Functions

void AddOption (RefObjOpt *opt)
void AddSubRefObj (RefinableObj &)
void CalcGeomStructFactor () const
 Compute the 'Geometrical Structure Factor' for each ScatteringPower of the Crystal.
void CalcGlobalTemperatureFactor () const
 Compute the overall temperature factor affecting all reflections.
void CalcLuzzatiFactor () const
virtual void CalcResonantScattFactor () const
void CalcScattFactor () const
virtual void CalcSinThetaLambda () const
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.
void CalcStructFactVariance () const
void CalcTemperatureFactor () const
CrystVector_long EliminateExtinctReflections ()
long FindPar (const REAL *) const
 Find a refinable parameter from the adress of its value.
long FindPar (const string &name) const
 Find a refinable parameter with a given name.
map< unsigned long, pair
< CrystVector_REAL, string >
>::iterator 
FindParamSet (unsigned long id) const
 Find a parameter set with a given id (and check if it is there).
virtual void Prepare ()
virtual void PrepareHKLarrays ()
void RemoveSubRefObj (RefinableObj &)
virtual CrystVector_long SortReflectionBySinThetaOverLambda (const REAL maxSTOL=-1.)

Protected Attributes

ObjRegistry< RefinableObjmClientObjRegistry
RefinableObjClock mClockFhklCalcVariance
RefinableObjClock mClockFhklObsSq
 Last time observed squared structure factors were altered.
RefinableObjClock mClockGeomStructFact
 Clock the last time the geometrical structure factors were computed.
RefinableObjClock mClockGlobalBiso
 last time the global Biso factor was modified
RefinableObjClock mClockGlobalTemperatureFact
 last time the global temperature factor was computed
RefinableObjClock mClockHKL
 Clock for the list of hkl.
RefinableObjClock mClockLuzzatiFactor
RefinableObjClock mClockMaster
RefinableObjClock mClockNbReflUsed
 Clock recording the last time the number of reflections used has increased.
RefinableObjClock mClockScattFactor
 Clock the last time scattering factors were computed.
RefinableObjClock mClockScattFactorResonant
 Clock the last time resonant scattering factors were computed.
RefinableObjClock mClockStructFactor
 Clock for the structure factor.
RefinableObjClock mClockStructFactorSq
 Clock for the square modulus of the structure factor.
RefinableObjClock mClockThermicFact
 Clock the last time temperature factors were computed.
RefinableObjClock mClockTheta
 Clock the last time theta was computed.
bool mDeleteRefParInDestructor
CrystVector_int mExpectedIntensityFactor
CrystVector_REAL mFhklCalcImag
CrystVector_REAL mFhklCalcReal
 real &imaginary parts of F(HKL)calc
CrystVector_REAL mFhklCalcSq
 F(HKL)^2 calc for each reflection.
CrystVector_REAL mFhklCalcVariance
CrystVector_REAL mFhklObsSq
 Observed squared structure factors (zero-sized if none).
REAL mGlobalBiso
CrystVector_REAL mGlobalTemperatureFactor
 Global Biso factor.
CrystVector_REAL mH
 H,K,L coordinates.
CrystVector_REAL mH2Pi
 H,K,L coordinates, multiplied by 2PI.
bool mIgnoreImagScattFact
 Ignore imaginary part of scattering factor.
CrystVector_long mIntH
 H,K,L integer coordinates.
CrystVector_long mIntK
CrystVector_long mIntL
bool mIsbeingRefined
 Is the object being refined ?
CrystVector_REAL mK
CrystVector_REAL mK2Pi
CrystVector_REAL mL
CrystVector_REAL mL2Pi
CrystVector_REAL mLSQDeriv
REAL mMaxSinThetaOvLambda
CrystVector_int mMultiplicity
 Multiplicity for each reflections (mostly for powder diffraction).
string mName
 Name for this RefinableObject. Should be unique, at least in the same scope.+.
long mNbRefl
 Number of H,K,L reflections.
long mNbReflUsed
long mNbRefParNotFixed
 Total of not-fixed parameters.
ObjRegistry< RefObjOptmOptionRegistry
CrystalmpCrystal
bool mRandomMoveIsDone
RefinableObjClock mRefParListClock
 Last time the RefinableParList was modified (a parameter added or removed).
CrystVector_long mRefparNotFixedIndex
 Index of not-fixed parameters.
CrystVector_REAL mSinThetaLambda
ObjRegistry< RefinableObjmSubObjRegistry
 Registry of RefinableObject needed for this object (owned by this object or not).
CrystVector_REAL mTheta
 theta for the crystal and the HKL in ReciprSpace (in radians)
bool mUseFastLessPreciseFunc
map< const ScatteringPower
*, REAL > 
mvFprime
map< const ScatteringPower
*, REAL > 
mvFsecond
map< const ScatteringPower
*, CrystVector_REAL > 
mvImagGeomSF
map< const ScatteringPower
*, CrystVector_REAL > 
mvLuzzatiFactor
 The Luzzati 'D' factor for each scattering power and each reflection.
vector< RefinablePar * > mvpRefPar
 Vector of pointers to the refinable parameters.
vector< Restraint * > mvpRestraint
map< unsigned long, pair
< CrystVector_REAL, string > > 
mvpSavedValuesSet
map< const ScatteringPower
*, CrystVector_REAL > 
mvRealGeomSF
 Geometrical Structure factor for each ScatteringPower, as vectors with NbRefl elements.
map< const ScatteringPower
*, CrystVector_REAL > 
mvScatteringFactor
 Scattering factors for each ScatteringPower, as vectors with NbRefl elements.
map< const ScatteringPower
*, CrystVector_REAL > 
mvTemperatureFactor
 Thermic factors for each ScatteringPower, as vectors with NbRefl elements.
CrystVector_REAL mX
 reflection coordinates in an orthonormal base
CrystVector_REAL mY
CrystVector_REAL mZ

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index