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

ObjCryst::DiffractionDataSingleCrystal Class Reference

#include <DiffractionDataSingleCrystal.h>

Inheritance diagram for ObjCryst::DiffractionDataSingleCrystal:

ObjCryst::ScatteringData ObjCryst::RefinableObj

List of all members.


Detailed Description

DiffractionData object for Single Crystal analysis.

Currently this handles only in the simplest way single crystal dat: ie only data which has been completely corrected for Lorentz/Polarization and absorption.

What needs to be developped: define the geometry of the experiment (incident and emerging angles), the polarization of the beam, etc...

Definition at line 50 of file DiffractionDataSingleCrystal.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
DiffractionDataSingleCrystal
CreateCopy () const
 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.
 DiffractionDataSingleCrystal (const DiffractionDataSingleCrystal &old)
 Copy constructor.
 DiffractionDataSingleCrystal (Crystal &cryst, const bool regist=true)
 DiffractionDataSingleCrystal (const bool regist=true)
virtual void EndOptimization ()
const void EraseAllParamSet ()
 Erase all saved refpar sets.
virtual void FitScaleFactorForR () const
virtual void FitScaleFactorForRw () const
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 REAL GetBestRFactor () const
virtual REAL GetChi2 () const
 Return conventionnal Chi^2.
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 & GetIcalc () const
 returns the calculated diffracted intensity.
const CrystVector_REAL & GetIobs () const
 Return the array of observed intensities for all peaks.
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 REAL GetR () const
 Return the Crystal R-factor (unweighted).
RadiationGetRadiation ()
virtual const RadiationGetRadiation () const
 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
virtual REAL GetRw () const
 Return the Crystal R-factor (weighted).
REAL GetScaleFactor () const
 Scale factor (applied to Icalc to match Iobs).
const map< const
ScatteringPower
*, CrystVector_REAL > & 
GetScatteringFactor () const
 Scattering factors for each ScatteringPower, as vectors with NbRefl elements.
const CrystVector_REAL & GetSigma () const
 Return the array of sigmas for observed intensities, for all peaks.
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)
const CrystVector_REAL & GetWeight () const
 Return the weights (for each reflection) used for computing Rw.
virtual void GlobalOptRandomMove (const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
void ImportHklIobs (const string &fileName, const long nbRefl, const int skipLines=0)
 Import h,k,l,I from a file.
void ImportHklIobsGroup (const string &fileName, const unsigned int skipLines=0)
 Import h,k,l and grouped intensities from a file.
void ImportHklIobsSigma (const string &fileName, const long nbRefl, const int skipLines=0)
 Import h,k,l,I,Sigma from a file.
void ImportHklIobsSigmaJanaM91 (const string &fileName)
 Import h,k,l,I,Sigma from a Jana98 '*.m91' file.
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 PrintObsCalcData () const
 Print H, K, L Iobs sigma Icalc for all reflections Iobs and sigma (if given) are scaled to Icalc (if available).
virtual void PrintObsData () const
 Print H, K, L Iobs sigma for all reflections.
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 SaveHKLIobsIcalc (const string &filename="hklIobsIcalc.out")
void SaveParamSet (const unsigned long id) const
 Save the current set of refined values over a previously-created set of saved values.
virtual void SetCrystal (Crystal &crystal)
void SetDeleteRefParInDestructor (const bool b)
void SetEnergy (const REAL)
 Set the (monochromatic) energy of the beam.
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 SetHklIobs (const CrystVector_long &h, const CrystVector_long &k, const CrystVector_long &l, const CrystVector_REAL &iObs, const CrystVector_REAL &sigma)
 input H,K,L, Iobs and Sigma
void SetIobs (const CrystVector_REAL &)
 Return the array of observed intensities for all peaks.
void SetIobsToIcalc ()
 Set Iobs to current values of Icalc. Mostly used for tests.
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 SetRadiationType (const RadiationType radiation)
 Set : neutron or x-ray experiment ? Wavelength ?
void SetSigma (const CrystVector_REAL &)
 Return the array of sigmas for observed intensities, for all peaks.
virtual void SetSigmaToSqrtIobs ()
 Set sigma for all observed intensities to sqrt(obs).
virtual void SetUseOnlyLowAngleData (const bool useOnlyLowAngle, const REAL angle=0.)
void SetWavelength (const string &XRayTubeElementName, const REAL alpha2Alpha2ratio=0.5)
void SetWavelength (const REAL)
 Set the (monochromatic) wavelength of the beam.
void SetWeight (const CrystVector_REAL &)
 Change the weights (for each reflection) used for computing Rw.
virtual void SetWeightToInvSigma2 (const REAL minRelatSigma=1e-4)
 Set the weight for all observed intensities to 1/sigma^2.
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 &)

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

Private Member Functions

void CalcIcalc () const
 Calc intensities.
void InitOptions ()
 Init options (currently only twinning).
virtual void InitRefParList ()
void PrepareTwinningCalc () const
virtual CrystVector_long SortReflectionBySinThetaOverLambda (const REAL maxTheta=-1.)

Private Attributes

CrystVector_REAL mCalcIntensity
 Calculated intensities.
REAL mChi2
 Chi^2.
RefinableObjClock mClockChi2
 Clock the last time Chi^2 was computed.
RefinableObjClock mClockIcalc
 Last time Icalc was computed.
RefinableObjClock mClockPrepareTwinningCorr
 Clock for twinning, when the preparation of twinning correction was last made.
RefinableObjClock mClockScaleFactor
 Last modification of the scale factor.
CrystVector_REAL mGroupIcalc
 The calculated intensities summed on all reflections that are grouped.
CrystVector_long mGroupIndex
CrystVector_REAL mGroupIobs
RefObjOpt mGroupOption
 Option for the type of grouping (0:no, 1:by theta values (twinning), 2:user-supplied groups).
CrystVector_REAL mGroupSigma
 The uncertainty on observed grouped intensities.
CrystVector_REAL mGroupWeight
bool mHasObservedData
 Are there observed intensities ?
long mNbGroup
 Number of groups.
long mNbGroupUsed
 Number of groups below max[sin(theta)/lambda].
CrystVector_REAL mObsIntensity
 Observed intensity (after ABS and LP corrections).
CrystVector_REAL mObsSigma
 Sigma for observed intensities (either individual reflections or spectrum).
Radiation mRadiation
REAL mScaleFactor
CrystVector_REAL mWeight
 weight for computing R-Factor, for each observed value.

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

Generated by  Doxygen 1.6.0   Back to index