FOX/ObjCryst++  1.10.X (development)
ObjCryst::ReflectionProfilePseudoVoigtAnisotropic Class Reference

Pseudo-Voigt reflection profile, with 6-parameters anisotropic Lorentzian broadening and Toraya asymmetric modelling. More...

+ Inheritance diagram for ObjCryst::ReflectionProfilePseudoVoigtAnisotropic:
+ Collaboration diagram for ObjCryst::ReflectionProfilePseudoVoigtAnisotropic:

Public Member Functions

 ReflectionProfilePseudoVoigtAnisotropic (const ReflectionProfilePseudoVoigtAnisotropic &old)
 
virtual
ReflectionProfilePseudoVoigtAnisotropic
CreateCopy () const
 
virtual const string & GetClassName () const
 Name for this class ("RefinableObj", "Crystal",...). More...
 
CrystVector_REAL GetProfile (const CrystVector_REAL &x, const REAL xcenter, const REAL h, const REAL k, const REAL l) const
 Get the reflection profile. More...
 
void SetProfilePar (const REAL fwhmCagliotiW, const REAL fwhmCagliotiU=0, const REAL fwhmCagliotiV=0, const REAL fwhmGaussP=0, const REAL fwhmLorentzX=0, const REAL fwhmLorentzY=0, const REAL fwhmLorentzGammaHH=0, const REAL fwhmLorentzGammaKK=0, const REAL fwhmLorentzGammaLL=0, const REAL fwhmLorentzGammaHK=0, const REAL fwhmLorentzGammaHL=0, const REAL fwhmLorentzGammaKL=0, const REAL pseudoVoigtEta0=0, const REAL pseudoVoigtEta1=0, const REAL asymA0=0, const REAL asymA1=0, const REAL asymA2=0)
 Set reflection profile parameters. More...
 
virtual REAL GetFullProfileWidth (const REAL relativeIntensity, const REAL xcenter, const REAL h, const REAL k, const REAL l)
 Get the (approximate) full profile width at a given percentage of the profile maximum (e.g. More...
 
bool IsAnisotropic () const
 Is the profile anisotropic ?
 
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...
 
- Public Member Functions inherited from ObjCryst::ReflectionProfile
 ReflectionProfile (const ReflectionProfile &old)
 
- Public Member Functions inherited from ObjCryst::RefinableObj
 RefinableObj ()
 Constructor.
 
 RefinableObj (const bool internalUseOnly)
 Constructor. More...
 
 RefinableObj (const RefinableObj &old)
 Defined not implemented... More...
 
virtual ~RefinableObj ()
 Destructor.
 
virtual const string & GetName () const
 Name of the object.
 
virtual void SetName (const string &name)
 Name of the object.
 
void operator= (const RefinableObj &old)
 Defined not implemented... More...
 
void PrepareForRefinement () const
 Find which parameters are used and not fixed, for a refinement /optimization. More...
 
void FixAllPar ()
 Fix All parameters.
 
void UnFixAllPar ()
 UnFix All parameters.
 
void SetParIsFixed (const long parIndex, const bool fix)
 Fix/un-fix one parameter from its #.
 
void SetParIsFixed (const string &parName, const bool fix)
 Fix/un-fix one parameter from its name.
 
void SetParIsFixed (const RefParType *type, const bool fix)
 Fix/un-fix one family of parameters.
 
void SetParIsUsed (const string &parName, const bool use)
 Set whether a parameter is used.
 
void SetParIsUsed (const RefParType *type, const bool use)
 Set whether a family of parameters is used.
 
long GetNbPar () const
 Total number of refinable parameter in the object. More...
 
long GetNbParNotFixed () const
 Total number of non-fixed parameters. Is initialized by PrepareForRefinement()
 
RefinableParGetPar (const long i)
 Access all parameters in the order they were inputted.
 
const RefinableParGetPar (const long i) const
 Access all parameters in the order they were inputted.
 
RefinableParGetPar (const string &name)
 Access all parameters from their name.
 
const RefinableParGetPar (const string &name) const
 Access all parameters from their name.
 
RefinableParGetPar (const REAL *)
 Access parameter from its adress.
 
const RefinableParGetPar (const REAL *) const
 Access parameter from its adress.
 
RefinableParGetParNotFixed (const long i)
 Access all parameters in the order they were inputted, skipping fixed parameters. More...
 
const RefinableParGetParNotFixed (const long i) const
 Access all parameters in the order they were inputed, skipping fixed parameters. More...
 
void AddPar (const RefinablePar &newRefPar)
 Add a refinable parameter. More...
 
void AddPar (RefinablePar *newRefPar)
 Add a refinable parameter. More...
 
void AddPar (RefinableObj &newRefParList, const bool copyParam=false)
 Add all the parameters in another RefinableObj. More...
 
vector< RefinablePar * >::iterator RemovePar (RefinablePar *refPar)
 Remove a refinable parameter. More...
 
virtual void Print () const
 
unsigned long CreateParamSet (const string name="") const
 Save the current set of refined values in a new set. More...
 
void ClearParamSet (const unsigned long id) const
 Erase the param set with the given id, releasing memory.
 
void SaveParamSet (const unsigned long id) const
 Save the current set of refined values over a previously-created set of saved values. More...
 
void RestoreParamSet (const unsigned long id)
 Restore a saved set of values. More...
 
const CrystVector_REAL & GetParamSet (const unsigned long setId) const
 Access one save refpar set. More...
 
CrystVector_REAL & GetParamSet (const unsigned long setId)
 Access one save refpar set. More...
 
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. More...
 
const void EraseAllParamSet ()
 Erase all saved refpar sets. More...
 
const string & GetParamSetName (const unsigned long setId) const
 Get the name associated to a refpar set. More...
 
void SetLimitsAbsolute (const string &parName, const REAL min, const REAL max)
 Change the limits for a given parameter, giving absolute new limits.
 
void SetLimitsAbsolute (const RefParType *type, const REAL min, const REAL max)
 Change the limits for a category of parameters, giving absolute new limits.
 
void SetLimitsRelative (const string &parName, const REAL min, const REAL max)
 Change the limits for a given parameter, giving relative new limits (eg giving -.1 and +.1 will set new limits at the current value + min and current value + max) Thus min should logically be <0 and max >0. More...
 
void SetLimitsRelative (const RefParType *type, const REAL min, const REAL max)
 Change the limits for a category of parameters, giving relative new limits (eg giving -.1 and +.1 will set new limits at the current value + min and current value + max). More...
 
void SetLimitsProportional (const string &parName, const REAL min, const REAL max)
 Change the limits for a given parameter, proportionnaly to the current value. More...
 
void SetLimitsProportional (const RefParType *type, const REAL min, const REAL max)
 Change the limits for a category of parameters, proportionnaly to their current value. More...
 
void SetGlobalOptimStep (const RefParType *type, const REAL step)
 Change the maximum step to use during Global Optimization algorithms.
 
ObjRegistry< RefinableObj > & GetSubObjRegistry ()
 Access to the registry of RefinableObj used by this object.
 
const ObjRegistry< RefinableObj > & GetSubObjRegistry () const
 Access to the registry of RefinableObj used by this object.
 
virtual void RegisterClient (RefinableObj &) const
 Register a new object using this object. More...
 
virtual void DeRegisterClient (RefinableObj &) const
 Deregister an object (which not any more) using this object.
 
virtual const ObjRegistry
< RefinableObj > & 
GetClientRegistry () const
 Get the list of clients.
 
virtual ObjRegistry
< RefinableObj > & 
GetClientRegistry ()
 Get the list of clients.
 
bool IsBeingRefined () const
 Is the object being refined ? (Can be refined by one algorithm at a time only.)
 
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. More...
 
virtual void EndOptimization ()
 This should be called by any optimization class at the end of an optimization. More...
 
virtual void SetApproximationFlag (const bool allow)
 Enable or disable numerical approximations. More...
 
virtual void RandomizeConfiguration ()
 Randomize Configuration (before a global optimization). More...
 
virtual void GlobalOptRandomMove (const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
 Make a random move of the current configuration. More...
 
void BeginGlobalOptRandomMove ()
 Raise a flag, to be sure not to make a random change more than once in each RefinableObj. More...
 
virtual REAL GetLogLikelihood () const
 Get -log(likelihood) of the current configuration for the object. More...
 
virtual unsigned int GetNbLSQFunction () const
 Number of LSQ functions.
 
virtual const CrystVector_REAL & GetLSQCalc (const unsigned int) const
 Get the current calculated value for the LSQ function.
 
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.
 
virtual const CrystVector_REAL & GetLSQDeriv (const unsigned int, RefinablePar &)
 Get the first derivative values for the LSQ function, for a given parameter. More...
 
virtual std::map< RefinablePar
*, CrystVector_REAL > & 
GetLSQ_FullDeriv (const unsigned int, std::set< RefinablePar * > &vPar)
 Get the first derivative for the LSQ function for each parameter supplied in a list. More...
 
void ResetParList ()
 Re-init the list of refinable parameters, removing all parameters. More...
 
virtual void UpdateDisplay () const
 If there is an interface, this should be automatically be called each time there is a 'new, significant' configuration to report. More...
 
unsigned int GetNbOption () const
 Number of Options for this object.
 
RefObjOptGetOption (const unsigned int i)
 Access to the options.
 
const RefObjOptGetOption (const unsigned int i) const
 const access to the options
 
virtual void GetGeneGroup (const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const
 Get the gene group assigned to each parameter. More...
 
void SetDeleteRefParInDestructor (const bool b)
 Set this object not to delete its list of parameters when destroyed. More...
 
const RefinableObjClockGetRefParListClock () const
 What was the last time a RefinablePar was added/removed ? More...
 
virtual REAL GetRestraintCost () const
 Get the restraint cost (overall penalty of all restraints) More...
 
void AddRestraint (Restraint *pNewRestraint)
 Add a new restraint. More...
 
vector< Restraint * >::iterator RemoveRestraint (Restraint *pRestraint)
 Remove a restraint from the list of known restraints. More...
 
virtual void TagNewBestConfig () const
 During a global optimization, tells the object that the current config is the latest "best" config. More...
 
const RefinableObjClockGetClockMaster () const
 This clocks records any change in the object. See refinableObj::mClockMaster.
 

Private Member Functions

void InitParameters ()
 Initialize parameters.
 

Private Attributes

REAL mCagliotiU
 FWHM parameters: More...
 
REAL mCagliotiV
 
REAL mCagliotiW
 
REAL mScherrerP
 
REAL mLorentzX
 
REAL mLorentzY
 
REAL mLorentzGammaHH
 
REAL mLorentzGammaKK
 
REAL mLorentzGammaLL
 
REAL mLorentzGammaHK
 
REAL mLorentzGammaHL
 
REAL mLorentzGammaKL
 
REAL mPseudoVoigtEta0
 Pseudo-Voigt mixing parameter : $ \eta=\eta_0 +2*\vartheta*\eta_1$ eta=1 -> pure Lorentzian ; eta=0 -> pure Gaussian.
 
REAL mPseudoVoigtEta1
 
REAL mAsym0
 Asymmetry parameters, following the analytical function for asymmetric pseudo-voigt given by Toraya in J. More...
 
REAL mAsym1
 
REAL mAsym2
 

Additional Inherited Members

- Protected Member Functions inherited from ObjCryst::RefinableObj
long FindPar (const string &name) const
 Find a refinable parameter with a given name.
 
long FindPar (const REAL *) const
 Find a refinable parameter from the adress of its value.
 
void AddSubRefObj (RefinableObj &)
 
void RemoveSubRefObj (RefinableObj &)
 
void AddOption (RefObjOpt *opt)
 
virtual void Prepare ()
 
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)
 
- Protected Attributes inherited from ObjCryst::RefinableObj
string mName
 Name for this RefinableObject. Should be unique, at least in the same scope.+.
 
vector< RefinablePar * > mvpRefPar
 Vector of pointers to the refinable parameters.
 
vector< Restraint * > mvpRestraint
 Vector of pointers to the restraints for this object. More...
 
map< unsigned long, pair
< CrystVector_REAL, string > > 
mvpSavedValuesSet
 Map of (index,pointers to arrays) used to save sets of values for all parameters. More...
 
long mNbRefParNotFixed
 Total of not-fixed parameters.
 
CrystVector_long mRefparNotFixedIndex
 Index of not-fixed parameters.
 
int mOptimizationDepth
 Is the object being refined or optimized ? if mOptimizationDepth=0, no optimization is taking place. More...
 
ObjRegistry< RefinableObjmSubObjRegistry
 Registry of RefinableObject needed for this object (owned by this object or not)
 
ObjRegistry< RefinableObjmClientObjRegistry
 Registry of RefinableObject using this object. More...
 
ObjRegistry< RefObjOptmOptionRegistry
 List of options for this object. More...
 
bool mDeleteRefParInDestructor
 If true (the default), then all RefinablePar will be deleted when the the object is deleted. More...
 
RefinableObjClock mRefParListClock
 Last time the RefinableParList was modified (a parameter added or removed).
 
bool mRandomMoveIsDone
 
CrystVector_REAL mLSQDeriv
 Temporary array used to return derivative values of the LSQ function for given parameters. More...
 
std::map< unsigned int,
std::map< RefinablePar
*, CrystVector_REAL > > 
mLSQ_FullDeriv
 Temporary map to return the derivative of the LSQ function versus a list of parameters. More...
 
RefinableObjClock mClockMaster
 Master clock, which is changed whenever the object has been altered. More...
 

Detailed Description

Pseudo-Voigt reflection profile, with 6-parameters anisotropic Lorentzian broadening and Toraya asymmetric modelling.

Definition at line 163 of file ReflectionProfile.h.

Member Function Documentation

const string & ObjCryst::ReflectionProfilePseudoVoigtAnisotropic::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::RefinableObj.

Definition at line 517 of file ReflectionProfile.cpp.

REAL ObjCryst::ReflectionProfilePseudoVoigtAnisotropic::GetFullProfileWidth ( const REAL  relativeIntensity,
const REAL  xcenter,
const REAL  h,
const REAL  k,
const REAL  l 
)
virtual

Get the (approximate) full profile width at a given percentage of the profile maximum (e.g.

FWHM=GetFullProfileWidth(0.5)).

Implements ObjCryst::ReflectionProfile.

Definition at line 596 of file ReflectionProfile.cpp.

CrystVector_REAL ObjCryst::ReflectionProfilePseudoVoigtAnisotropic::GetProfile ( const CrystVector_REAL &  x,
const REAL  xcenter,
const REAL  h,
const REAL  k,
const REAL  l 
) const
virtual

Get the reflection profile.

Parameters
xthe vector of x coordinates (i.e. either 2theta or time-of-flight)
xcentercoordinate (2theta, tof) of the center of the peak
h,k,lreflection Miller indices
Note
: derived classes who need either d_hkl or the orthonormal coordinates of the scattering vector should be passed a ObjCryst::UnitCell object in the constructor so that they can use ObjCryst::UnitCell::MillerToOrthonormalCoords()

Implements ObjCryst::ReflectionProfile.

Definition at line 523 of file ReflectionProfile.cpp.

void ObjCryst::ReflectionProfilePseudoVoigtAnisotropic::SetProfilePar ( const REAL  fwhmCagliotiW,
const REAL  fwhmCagliotiU = 0,
const REAL  fwhmCagliotiV = 0,
const REAL  fwhmGaussP = 0,
const REAL  fwhmLorentzX = 0,
const REAL  fwhmLorentzY = 0,
const REAL  fwhmLorentzGammaHH = 0,
const REAL  fwhmLorentzGammaKK = 0,
const REAL  fwhmLorentzGammaLL = 0,
const REAL  fwhmLorentzGammaHK = 0,
const REAL  fwhmLorentzGammaHL = 0,
const REAL  fwhmLorentzGammaKL = 0,
const REAL  pseudoVoigtEta0 = 0,
const REAL  pseudoVoigtEta1 = 0,
const REAL  asymA0 = 0,
const REAL  asymA1 = 0,
const REAL  asymA2 = 0 
)

Set reflection profile parameters.

if only W is given, the width is constant

See documentation for mCagliotiU,mCagliotiV,mCagliotiW,mScherrerP,mLorentzX,mLorentzY, mLorentzGammaHH,mLorentzGammaKK,mLorentzGammaLL,mLorentzGammaHK,mLorentzGammaHL,mLorentzGammaKL mAsym0,mAsym1,mAsym2.

Definition at line 558 of file ReflectionProfile.cpp.

void ObjCryst::ReflectionProfilePseudoVoigtAnisotropic::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...

Implements ObjCryst::ReflectionProfile.

Definition at line 712 of file ReflectionProfile.cpp.

void ObjCryst::ReflectionProfilePseudoVoigtAnisotropic::XMLOutput ( ostream &  os,
int  indent = 0 
) const
virtual

Output to stream in well-formed XML.

Todo:
Use inheritance.. as for XMLInputTag()...

Implements ObjCryst::ReflectionProfile.

Definition at line 647 of file ReflectionProfile.cpp.

Member Data Documentation

REAL ObjCryst::ReflectionProfilePseudoVoigtAnisotropic::mAsym0
private

Asymmetry parameters, following the analytical function for asymmetric pseudo-voigt given by Toraya in J.

Appl. Cryst 23(1990),485-491

Asymmetric coefficient:

\[ A=A_0+A_1/\sin(2\vartheta)+A_2/\sin^2(2\vartheta) \]

Asymmetric profile:

\[ Prof(\vartheta-\vartheta_{max}<=0)=Prof_0(\frac{1+A}{A})(\vartheta-\vartheta_{max})) \]

\[ Prof(\vartheta-\vartheta_{max}>=0)=Prof_0((1+A) (\vartheta-\vartheta_{max})) \]

Definition at line 242 of file ReflectionProfile.h.

REAL ObjCryst::ReflectionProfilePseudoVoigtAnisotropic::mCagliotiU
private

FWHM parameters:

Profile: $ Prof(\vartheta) = \eta Lorentz(\vartheta) + (1-\eta) Gauss(\vartheta) $

This pseudo-Voigt profile is the linear combination of a Gaussian and a Lorentzian:

\[ Profile(\vartheta)= Lorentz(\vartheta) + Gauss(\vartheta)\]

Gaussian FWHM parameters, following Caglioti's law and Scherrer broadening coefficient:

\[ fwhm_g^2= U \tan^2(\theta) + V \tan(\theta) +W +\frac{P}{\cos^2\vartheta} \]

See Cagliotti, Pauletti & Ricci, Nucl. Instrum. 3 (1958), 223.

Lorentzian FWHM parameters

\[ fwhm_l= \frac{X}{\cos\vartheta} +(Y + \frac{\gamma_L}{\sin^2\vartheta})\tan\vartheta \]

with anisotropic broadening factor:

\[ \gamma_L = \gamma_{HH}h^2 + \gamma_{KK}k^2 + \gamma_{LL}l^2 + 2\gamma_{HK}hk + 2\gamma_{hl} + 2\gamma_{kl}kl\]

Note
: in the above formula we use $ \frac{\gamma_L}{\sin^2\vartheta} $ rather than the more usual $ \gamma_L d^2 $ for computing purposes (the model being purely phenomenological).

Definition at line 227 of file ReflectionProfile.h.


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