FOX/ObjCryst++  1.10.X (development)
ReflectionProfile.h
1 /* ObjCryst++ Object-Oriented Crystallographic Library
2  (c) 2000-2005 Vincent Favre-Nicolin vincefn@users.sourceforge.net
3  2000-2001 University of Geneva (Switzerland)
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 #ifndef _OBJCRYST_REFLECTIONPROFILE_H_
20 #define _OBJCRYST_REFLECTIONPROFILE_H_
21 
22 #include <complex>
23 #include "ObjCryst/CrystVector/CrystVector.h"
24 #include "ObjCryst/ObjCryst/General.h"
25 #include "ObjCryst/ObjCryst/UnitCell.h"
26 #include "ObjCryst/RefinableObj/RefinableObj.h"
27 
28 namespace ObjCryst
29 {
30 //######################################################################
31 // basic functions used for profiles
32 //######################################################################
33 
37 CrystVector_REAL PowderProfileGauss (const CrystVector_REAL theta,
38  const REAL fwhm, const REAL center, const REAL asym=1.0);
42 CrystVector_REAL PowderProfileLorentz(const CrystVector_REAL theta,
43  const REAL fwhm, const REAL center, const REAL asym=1.0);
45 CrystVector_REAL AsymmetryBerarBaldinozzi(const CrystVector_REAL theta,
46  const REAL fwhm, const REAL center,
47  const REAL A0, const REAL A1,
48  const REAL B0, const REAL B1);
49 
54 template <class T> std::complex<T>ExponentialIntegral1(const complex<T> z);
59 template <class T> std::complex<T>ExponentialIntegral1_ExpZ(const complex<T> z);
60 
65 {
66  public:
69  virtual ~ReflectionProfile();
70  virtual ReflectionProfile* CreateCopy()const=0;
80  virtual CrystVector_REAL GetProfile(const CrystVector_REAL &x, const REAL xcenter,
81  const REAL h, const REAL k, const REAL l)const=0;
84  virtual REAL GetFullProfileWidth(const REAL relativeIntensity, const REAL xcenter,
85  const REAL h, const REAL k, const REAL l)=0;
87  virtual bool IsAnisotropic()const;
88  virtual void XMLOutput(ostream &os,int indent=0)const=0;
89  virtual void XMLInput(istream &is,const XMLCrystTag &tag)=0;
90  private:
91 #ifdef __WX__CRYST__
92  public:
93  virtual WXCrystObjBasic* WXCreate(wxWindow* parent)=0;
94 #endif
95 };
96 
101 {
102  public:
105  virtual ~ReflectionProfilePseudoVoigt();
106  virtual ReflectionProfilePseudoVoigt* CreateCopy()const;
107  virtual const string& GetClassName()const;
108  CrystVector_REAL GetProfile(const CrystVector_REAL &x, const REAL xcenter,
109  const REAL h, const REAL k, const REAL l)const;
118  void SetProfilePar(const REAL fwhmCagliotiW,
119  const REAL fwhmCagliotiU=0,
120  const REAL fwhmCagliotiV=0,
121  const REAL eta0=0.5,
122  const REAL eta1=0.);
123  virtual REAL GetFullProfileWidth(const REAL relativeIntensity, const REAL xcenter,
124  const REAL h, const REAL k, const REAL l);
125  bool IsAnisotropic()const;
126  virtual void XMLOutput(ostream &os,int indent=0)const;
127  virtual void XMLInput(istream &is,const XMLCrystTag &tag);
128  private:
130  void InitParameters();
132  REAL mCagliotiU,mCagliotiV,mCagliotiW;
135  REAL mPseudoVoigtEta0,mPseudoVoigtEta1;
141  REAL mAsymBerarBaldinozziA0,mAsymBerarBaldinozziA1,
142  mAsymBerarBaldinozziB0,mAsymBerarBaldinozziB1;
153  REAL mAsym0,mAsym1,mAsym2;
154 #ifdef __WX__CRYST__
155  public:
156  virtual WXCrystObjBasic* WXCreate(wxWindow* parent);
157 #endif
158 };
159 
164 {
165  public:
169  virtual ReflectionProfilePseudoVoigtAnisotropic* CreateCopy()const;
170  virtual const string& GetClassName()const;
171  CrystVector_REAL GetProfile(const CrystVector_REAL &x, const REAL xcenter,
172  const REAL h, const REAL k, const REAL l)const;
181  void SetProfilePar(const REAL fwhmCagliotiW,
182  const REAL fwhmCagliotiU=0,
183  const REAL fwhmCagliotiV=0,
184  const REAL fwhmGaussP=0,
185  const REAL fwhmLorentzX=0,
186  const REAL fwhmLorentzY=0,
187  const REAL fwhmLorentzGammaHH=0,
188  const REAL fwhmLorentzGammaKK=0,
189  const REAL fwhmLorentzGammaLL=0,
190  const REAL fwhmLorentzGammaHK=0,
191  const REAL fwhmLorentzGammaHL=0,
192  const REAL fwhmLorentzGammaKL=0,
193  const REAL pseudoVoigtEta0=0,
194  const REAL pseudoVoigtEta1=0,
195  const REAL asymA0=0,
196  const REAL asymA1=0,
197  const REAL asymA2=0
198  );
199  virtual REAL GetFullProfileWidth(const REAL relativeIntensity, const REAL xcenter,
200  const REAL h, const REAL k, const REAL l);
201  bool IsAnisotropic()const;
202  virtual void XMLOutput(ostream &os,int indent=0)const;
203  virtual void XMLInput(istream &is,const XMLCrystTag &tag);
204  private:
206  void InitParameters();
227  REAL mCagliotiU,mCagliotiV,mCagliotiW,mScherrerP,mLorentzX,mLorentzY,
228  mLorentzGammaHH,mLorentzGammaKK,mLorentzGammaLL,mLorentzGammaHK,mLorentzGammaHL,mLorentzGammaKL;
231  REAL mPseudoVoigtEta0,mPseudoVoigtEta1;
242  REAL mAsym0,mAsym1,mAsym2;
243  #ifdef __WX__CRYST__
244  public:
245  virtual WXCrystObjBasic* WXCreate(wxWindow* parent);
246  #endif
247 };
248 
254 {
255  public:
265  virtual ReflectionProfileDoubleExponentialPseudoVoigt* CreateCopy()const;
266  virtual const string& GetClassName()const;
267  CrystVector_REAL GetProfile(const CrystVector_REAL &x, const REAL xcenter,
268  const REAL h, const REAL k, const REAL l)const;
272  void SetProfilePar(const REAL instrumentAlpha0,
273  const REAL instrumentAlpha1,
274  const REAL instrumentBeta0,
275  const REAL instrumentBeta1,
276  const REAL gaussianSigma0,
277  const REAL gaussianSigma1,
278  const REAL gaussianSigma2,
279  const REAL lorentzianGamma0,
280  const REAL lorentzianGamma1,
281  const REAL lorentzianGamma2);
282  virtual REAL GetFullProfileWidth(const REAL relativeIntensity, const REAL xcenter,
283  const REAL h, const REAL k, const REAL l);
284  bool IsAnisotropic()const;
285  virtual void XMLOutput(ostream &os,int indent=0)const;
286  virtual void XMLInput(istream &is,const XMLCrystTag &tag);
290  void SetUnitCell(const UnitCell &cell);
291  private:
293  void InitParameters();
294  REAL mInstrumentAlpha0;
295  REAL mInstrumentAlpha1;
296  REAL mInstrumentBeta0;
297  REAL mInstrumentBeta1;
298  REAL mGaussianSigma0;
299  REAL mGaussianSigma1;
300  REAL mGaussianSigma2;
301  REAL mLorentzianGamma0;
302  REAL mLorentzianGamma1;
303  REAL mLorentzianGamma2;
304  const UnitCell *mpCell;
305 #ifdef __WX__CRYST__
306  public:
307  virtual WXCrystObjBasic* WXCreate(wxWindow* parent);
308 #endif
309 };
312 }//namespace
313 #endif
virtual const string & GetClassName() const
Name for this class ("RefinableObj", "Crystal",...).
REAL mPseudoVoigtEta0
Pseudo-Voigt mixing parameter : eta=eta0 +2*theta*eta1 eta=1 -> pure Lorentzian ; eta=0 -> pure Gauss...
Pseudo-Voigt reflection profile, with 6-parameters anisotropic Lorentzian broadening and Toraya asymm...
Double-Exponential Pseudo-Voigt profile for TOF.
virtual const string & GetClassName() const
Name for this class ("RefinableObj", "Crystal",...).
bool IsAnisotropic() const
Is the profile anisotropic ?
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...
void SetUnitCell(const UnitCell &cell)
Set unit cell.
bool IsAnisotropic() const
Is the profile anisotropic ?
bool IsAnisotropic() const
Is the profile anisotropic ?
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
CrystVector_REAL GetProfile(const CrystVector_REAL &x, const REAL xcenter, const REAL h, const REAL k, const REAL l) const
Get the reflection profile.
virtual const string & GetClassName() const
Name for this class ("RefinableObj", "Crystal",...).
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
virtual void XMLOutput(ostream &os, int indent=0) const =0
Output to stream in well-formed XML.
REAL mAsymBerarBaldinozziA0
Asymmetry parameters, following the Bérar & Baldinozzi approach ( Bérar & baldinozzi, J.
void InitParameters()
Initialize parameters.
virtual REAL GetFullProfileWidth(const REAL relativeIntensity, const REAL xcenter, const REAL h, const REAL k, const REAL l)=0
Get the (approximate) full profile width at a given percentage of the profile maximum (e...
REAL mAsym0
Asymmetry parameters, following the analytical function for asymmetric pseudo-voigt given by Toraya i...
Generic Refinable Object.
Definition: RefinableObj.h:752
REAL mPseudoVoigtEta0
Pseudo-Voigt mixing parameter : eta=1 -> pure Lorentzian ; eta=0 -> pure Gaussian.
Abstract base class for all objects in wxCryst.
Definition: wxCryst.h:127
Abstract base class for reflection profiles.
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.
virtual bool IsAnisotropic() const
Is the profile anisotropic ?
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)=0
Input From stream.
CrystVector_REAL GetProfile(const CrystVector_REAL &x, const REAL xcenter, const REAL h, const REAL k, const REAL l) const
Get the reflection profile.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
virtual CrystVector_REAL GetProfile(const CrystVector_REAL &x, const REAL xcenter, const REAL h, const REAL k, const REAL l) const =0
Get the reflection profile.
std::complex< T > ExponentialIntegral1(const complex< T > z)
Complex exponential integral E1(z) (Abramowitz & Stegun, chap.
REAL mAsym0
Asymmetry parameters, following the analytical function for asymmetric pseudo-voigt given by Toraya i...
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
Definition: Atom.cpp:47
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...
Unit Cell class: Unit cell with spacegroup information.
Definition: UnitCell.h:71
CrystVector_REAL GetProfile(const CrystVector_REAL &x, const REAL xcenter, const REAL h, const REAL k, const REAL l) const
Get the reflection profile.
REAL mCagliotiU
FWHM parameters, following Caglioti's law.
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...
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
Pseudo-Voigt reflection profile.
class to input or output a well-formatted xml beginning or ending tag.
CrystVector_REAL AsymmetryBerarBaldinozzi(const CrystVector_REAL x, const REAL fw, const REAL center, const REAL a0, const REAL a1, const REAL b0, const REAL b1)
Asymmetry function [Ref J. Appl. Cryst 26 (1993), 128-129.
ReflectionProfileDoubleExponentialPseudoVoigt()
Constructor, without unit cell.
void SetProfilePar(const REAL fwhmCagliotiW, const REAL fwhmCagliotiU=0, const REAL fwhmCagliotiV=0, const REAL eta0=0.5, const REAL eta1=0.)
Set reflection profile parameters.
Object Registry.
Definition: RefinableObj.h:643
void SetProfilePar(const REAL instrumentAlpha0, const REAL instrumentAlpha1, const REAL instrumentBeta0, const REAL instrumentBeta1, const REAL gaussianSigma0, const REAL gaussianSigma1, const REAL gaussianSigma2, const REAL lorentzianGamma0, const REAL lorentzianGamma1, const REAL lorentzianGamma2)
Set reflection profile parameters.
std::complex< T > ExponentialIntegral1_ExpZ(const complex< T > z)
E1(z)*exp(z)
ObjRegistry< ReflectionProfile > gReflectionProfileRegistry("List of all ReflectionProfile types")
Global registry for all ReflectionProfile objects.