FOX/ObjCryst++  2022
ScatteringCorr.h
1 /* ObjCryst++ Object-Oriented Crystallographic Library
2  (c) 2000-2002 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_SCATTERING_CORR_H_
20 #define _OBJCRYST_SCATTERING_CORR_H_
21 
22 #include "ObjCryst/ObjCryst/ScatteringData.h"
23 
24 namespace ObjCryst
25 {
26 
36 {
37  public:
39  ScatteringCorr(const ScatteringData & data);
40  virtual ~ScatteringCorr();
42  virtual const string & GetName() const=0;
44  virtual const string & GetClassName() const=0;
48  const CrystVector_REAL& GetCorr() const;
51  const RefinableObjClock& GetClockCorr()const;
52  protected:
54  virtual void CalcCorr() const=0;
58  mutable CrystVector_REAL mCorr;
61 };
62 
69 {
70  public:
71  LorentzCorr(const ScatteringData & data);
72  virtual ~LorentzCorr();
73  virtual const string & GetName() const;
74  virtual const string & GetClassName() const;
75  protected:
76  virtual void CalcCorr() const;
77 };
78 
95 {
96  public:
97  PolarizationCorr(const ScatteringData & data);
98  virtual ~PolarizationCorr();
99  virtual const string & GetName() const;
100  virtual const string & GetClassName() const;
101  protected:
102  virtual void CalcCorr() const;
103  mutable REAL mPolarAfactor;
104 };
105 
114 {
115  public:
117  virtual ~PowderSlitApertureCorr();
118  virtual const string & GetName() const;
119  virtual const string & GetClassName() const;
120  protected:
121  virtual void CalcCorr() const;
122 };
123 
124 class TextureMarchDollase;
125 
130 {
131  TexturePhaseMarchDollase(const REAL f, const REAL c,const REAL h,const REAL k, const REAL l,
134  const string& GetClassName()const;
135  const string& GetName()const;
136  void SetPar(const REAL f, const REAL c,const REAL h,const REAL k, const REAL l);
137  void XMLOutput(ostream &os,int indent=0)const;
138  void XMLInput(istream &is,const XMLCrystTag &tag);
139  REAL mFraction,mMarchCoeff,mH,mK,mL;
141  mutable REAL mNorm;
146  mutable REAL mBiasFraction,mBiasMarchCoeff,mBiasH,mBiasK,mBiasL;
147  #ifdef __WX__CRYST__
148  WXCrystObjBasic* WXCreate(wxWindow*);
149  WXCrystObjBasic* WXGet();
150  void WXDelete();
151  void WXNotifyDelete();
152  WXCrystObjBasic *mpWXCrystObj;
153  #endif
154 };
155 
162 {
163  public:
164  TextureMarchDollase(const ScatteringData & data);
165  virtual ~TextureMarchDollase();
166  virtual const string & GetName() const;
167  virtual const string & GetClassName() const;
168  void AddPhase(const REAL fraction, const REAL coeffMarch,
169  const REAL h,const REAL k, const REAL l);
170  void SetPhasePar(const unsigned int i, const REAL fraction, const REAL coeffMarch,
171  const REAL h,const REAL k, const REAL l);
172  void DeletePhase(const unsigned int i);
173  unsigned int GetNbPhase() const;
174  REAL GetFraction(const unsigned int i)const;
175  REAL GetMarchCoeff(const unsigned int i)const;
176  REAL GetPhaseH(const unsigned int i)const;
177  REAL GetPhaseK(const unsigned int i)const;
178  REAL GetPhaseL(const unsigned int i)const;
179  virtual void GlobalOptRandomMove(const REAL mutationAmplitude,
180  const RefParType *type=gpRefParTypeObjCryst);
181  virtual REAL GetBiasingCost()const;
182  virtual void XMLOutput(ostream &os,int indent=0)const;
183  virtual void XMLInput(istream &is,const XMLCrystTag &tag);
184  virtual void BeginOptimization(const bool allowApproximations=false,
185  const bool enableRestraints=false);
186  virtual void TagNewBestConfig()const;
187  protected:
188  virtual void CalcCorr() const;
189  void DeleteAllPhase();
191  RefinableObjClock mClockTexturePar;
195  mutable unsigned long mNbReflUsed;
196  #ifdef __WX__CRYST__
197  public:
198  virtual WXCrystObjBasic* WXCreate(wxWindow*);
199  friend class WXTextureMarchDollase;
200  #endif
201 };
202 
209 {
210  public:
211  TextureEllipsoid(const ScatteringData & data, const REAL EPR1=0.0, const REAL EPR2=0.0, const REAL EPR3=0.0,
212  const REAL EPR4=0.0, const REAL EPR5=0.0, const REAL EPR6=0.0);
213  virtual ~TextureEllipsoid();
214  virtual const string & GetName() const;
215  virtual const string & GetClassName() const;
216  void SetParams(const REAL EPR1, const REAL EPR2, const REAL EPR3, const REAL EPR4, const REAL EPR5, const REAL EPR6);
217  REAL mEPR[6];
218  virtual void GlobalOptRandomMove(const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst);
219  virtual void XMLOutput(ostream &os,int indent=0)const;
220  virtual void XMLInput(istream &is,const XMLCrystTag &tag);
221  virtual void BeginOptimization(const bool allowApproximations=false, const bool enableRestraints=false);
223  void InitRefParList();
227  void UpdateEllipsoidPar();
228  protected:
229  virtual void CalcCorr() const;
230  RefinableObjClock mClockTextureEllipsoidPar;
234  mutable unsigned long mNbReflUsed;
235 
236  #ifdef __WX__CRYST__
237  public:
238  virtual WXCrystObjBasic* WXCreate(wxWindow* parent);
239  #endif
240 
241 
242 };
243 
244 
253 {
254  public:
255  TOFCorr(const ScatteringData & data);
256  virtual ~TOFCorr();
257  virtual const string & GetName() const;
258  virtual const string & GetClassName() const;
259  protected:
260  virtual void CalcCorr() const;
261 };
262 
263 }//namespace
264 #endif //_OBJCRYST_SCATTERING_CORR_H_
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++.
Definition: doc-main.h:25
const RefParType * gpRefParTypeObjCryst
Top RefParType for the ObjCryst++ library.
Base class to compute all kind of corrections to intensities: Lorentz, Polar, absorption,...
const ScatteringData * mpData
The associated ScatteringData object.
virtual void CalcCorr() const =0
Do the computation of corrected intensities.
virtual const string & GetClassName() const =0
Get the name of the class.
CrystVector_REAL mCorr
The vector of correction to intensities.
const CrystVector_REAL & GetCorr() const
Get the vector of corrections for all reflections.
RefinableObjClock mClockCorrCalc
The clock marking the last time the correction was calculated.
const RefinableObjClock & GetClockCorr() const
Get the value of the clock corresponding to the last time the correction was actually computed.
ScatteringCorr(const ScatteringData &data)
Constructor, with the associated ScatteringData object.
virtual const string & GetName() const =0
Get the name of this object.
Lorentz Correction.
virtual void CalcCorr() const
Do the computation of corrected intensities.
virtual const string & GetClassName() const
Get the name of the class.
virtual const string & GetName() const
Get the name of this object.
Polarization Correction.
virtual const string & GetName() const
Get the name of this object.
virtual const string & GetClassName() const
Get the name of the class.
virtual void CalcCorr() const
Do the computation of corrected intensities.
Slit aperture correction (for powder)
virtual void CalcCorr() const
Do the computation of corrected intensities.
virtual const string & GetClassName() const
Get the name of the class.
virtual const string & GetName() const
Get the name of this object.
One texture phase for the March-Dollase model.
REAL mBiasFraction
Values of parameters towards which the optimization is biased (if biasing is used).
REAL mNorm
Norm of the (HKL) vector, to keep it constant during optimization.
TextureMarchDollase * mpTextureMarchDollase
The parent TextureMarchDollase object.
Texture correction using the March-Dollase model.
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.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
unsigned long mNbReflUsed
Number of reflexion for which the calculation is actually done.
virtual void GlobalOptRandomMove(const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
Make a random move of the current configuration.
virtual void CalcCorr() const
Do the computation of corrected intensities.
virtual const string & GetName() const
Get the name of this object.
virtual void TagNewBestConfig() const
During a global optimization, tells the object that the current config is the latest "best" config.
virtual const string & GetClassName() const
Get the name of the class.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
Texture correction using the Ellipsoidal preferred orientation function.
virtual void XMLOutput(ostream &os, int indent=0) const
Output to stream in well-formed XML.
virtual const string & GetClassName() const
Get the name of the class.
virtual void CalcCorr() const
Do the computation of corrected intensities.
virtual const string & GetName() const
Get the name of this object.
unsigned long mNbReflUsed
Number of reflexion for which the calculation is actually done.
virtual void GlobalOptRandomMove(const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
Make a random move of the current configuration.
void InitRefParList()
Prepare the refinable parameters list.
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.
void UpdateEllipsoidPar()
Update ellipsoid parameters for tetragonal, trigonal, hexagonal, cubic lattices.
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream.
Time-Of-Flight Correction.
virtual const string & GetName() const
Get the name of this object.
virtual void CalcCorr() const
Do the computation of corrected intensities.
virtual const string & GetClassName() const
Get the name of the class.
Class to compute structure factors for a set of reflections and a Crystal.
class to input or output a well-formatted xml beginning or ending tag.
class of refinable parameter types.
Definition: RefinableObj.h:80
We need to record exactly when refinable objects have been modified for the last time (to avoid re-co...
Definition: RefinableObj.h:140
Object Registry.
Definition: RefinableObj.h:645
Generic Refinable Object.
Definition: RefinableObj.h:784
Abstract base class for all objects in wxCryst.
Definition: wxCryst.h:128
Class to display the Preferred Orientation Correction using the March-Dollase parametrization.