00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _OBJCRYST_DIFFDATA_SINGLECRYSTAL_H_
00014 #define _OBJCRYST_DIFFDATA_SINGLECRYSTAL_H_
00015
00016 #include "CrystVector/CrystVector.h"
00017
00018 #include "ObjCryst/General.h"
00019
00020 #include "ObjCryst/ScatteringPower.h"
00021 #include "ObjCryst/Crystal.h"
00022 #include "ObjCryst/ScatteringData.h"
00023
00024
00025
00026
00027 #include <string>
00028
00029
00030
00031
00032
00033
00034 namespace ObjCryst
00035 {
00036
00037
00048
00049
00050 class DiffractionDataSingleCrystal:public ScatteringData
00051 {
00052 public:
00053 DiffractionDataSingleCrystal();
00054 ~DiffractionDataSingleCrystal();
00055 virtual DiffractionDataSingleCrystal* CreateCopy()const;
00056 virtual const string GetClassName() const;
00057
00064 const CrystVector_double& GetIcalc() const;
00065
00067 const CrystVector_double& GetIobs() const;
00069 void SetIobs(const CrystVector_double&);
00070
00072 const CrystVector_double& GetSigma() const;
00074 void SetSigma(const CrystVector_double&);
00075
00077 void SetIobsToIcalc();
00078
00080 const CrystVector_double& GetWeight() const;
00082 void SetWeight(const CrystVector_double&);
00083
00092 void SetHklIobs( CrystVector_long const &h,
00093 CrystVector_long const &k,
00094 CrystVector_long const &l,
00095 CrystVector_double const &iObs,
00096 CrystVector_double const &sigma);
00097
00106 void ImportHklIobs(const string &fileName,const long nbRefl,const int skipLines=0);
00115 void ImportHklIobsSigma(const string &fileName,const long nbRefl,const int skipLines=0);
00121 void ImportHklIobsSigmaJanaM91(const string &fileName);
00122
00128 virtual double GetRw()const;
00134 virtual double GetR()const;
00135
00141
00142 virtual double GetChi2()const;
00143
00144
00145
00146
00147
00148
00149
00150
00155 virtual void FitScaleFactorForRw();
00160 virtual void FitScaleFactorForR();
00163 virtual double GetBestRFactor();
00164
00168 virtual void SetSigmaToSqrtIobs();
00174 virtual void SetWeightToInvSigma2(const double minRelatSigma=1e-4);
00175
00177 double GetScaleFactor()const;
00178
00179
00180
00184 virtual void PrintObsData()const;
00189 virtual void PrintObsCalcData()const;
00190
00191 virtual void SetUseOnlyLowAngleData(const bool useOnlyLowAngle,const double angle=0.);
00192
00195 void SaveHKLIobsIcalc(const string &filename="hklIobsIcalc.out");
00196
00197 unsigned int GetNbCostFunction()const;
00198 const string& GetCostFunctionName(const unsigned int)const;
00199 const string& GetCostFunctionDescription(const unsigned int)const;
00200 virtual double GetCostFunctionValue(const unsigned int);
00201 virtual void XMLOutput(ostream &os,int indent=0)const;
00202 virtual void XMLInput(istream &is,const XMLCrystTag &tag);
00203
00204 protected:
00205 private:
00206 virtual void InitRefParList();
00208 void CalcIcalc() const;
00210 bool mHasObservedData;
00211
00217 CrystVector_double mObsIntensity ;
00219 CrystVector_double mObsSigma ;
00221 CrystVector_double mWeight ;
00223 mutable CrystVector_double mCalcIntensity ;
00226 double mScaleFactor;
00227 };
00229 extern ObjRegistry<DiffractionDataSingleCrystal> gDiffractionDataSingleCrystalRegistry;
00230
00231 }
00232
00233 #endif