19 #ifndef _OBJCRYST_POWDERPATTERN_H_ 
   20 #define _OBJCRYST_POWDERPATTERN_H_ 
   26 #include "ObjCryst/CrystVector/CrystVector.h" 
   27 #include "ObjCryst/ObjCryst/General.h" 
   28 #include "ObjCryst/ObjCryst/Crystal.h" 
   29 #include "ObjCryst/ObjCryst/ScatteringCorr.h" 
   30 #include "ObjCryst/ObjCryst/ReflectionProfile.h" 
   31 #include "ObjCryst/ObjCryst/CIF.h" 
   32 #include "ObjCryst/ObjCryst/Indexing.h" 
   33 #include "ObjCryst/ObjCryst/DiffractionDataSingleCrystal.h" 
   73       virtual std::map<RefinablePar*,CrystVector_REAL>& GetPowderPattern_FullDeriv(std::set<RefinablePar *> &vPar);
 
   83       virtual std::map<RefinablePar*,CrystVector_REAL>& GetPowderPatternIntegrated_FullDeriv(std::set<RefinablePar *> &vPar);
 
  105       virtual pair<const CrystVector_REAL*,const RefinableObjClock*>
 
  124       virtual void CalcPowderPattern_FullDeriv(std::set<RefinablePar *> &vPar);
 
  182       mutable list<pair<const REAL ,const string > > 
mvLabel;
 
  184       mutable std::map<RefinablePar*,CrystVector_REAL> mPowderPattern_FullDeriv;
 
  185       mutable std::map<RefinablePar*,CrystVector_REAL> mPowderPatternIntegrated_FullDeriv;
 
  208       virtual pair<const CrystVector_REAL*,const RefinableObjClock*>
 
  212       void SetInterpPoints(
const CrystVector_REAL tth, 
const CrystVector_REAL backgd);
 
  213       const std::pair<const CrystVector_REAL*,const CrystVector_REAL*> GetInterpPoints()
const;
 
  214       virtual void XMLOutput(ostream &os,
int indent=0)
const;
 
  218                                 CrystVector_uint & groupIndex,
 
  219                                 unsigned int &firstGroup) 
const;
 
  221                                      const bool enableRestraints=
false);
 
  223       virtual pair<const CrystVector_REAL*,const RefinableObjClock*>
 
  247       virtual void CalcPowderPattern_FullDeriv(std::set<RefinablePar *> &vPar);
 
  248       virtual void CalcPowderPatternIntegrated() 
const;
 
  253       void InitRefParList();
 
  255       void InitSpline()
const;
 
  317       virtual pair<const CrystVector_REAL*,const RefinableObjClock*>
 
  331                                    const REAL fwhmCagliotiW,
 
  332                                    const REAL fwhmCagliotiU=0,
 
  333                                    const REAL fwhmCagliotiV=0,
 
  344       virtual void GenHKLFullSpace();
 
  345       virtual void XMLOutput(ostream &os,
int indent=0)
const;
 
  349                                 CrystVector_uint & groupIndex,
 
  350                                 unsigned int &firstGroup) 
const;
 
  352                                      const bool enableRestraints=
false);
 
  357       virtual pair<const CrystVector_REAL*,const RefinableObjClock*>
 
  392       virtual void CalcPowderPattern_FullDeriv(std::set<RefinablePar *> &vPar);
 
  393       virtual void CalcPowderPatternIntegrated() 
const;
 
  406       virtual void CalcIhkl_FullDeriv(std::set<RefinablePar*> &vPar);
 
  408       virtual void InitOptions();
 
  413       virtual const CrystMatrix_REAL& 
GetBMatrix()
const;
 
  416       void PrepareIntegratedProfile()
const;
 
  468          mutable std::map<RefinablePar*,CrystVector_REAL> mIhkl_FullDeriv;
 
  521       void GenHKLFullSpace(
const REAL, 
const bool);
 
  585                                   unsigned long nbPoint);
 
  638          void SetWavelength(
const string &XRayTubeElementName,
const REAL alpha12ratio=0.5);
 
  648          std::map<RefinablePar*,CrystVector_REAL>& GetPowderPattern_FullDeriv(std::set<RefinablePar *> &vPar);
 
  783          REAL GetIntegratedR()
const ;
 
  789          REAL GetIntegratedRw()
const;
 
  806          void FitScaleFactorForIntegratedR()
const;
 
  809          void FitScaleFactorForIntegratedRw()
const;
 
  827                                      const REAL minRelatIobs=1e-3);
 
  837                                      const bool enableRestraints=
false);
 
  844          virtual const CrystVector_REAL& 
GetLSQCalc(
const unsigned int) 
const;
 
  845          virtual const CrystVector_REAL& 
GetLSQObs(
const unsigned int) 
const;
 
  846          virtual const CrystVector_REAL& 
GetLSQWeight(
const unsigned int) 
const;
 
  847          virtual std::map<RefinablePar*, CrystVector_REAL>& 
GetLSQ_FullDeriv(
const unsigned int,std::set<RefinablePar *> &vPar);
 
  849          virtual void XMLOutput(ostream &os,
int indent=0)
const;
 
  854                                 CrystVector_uint & groupIndex,
 
  855                                 unsigned int &firstGroup) 
const;
 
  874       REAL 
X2XCorr(
const REAL x)
const;
 
  896       REAL 
X2Pixel(
const REAL x)
const;
 
  902          REAL 
STOL2X(
const REAL stol)
const;
 
  907          REAL 
X2STOL(
const REAL x)
const;
 
  914       PeakList FindPeaks(
const float dmin=2.0,
const float maxratio=0.01,
const unsigned int maxpeak=100);
 
  932       void CalcPowderPattern_FullDeriv(std::set<RefinablePar *> &vPar);
 
  935       void CalcPowderPatternIntegrated_FullDeriv(std::set<RefinablePar *> &vPar);
 
  949       mutable std::map<RefinablePar*,CrystVector_REAL> mPowderPattern_FullDeriv;
 
  952       mutable std::map<RefinablePar*,CrystVector_REAL> mPowderPatternIntegrated_FullDeriv;
 
  977       mutable std::map<RefinablePar*,CrystVector_REAL> mPowderPatternUsed_FullDeriv;
 
 1024          REAL m2ThetaDisplacement;
 
 1027          REAL m2ThetaTransparency;
 
 1039          mutable CrystVector_REAL mScaleFactor;
 
 1042       bool mUseFastLessPreciseFunc;
 
 1046          bool mStatisticsExcludeBackground;
 
 1049          mutable CrystVector_int mScalableComponentIndex;
 
 1051          mutable CrystMatrix_REAL mFitScaleFactorM,mFitScaleFactorB,mFitScaleFactorX;
 
 1057          mutable CrystVector_long mIntegratedPatternMin,mIntegratedPatternMax;
 
 1058          mutable CrystVector_REAL mIntegratedObs;
 
 1059          mutable CrystVector_REAL mIntegratedWeight;
 
 1060          mutable CrystVector_REAL mIntegratedWeightObs;
 
 1061          mutable CrystVector_REAL mIntegratedVarianceObs;
 
 1064          mutable REAL mChi2,mIntegratedChi2;
 
 1069          mutable REAL mChi2LikeNorm,mIntegratedChi2LikeNorm;
 
 1082       mutable unsigned long mNbPointUsed;
 
 1085       mutable unsigned long mNbIntegrationUsed;
 
 1089    #ifdef __WX__CRYST__ 
 1106 CrystVector_REAL PowderProfileGauss  (
const CrystVector_REAL theta,
 
 1108                                       const REAL asymmetryPar=1.);
 
 1112 CrystVector_REAL PowderProfileLorentz(
const CrystVector_REAL theta,
 
 1114                                       const REAL asymmetryPar=1.);
 
 1118 #endif // _OBJCRYST_POWDERPATTERN_H_ 
virtual const CrystVector_REAL & GetLSQWeight(const unsigned int) const 
Get the weight values for the LSQ function. 
void SetFrozenLatticePar(const unsigned int i, REAL v)
Change one parameter in mFrozenLatticePar. This triggers a call to CalcLocalBMatrix() if the paramete...
REAL X2Pixel(const REAL x) const 
Get the pixel number on the experimental pattern, corresponding to a given (experimental) x coordinat...
void FitScaleFactorForR() const 
Fit the scale(s) factor of each component to minimize R. 
virtual void GetGeneGroup(const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const 
Get the gene group assigned to each parameter. 
CrystVector_REAL mPowderPatternUsedCalc
The calculated powder pattern. Cropped to the maximum sin(theta)/lambda for LSQ. 
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. 
ReflectionProfile * mpReflectionProfile
Profile. 
Texture correction using the March-Dollase model. 
const RefinableObjClock & GetClockNbPointUsed() const 
Clock corresponding to the last time the number of points used was changed. 
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream. 
void OptimizeBayesianBackground()
Optimize the background using a Bayesian approach. 
void SavePowderPattern(const string &filename="powderPattern.out") const 
Save powder pattern to one file, text format, 3 columns theta Iobs Icalc. 
const CrystVector_REAL & GetPowderPatternCalc() const 
Get the calculated powder pattern. 
void AddExcludedRegion(const REAL min2Theta, const REAL max2theta)
Add an Exclusion region, in 2theta, which will be ignored when computing R's XMLInput values must be...
const CrystVector_REAL & GetPowderPatternWeight() const 
Get the weight for each point of the powder pattern. 
CrystVector_REAL mBackgroundInterpPointIntensity
Values of background at interpolating points. 
void ImportPowderPatternTOF_ISIS_XYSigma(const string &fileName)
Import TOF file (ISIS type, 3 columns t, Iobs, sigma(Iobs)) 
vector< pair< unsigned long, CrystVector_REAL > > mIntegratedProfileFactor
For each reflection, store the integrated value of the normalized profile over all integration interv...
RefinableObjClock mClockScaleFactor
Last modification of the scale factor. 
CrystVector_REAL mExcludedRegionMaxX
Max coordinate for 2theta for all excluded regions. 
int mBackgroundNbPoint
Number of fitting points for background. 
RefinableObjClock mClockLorentzPolarSlitCorrPar
Last time the Lorentz-Polarization and slit parameters were changed. 
virtual pair< const CrystVector_REAL *, const RefinableObjClock * > GetPowderPatternIntegratedCalc() const =0
Get the integrated values of the powder pattern. 
CrystVector_REAL mPowderPatternCalc
The calculated powder pattern. 
void ImportPowderPatternFullprof(const string &fullprofFileName)
Import fullprof-style diffraction data. 
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. 
CrystVector_REAL mIntensityCorr
Calculated corrections for all reflections. 
void SetReflectionProfilePar(const ReflectionProfileType prof, const REAL fwhmCagliotiW, const REAL fwhmCagliotiU=0, const REAL fwhmCagliotiV=0, const REAL eta0=0.5, const REAL eta1=0.)
Set reflection profile parameters. 
void SetWeightToInvSigmaSq(const REAL minRelatSigma=1e-3)
Set w = 1/sigma^2. 
const RefinableObjClock & GetClockPowderPatternCalc() const 
Last time the powder pattern was calculated. 
virtual void Init()
Init parameters and options. 
CrystVector_REAL mExcludedRegionMinX
Min coordinate for for all excluded regions. 
const Radiation & GetRadiation() const 
Neutron or x-ray experiment ? 
long first
First point of the pattern for which the profile is calculated. 
void CalcPowderReflProfile_FullDeriv(std::set< RefinablePar * > &vPar)
const CrystVector_REAL & GetPowderPatternObsSigma() const 
Get the sigma for each point of the observed powder pattern. 
We need to record exactly when refinable objects have been modified for the last time (to avoid re-co...
RefinableObjClock mClockPowderPatternIntegratedCalc
When was the 'integrated' powder pattern last computed ? 
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. 
virtual void SetParentPowderPattern(PowderPattern &)
Set the PowderPattern object which uses this component. 
RefinableObjClock mClockPowderPatternRadiation
When were the radiation parameter (radiation type, wavelength) changed ? 
void SetRadiation(const Radiation &radiation)
Set the radiation. 
DiffractionDataSingleCrystal * mpLeBailData
Single crystal data extracted from the powder pattern. 
virtual bool HasPowderPatternCalcVariance() const 
Does this component have a variance associated with each calculated point ? i.e., do we use maximum l...
bool FreezeLatticePar() const 
Do we use local cell parameters ? (see mFrozenLatticePar) 
RefinableObjClock mClockPowderPatternXCorr
Corrections to 2Theta. 
ReflectionProfileType
Profile type for powder (could it be used fopr single crystals on 2D detectors ?) ...
CrystVector_REAL mPowderPatternIntegratedCalcVariance
The variance associated to each point of the calculated powder pattern, integrated. 
RefinableObjClock mClockPowderPatternIntegratedCalc
When was the powder pattern (integrated) last computed ? 
CrystVector_REAL mvSplinePixel
Vector of pixel values between each interval, for faster CubicSpline calculations. 
const ReflectionProfile & GetProfile() const 
Get reflection profile. 
virtual void SetMaxSinThetaOvLambda(const REAL max)
Set the maximum value for sin(theta)/lambda. 
void ExtractLeBail(unsigned int nbcycle=1)
Extract intensities using Le Bail method. 
CrystVector_REAL profile
The profile. 
vector< ReflProfile > mvReflProfile
Reflection profiles for ALL reflections during the last powder pattern generation. 
void ImportPowderPatternFullprof4(const string &fileName)
Import diffraction data from a file, with the first line has 2ThetaMin, step, 2thetaMax, and the following lines alternate 10 Iobs and 10 sigma. 
Class to display a Powder Pattern (calc,obs) in a graphic window. 
REAL mMaxSinThetaOvLambda
Displacement correction :  REAL m2ThetaDisplacement; Transparency correction :  REAL m2ThetaTranspare...
RefinableObjClock mClockProfilePar
Last time the reflection parameters were changed. 
CrystVector_REAL mPowderPatternObs
The observed powder pattern. 
Class to display a Powder Pattern Background. 
void ImportPowderPatternSietronicsCPI(const string &fileName)
Import *.cpi Sietronics diffraction data. 
const RefinableObjClock & GetClockPowderPatternRadiation() const 
When were the radiation parameter (radiation type, wavelength) changed ? 
virtual void SetMaxSinThetaOvLambda(const REAL max)
Set the maximum value for sin(theta)/lambda. 
RefinableObjClock mClockPowderPatternCalc
When was the powder pattern last computed ? 
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream. 
Texture correction using the Ellipsoidal preferred orientation function. 
Phase to compute a background contribution to a powder pattern using an interpolation. 
const RefinableObjClock & GetIntegratedProfileLimitsClock() const 
When were the integration intervals last changed ? 
unsigned long mNbPoint
Number of points in the pattern. 
REAL GetChi2_Option() const 
Return the conventionnal or integrated Chi^2, depending on the option. 
void ImportPowderPatternGSAS(const string &fileName)
Import GSAS standard powder pattern data (see GSAS manual). 
virtual void SetParentPowderPattern(PowderPattern &)=0
Set the PowderPattern object which uses this component. 
RefinableObjClock mClockIntensityCorr
Last time the Lorentz-Polar-Slit correction was computed. 
RefinableObjClock mClockPowderPatternVarianceCalc
When was the powder pattern variance last computed ? 
PolarizationCorr mCorrPolar
Polarization correction. 
CrystVector_REAL mX
Vector of x coordinates (either 2theta or time-of-flight) for the pattern. 
const RefinableObjClock & GetClockPowderPatternPar() const 
When were the pattern parameters (2theta range, step) changed ? 
Class to compute the contribution to a powder pattern from a crystalline phase. 
RefinableObjClock mClockPowderPatternIntegratedVarianceCalc
When was the 'integrated' powder pattern variance last computed ? 
void CalcPowderPatternIntegrated() const 
Calc the integrated powder pattern. 
virtual const CrystVector_REAL & GetPowderPatternCalcVariance() const =0
Get the variance associated to each point of the calculated powder pattern, for this component...
void FixParametersBeyondMaxresolution(RefinableObj &obj)
Fix parameters corresponding to points of the pattern that are not actually calculated. 
void CalcNbPointUsed() const 
Calculate the number of points of the pattern actually used, from the maximum value of sin(theta)/lam...
virtual void XMLOutput(ostream &os, int indent=0) const 
Output to stream in well-formed XML. 
void SetPowderPatternObs(const CrystVector_REAL &obs)
Set observed powder pattern from vector array. 
RefinableObjClock mClockIntegratedProfileFactor
Last time the integrated values of normalized profiles was calculated. 
bool GetExtractionMode() const 
Return true if in extraction mode, i.e. using extracted intensities instead of computed structure fac...
const PowderPatternComponent & GetPowderPatternComponent(const string &name) const 
Access to a component of the powder pattern. 
Class to compute structure factors for a set of reflections and a Crystal. 
virtual const CrystVector_REAL & GetPowderPatternCalc() const =0
Get the calculated powder pattern for this component. 
virtual void SetMaxSinThetaOvLambda(const REAL max)
Set the maximum value for sin(theta)/lambda. 
REAL GetR() const 
Unweighted R-factor. 
virtual unsigned int GetNbLSQFunction() const 
Number of LSQ functions. 
void SetProfile(ReflectionProfile *prof)
Assign a new profile. 
Generic Refinable Object. 
bool mExtractionMode
Extraction mode (Le Bail, Pawley) 
CrystVector_REAL mPowderPatternVarianceIntegrated
The complete variance associated to each point of the powder pattern, taking into account observation...
CrystMatrix_REAL mFrozenBMatrix
Local B Matrix, used if mFreezeLatticePar is true. 
virtual void CalcPowderPattern() const 
Calc the powder pattern. 
void ImportPowderPattern2ThetaObsSigma(const string &fileName, const int nbSkip=0)
Import file with 3 columns 2Theta Iobs Sigma. 
const CrystVector_long & GetIntegratedProfileMin() const 
Get the list of first pixels for the integration intervals. 
virtual void SetParentPowderPattern(PowderPattern &)
Set the PowderPattern object which uses this component. 
Class to store positions of observed reflections. 
ObjRegistry< PowderPatternComponent > gPowderPatternComponentRegistry("List of all PowderPattern Components")
Global registry for all PowderPatternComponent objects. 
REAL GetWavelength() const 
wavelength of the experiment (in Angstroems) 
virtual pair< const CrystVector_REAL *, const RefinableObjClock * > GetPowderPatternIntegratedCalcVariance() const 
Get the variance associated to each point of the calculated powder pattern, for this component (integ...
CrystVector_REAL mPowderPatternCalcVariance
The variance associated to each point of the calculated powder pattern. 
virtual pair< const CrystVector_REAL *, const RefinableObjClock * > GetPowderPatternIntegratedCalc() const 
Get the integrated values of the powder pattern. 
virtual void CalcPowderPattern() const =0
Calc the powder pattern. 
RefinableObjClock mClockIhklCalc
Last time intensities were computed. 
Class to display a Powder Pattern for a crystalline phase. 
REAL X2STOL(const REAL x) const 
Convert X (either 2theta or TOF) to sin(theta)/lambda, depending on the type of radiation. 
Abstract base class for all objects in wxCryst. 
virtual const string & GetClassName() const 
Name for this class ("RefinableObj", "Crystal",...). 
Abstract base class for reflection profiles. 
void ImportUserBackground(const string &filename)
Import background points from a file (with two columns 2theta (or tof), intensity) ...
long last
Last point of the pattern for which the profile is calculated. 
virtual void TagNewBestConfig() const 
During a global optimization, tells the object that the current config is the latest "best" config...
WX Class for PowderPattern objects. 
CrystVector_REAL mPowderPatternVariance
The complete variance associated to each point of the powder pattern, taking into account observation...
virtual const string & GetClassName() const 
Name for this class ("RefinableObj", "Crystal",...). 
PowderPattern * mpParentPowderPattern
The PowderPattern object in which this component is included. 
virtual void CalcPowderPattern() const 
Calc the powder pattern. 
virtual void CalcIhkl() const 
CrystVector_REAL mPowderPatternBackgroundCalc
The calculated powder pattern part which corresponds to 'background' (eg non-scalable components)...
void CalcPowderPattern() const 
Calc the powder pattern. 
virtual const CrystVector_long & GetBraggLimits() const 
Get the pixel positions separating the integration intervals around reflections. 
virtual void XMLOutput(ostream &os, int indent=0) const 
Output to stream in well-formed XML. 
virtual const Radiation & GetRadiation() const 
Get the radiation object for this data. 
REAL GetRw() const 
Get the weighted R-factor. 
void SetScaleFactor(const int i, REAL s)
Access to the scale factor of components (will be 1 for background components) 
const CrystVector_REAL & GetPowderPatternX() const 
Get the vector of X (2theta or time-of-flight) coordinates. 
const RefinableObjClock & GetClockPowderPatternCalcVariance() const 
Last time the variance on the pattern was actually calculated. 
const RefinableObjClock & GetClockPowderPatternCalc() const 
Last time the pattern was calculated. 
Slit aperture correction (for powder) 
void Set2ThetaTransparency(const REAL transparency)
Change transparency correction . 
virtual pair< const CrystVector_REAL *, const RefinableObjClock * > GetPowderPatternIntegratedCalcVariance() const 
Get the variance associated to each point of the calculated powder pattern, for this component (integ...
void ImportPowderPattern2ThetaObs(const string &fileName, const int nbSkip=0)
Import file with 2 columns 2Theta Iobs. 
void ImportPowderPatternMultiDetectorLLBG42(const string &fileName)
diffraction data in a multi-detector format (fullprof format #6). 
CrystVector_REAL mPowderPatternBackgroundIntegratedCalc
The calculated powder pattern part which corresponds to 'background' (eg non-scalable components)...
virtual pair< const CrystVector_REAL *, const RefinableObjClock * > GetPowderPatternIntegratedCalc() const 
Get the integrated values of the powder pattern. 
virtual void GetGeneGroup(const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const 
Get the gene group assigned to each parameter. 
void ImportPowderPatternCIF(const CIF &cif)
Import CIF powder pattern data. 
Generic class to compute components (eg the contribution of a given phase, or background) of a powder...
void SetPowderPatternX(const CrystVector_REAL &x)
Set the x coordinate of the powder pattern : either the 2theta or time-of-flight values for each reco...
virtual void SetApproximationFlag(const bool allow)
Enable or disable numerical approximations. 
LorentzCorr mCorrLorentz
Lorentz correction. 
REAL STOL2X(const REAL stol) const 
Convert sin(theta)/lambda to X (i.e. 
DiffractionData object for Single Crystal analysis. 
void AddPowderPatternComponent(PowderPatternComponent &)
Add a component (phase, backround) to this pattern. 
virtual bool HasPowderPatternCalcVariance() const 
Does this component have a variance associated with each calculated point ? i.e., do we use maximum l...
RefinableObjClock mClockSpline
Initialization of the spline. 
RefinableObjClock mClockPowderPatternCalc
When was the powder pattern last computed ? 
void PrepareIntegratedRfactor() const 
Prepare the calculation of the integrated R-factors. 
virtual const string & GetClassName() const 
Name for this class ("RefinableObj", "Crystal",...). 
CrystVector_REAL mPowderPatternWeight
The weight for each point of the pattern. 
bool mIsScalable
Scalable ? (crystal phase = scalable, background= not scalable) 
virtual void CalcPowderPatternIntegrated_FullDeriv(std::set< RefinablePar * > &vPar)
Calc the integrated powder pattern. 
virtual bool HasPowderPatternCalcVariance() const =0
Does this component have a variance associated with each calculated point ? i.e., do we use maximum l...
RefinableObjClock mClockBraggLimits
Get last time the Bragg Limits were changed. 
virtual PowderPatternDiffraction * CreateCopy() const 
So-called virtual copy constructor. 
virtual void CalcPowderPatternIntegrated_FullDeriv(std::set< RefinablePar * > &vPar)
Calc the integrated powder pattern. 
Powder pattern class, with an observed pattern and several calculated components to modelize the patt...
CrystVector_REAL mPowderPatternIntegratedCalc
The calculated powder pattern, integrated. 
void SetPowderPatternPar(const REAL min, const REAL step, unsigned long nbPoint)
the powder pattern angular range & resolution parameter. 
REAL mModelVariance
Constant error (sigma) on the calculated pattern, due to an incomplete model. 
void SetRadiationType(const RadiationType radiation)
Set the radiation type. 
virtual void CalcPowderPatternIntegrated_FullDeriv(std::set< RefinablePar * > &vPar)
Calc the integrated powder pattern. 
virtual void GetGeneGroup(const RefinableObj &obj, CrystVector_uint &groupIndex, unsigned int &firstGroup) const 
Get the gene group assigned to each parameter. 
virtual REAL GetLogLikelihood() const 
Get -log(likelihood) of the current configuration for the object. 
RefinableObjClock mClockProfileCalc
Last time the reflection profiles were computed. 
virtual const CrystVector_long & GetBraggLimits() const =0
Get the pixel positions separating the integration intervals around reflections. 
const RefinableObjClock & GetClockPowderPatternXCorr() const 
When were the parameters for 2theta/TOF correction (zero, transparency, displacement) last changed ...
virtual const string & GetClassName() const 
Name for this class ("RefinableObj", "Crystal",...). 
virtual void SetCrystal(Crystal &crystal)
Set the crystal for this experiment. 
Main CIF class - parses the stream and separates data blocks, comments, items, loops. 
list< pair< const REAL,const string > > mvLabel
The labels associated to different points of the pattern. 
CrystVector_REAL mBackgroundInterpPointX
Vector of 2theta values for the fitting points of the background. 
REAL STOL2Pixel(const REAL stol) const 
Convert sin(theta)/lambda to pixel, depending on the type of radiation. 
const CrystVector_REAL & GetPowderPatternObs() const 
Get the observed powder pattern. 
void CalcFrozenBMatrix() const 
Calculate the local BMatrix, used if mFreezeLatticePar is true. 
virtual long GetNbReflBelowMaxSinThetaOvLambda() const 
Recalc, and get the number of reflections which should be actually used, due to the maximuml sin(thet...
Time-Of-Flight Correction. 
CubicSpline mvSpline
Spline used for interpolation. 
REAL GetIntegratedChi2() const 
Return integrated Chi^2. 
REAL X2XCorr(const REAL x) const 
Get the experimental x (2theta, tof) from the theoretical value, taking into account all corrections ...
virtual const CrystVector_REAL & GetPowderPatternCalcVariance() const 
Get the variance associated to each point of the calculated powder pattern, for this component...
const RefinableObjClock & GetClockBraggLimits() const 
Get last time the Bragg Limits were changed. 
const CrystVector_REAL & GetChi2Cumul() const 
Get the powder pattern cumulative Chi^2. 
RefObjOpt mInterpolationModel
Type of interpolation performed: linear or cubic spline. 
RefinableObjClock mClockBackgroundPoint
Modification of the interpolated points. 
CrystVector_REAL mPowderPatternIntegratedCalc
The calculated powder pattern, integrated. 
CrystVector_REAL mIhklCalc
Computed intensities for all reflections. 
const CrystVector_REAL & GetPowderPatternVariance() const 
Get the variance (obs+model) for each point of the powder pattern. 
void CalcIntensityCorr() const 
REAL GetFrozenLatticePar(const unsigned int i) const 
Access to one parameter in mFrozenLatticePar. 
virtual const CrystVector_REAL & GetPowderPatternCalcVariance() const 
Get the variance associated to each point of the calculated powder pattern, for this component...
Radiation mRadiation
The Radiation corresponding to this experiment. 
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. 
CrystVector_REAL mPowderPatternCalc
The calculated component of a powder pattern. 
void SetWeightPolynomial(const REAL a, const REAL b, const REAL c, const REAL minRelatIobs=1e-3)
Set w = 1/(a+ Iobs + b*Iobs^2+c*Iobs^3) 
bool IsScalable() const 
Is this component scalable ? 
CrystVector_REAL mPowderPatternObsSigma
The sigma of the observed pattern. 
const CrystVector_long & GetIntegratedProfileMax() const 
Get the list of last pixels for the integration intervals. 
void PrintObsCalcData(ostream &os=cout) const 
Print to thee screen/console the observed and calculated pattern (long, mostly useful for debugging) ...
Cubic spline interpolation. 
REAL GetPowderPatternXStep() const 
Get the average step in 2theta. 
void ImportPowderPatternXdd(const string &fileName)
Import *.xdd diffraction data (Topas,...). 
void SetExtractionMode(const bool extract=true, const bool init=false)
Prepare intensity extraction (Le Bail or Pawley) 
void ImportPowderPatternILL_D1A5(const string &filename)
Import powder pattern, format from ILL D1A/D2B (format without counter info) 
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++. 
CrystVector_REAL mPowderPatternUsedObs
The calculated powder pattern. Cropped to the maximum sin(theta)/lambda for LSQ. 
const PowderPattern & GetParentPowderPattern() const 
Get the PowderPattern object which uses this component. 
RefinableObjClock mClockPowderPatternPar
When were the pattern parameters (2theta or time-of-flight range) changed ? 
virtual void EndOptimization()
This should be called by any optimization class at the end of an optimization. 
virtual void GlobalOptRandomMove(const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
Make a random move of the current configuration. 
void CalcPowderReflProfile() const 
PeakList FindPeaks(const float dmin=2.0, const float maxratio=0.01, const unsigned int maxpeak=100)
Find peaks in the pattern. 
virtual void InitOptions()
Initialize options. 
const CrystVector_REAL & GetScaleFactor() const 
Access the scale factors (see PowderPattern::mScaleFactor) 
void Set2ThetaDisplacement(const REAL displacement)
Change displacement correction . 
void SetWavelength(const REAL lambda)
Set the wavelength of the experiment (in Angstroems). 
bool mFreezeLatticePar
If true, use local cell parameters from mFrozenLatticePar rather than the Crystal. 
unsigned long GetNbPoint() const 
Number of points ? 
virtual void XMLOutput(ostream &os, int indent=0) const 
Output to stream in well-formed XML. 
TextureMarchDollase mCorrTextureMarchDollase
Preferred orientation (texture) correction following the March-Dollase model. 
virtual const CrystVector_REAL & GetLSQObs(const unsigned int) const 
Get the observed values for the LSQ function. 
Profile of a single reflection. 
void SetXZero(const REAL newZero)
Change Zero in x (2theta,tof) 
virtual pair< const CrystVector_REAL *, const RefinableObjClock * > GetPowderPatternIntegratedCalcVariance() const =0
Get the variance associated to each point of the calculated powder pattern, for this component (integ...
virtual const CrystVector_REAL & GetPowderPatternCalc() const 
Get the calculated powder pattern for this component. 
REAL X2PixelCorr(const REAL x) const 
Get the pixel number on the experimental pattern, from the theoretical (uncorrected) x coordinate...
TOFCorr mCorrTOF
Time-Of-Flight intensity correction. 
RadiationType
Type of radiation used. 
TextureEllipsoid mCorrTextureEllipsoid
Preferred orientation (texture) correction following the Ellipsoidal function. 
void SetSigmaToSqrtIobs()
Set sigma=sqrt(Iobs) 
virtual const CrystVector_long & GetBraggLimits() const 
Get the pixel positions separating the integration intervals around reflections. 
CrystVector_REAL mChi2Cumul
The cumulative Chi^2 (integrated or not, depending on the option) 
RadiationType GetRadiationType() const 
Neutron or x-ray experiment ? 
virtual const CrystMatrix_REAL & GetBMatrix() const 
This can use either locally stored lattice parameters from mLocalLatticePar, or the Crystal's...
Crystal class: Unit cell, spacegroup, scatterers. 
REAL GetPowderPatternXMax() const 
Get the maximum 2theta. 
void ImportPowderPatternPSI_DMC(const string &filename)
Import powder pattern, format DMC from PSI. 
virtual void SetMaxSinThetaOvLambda(const REAL max)=0
Set the maximum value for sin(theta)/lambda. 
class to input or output a well-formatted xml beginning or ending tag. 
CrystVector_REAL mIhklCalcVariance
Variance on computed intensities for all reflections. 
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream. 
const list< pair< const REAL,const string > > & GetPatternLabelList() const 
Get a list of labels for the pattern (usually reflection indexes). 
std::map< RefinablePar *, vector< CrystVector_REAL > > mvReflProfile_FullDeriv
Derivatives of reflection profiles versus a list of parameters. 
REAL GetPowderPatternXMin() const 
Get the Minimum 2theta. 
REAL GetChi2() const 
Return conventionnal Chi^2. 
CrystVector_REAL mPowderPatternUsedWeight
The weight for each point of the pattern. Cropped to the maximum sin(theta)/lambda for LSQ...
PowderSlitApertureCorr mCorrSlitAperture
Slit aperture correction. 
CrystVector_long mPointOrder
Subscript of the points, sorted the correct order, taking into account the type of radiation (monochr...
class of refinable parameter types. 
unsigned long GetNbPointUsed() const 
Number of points actually calculated (below the chosen max(sin(theta)/lambda)) ? 
REAL GetMaxSinThetaOvLambda() const 
Get the maximum value for sin(theta)/lambda. 
void SetWeightToUnit()
Set w = 1. 
Class to define the radiation (type, monochromaticity, wavelength(s)) of an experiment. 
virtual const CrystVector_REAL & GetLSQCalc(const unsigned int) const 
Get the current calculated value for the LSQ function. 
CrystVector_long mIntegratedReflLimits
Interval limits around each reflection, for integrated R-factors. 
void FitScaleFactorForRw() const 
Fit the scale(s) factor of each component to minimize Rw. 
void ExportFullprof(const std::string &prefix) const 
Export powder pattern & crystal structure in Fullprof format. 
const RefParType * gpRefParTypeObjCryst
Top RefParType for the ObjCryst++ library. 
CrystVector_REAL mFrozenLatticePar
a,b and c in Angstroems, angles (stored) in radians This is used to override lattice parameter from t...
bool mIsXAscending
Is the mX vector sorted in ascending order ? (true for 2theta, false for TOF) 
REAL mMaxSinThetaOvLambda
Maximum sin(theta)/lambda for all calculations (10 by default). 
void SetEnergy(const REAL energy)
Set the energy of the experiment [in keV, lambda(A)=12398/E(keV)]. 
REAL mXZero
Zero correction :  Thus mPowderPattern2ThetaMin=(mPowderPattern2ThetaMin-m2ThetaZero) ...
virtual const CrystVector_REAL & GetPowderPatternCalc() const 
Get the calculated powder pattern for this component. 
unsigned int GetNbPowderPatternComponent() const 
Number of components.