29 #include "ObjCryst/ObjCryst/DiffractionDataSingleCrystal.h" 
   30 #include "ObjCryst/ObjCryst/CIF.h" 
   31 #include "ObjCryst/Quirks/VFNDebug.h" 
   32 #include "ObjCryst/Quirks/VFNStreamFormat.h" 
   35 #include "ObjCryst/wxCryst/wxDiffractionSingleCrystal.h" 
   44 #ifdef _MSC_VER // MS VC++ predefined macros.... 
   54 ObjRegistry<DiffractionDataSingleCrystal>
 
   58 mHasObservedData(false),mScaleFactor(1.)
 
   60    VFN_DEBUG_MESSAGE(
"DiffractionDataSingleCrystal::DiffractionDataSingleCrystal()",5)
 
   61    this->InitRefParList();
 
   69 mHasObservedData(false),mScaleFactor(1.)
 
   71    VFN_DEBUG_MESSAGE(
"DiffractionDataSingleCrystal::DiffractionDataSingleCrystal()",5)
 
   72    this->InitRefParList();
 
   83 mHasObservedData(old.mHasObservedData),mRadiation(old.mRadiation)
 
  103 DiffractionDataSingleCrystal::~DiffractionDataSingleCrystal()
 
  105    VFN_DEBUG_MESSAGE(
"DiffractionDataSingleCrystal::~DiffractionDataSingleCrystal()",5)
 
  112    VFN_DEBUG_MESSAGE(
"DiffractionDataSingleCrystal::CreateCopy()",5)
 
  118    const static string className=
"DiffractionDataSingleCrystal";
 
  123                                               const CrystVector_long &k,
 
  124                                               const CrystVector_long &l,
 
  125                                               const CrystVector_REAL &iObs,
 
  126                                               const CrystVector_REAL &sigma)
 
  128    VFN_DEBUG_ENTRY(
"DiffractionDataSingleCrystal::SetHklIobs(h,k,l,i,s)",5)
 
  163    VFN_DEBUG_EXIT(
"DiffractionDataSingleCrystal::SetHklIobs(h,k,l,i,s)",5)
 
  174    this->CalcIcalc_FullDeriv(vPar);
 
  175    return mCalcIntensity_FullDeriv;
 
  209    VFN_DEBUG_MESSAGE(
"DiffractionDataSingleCrystal::SetWeight(w)",5)
 
  216    VFN_DEBUG_MESSAGE(
"DiffractionDataSingleCrystal::SetIobsToIcalc()",5)
 
  246       cout << 
"inputing reflections from file : "+fileName<<endl;
 
  247       ifstream fin (fileName.c_str());
 
  251 Error opening file for input:"+fileName);
 
  253       cout << 
"Number of reflections to import : " << nbRefl << endl ;
 
  254       for(
long i=0;i<nbRefl;i++)
 
  264       cout << 
"Finished reading data>"<< endl;
 
  287       sprintf(buf,
"Imported HKLIobs, with %d reflections",(
int)mNbRefl);
 
  288       (*fpObjCrystInformUser)((string)buf);
 
  291    cout << 
"Finished storing data..."<< endl ;
 
  308       cout << 
"inputing reflections from file : "+fileName<<endl;
 
  309       ifstream fin (fileName.c_str());
 
  313 Error opening file for input:"+fileName);
 
  317          char tmpComment[200];
 
  318          for(
int i=0;i<skipLines;i++) fin.getline(tmpComment,150);
 
  320       cout << 
"Number of reflections to import : " << nbRefl << endl ;
 
  321       for(
long i=0;i<nbRefl;i++)
 
  331       cout << 
"Finished reading data>"<< endl;
 
  351       sprintf(buf,
"Imported HKLIobsSigma, with %d reflections",(
int)
mNbRefl);
 
  352       (*fpObjCrystInformUser)((string)buf);
 
  355    cout << 
"Finished storing data..."<< endl ;
 
  361    VFN_DEBUG_ENTRY(
"DiffractionDataSingleCrystal::ImportShelxHKLF4():"<<fileName,10);
 
  370    long h=1,k=1,l=1,i=0;
 
  374       VFN_DEBUG_MESSAGE(
"inputing reflections from file (HKLF4): "<<fileName,10);
 
  375       ifstream fin (fileName.c_str());
 
  378          throw ObjCrystException(
"DiffractionDataSingleCrystal::ImportShelxHKLF4() : Error opening file for input:"+fileName);
 
  382          fin.getline(buf,100);
 
  383          h=(int)   atoi(
string(buf).substr(0,4).c_str());
 
  384          k=(int)   atoi(
string(buf).substr(4,4).c_str());
 
  385          l=(int)   atoi(
string(buf).substr(8,4).c_str());
 
  388          if((abs(h)+abs(k)+abs(l))==0) 
break;
 
  405       VFN_DEBUG_MESSAGE(
"Finished reading from file (HKLF4) ",10);
 
  432       sprintf(buf,
"Imported Shelx HKLF 4 file, with %d reflections",(
int)
mNbRefl);
 
  433       (*fpObjCrystInformUser)((string)buf);
 
  435    VFN_DEBUG_EXIT(
"DiffractionDataSingleCrystal::ImportShelxHKLF4() read "<<
mNbRefl<<
" reflections",10);
 
  440    VFN_DEBUG_EXIT(
"DiffractionDataSingleCrystal::ImportCIF(): "<<fileName,10);
 
  441    ifstream fin (fileName.c_str());
 
  444       throw ObjCrystException(
"DiffractionDataSingleCrystal::ImportCIF(): Error opening file for input:"+fileName);
 
  447    for(map<string,CIFData>::iterator pos=cif.
mvData.begin();pos!=cif.
mvData.end();++pos)
 
  449       if(pos->second.mH.numElements()>0)
 
  451          this->
SetHklIobs(pos->second.mH,pos->second.mK,pos->second.mL,pos->second.mIobs,pos->second.mSigma);
 
  455    VFN_DEBUG_EXIT(
"DiffractionDataSingleCrystal::ImportCIF() read "<<
mNbRefl<<
" reflections",10);
 
  470       cout << 
"inputing reflections from Jana98 file : "+fileName<<endl;
 
  471       ifstream fin (fileName.c_str());
 
  474          throw ObjCrystException(
"DiffractionDataSingleCrystal::ImportHklIobsSigmaJanaM91() : \ 
  475 Error opening file for input:"+fileName);
 
  487             cout << 
mNbRefl << 
" reflections imported..." << endl;
 
  508       cout << 
mNbRefl << 
" reflections imported." << endl;
 
  529    cout << 
"Finished storing data..."<< endl ;
 
  534       sprintf(buf,
"Imported HKLIobsSigma from Jana, with %d reflections",(
int)
mNbRefl);
 
  535       (*fpObjCrystInformUser)((string)buf);
 
  556       cout << 
"inputing reflections from file : "+fileName<<endl;
 
  557       ifstream fin (fileName.c_str());
 
  561 Error opening file for input:"+fileName);
 
  564       REAL h,k,l,iobs,sigma;
 
  568          istringstream linestream(buffer);
 
  569          int nn = (linestream >> h >> k >> l) ? 3 : 0;
 
  570          nn += bool(linestream >> iobs);
 
  571          nn += bool(linestream >> sigma);
 
  584                sigma=sqrt(fabs(iobs)+1e-6);
 
  607             mK.resizeAndPreserve(
mNbRefl+500);
 
  608             mL.resizeAndPreserve(
mNbRefl+500);
 
  646       sprintf(buf,
"Imported HKLIobs, with %d reflections",(
int)mNbRefl);
 
  647       (*fpObjCrystInformUser)((string)buf);
 
  656    TAU_PROFILE(
"DiffractionData::Rw()",
" REAL()",TAU_DEFAULT);
 
  657    VFN_DEBUG_MESSAGE(
"DiffractionData::Rw()",3);
 
  683    for(
long i=nb;i>0;i--)
 
  685       tmp1 += *p3 * ( *p1 - *p2) * ( *p1 - *p2);
 
  686       tmp2 += *p3 * *p2 * *p2;
 
  689    tmp1=sqrt(tmp1/tmp2);
 
  690    VFN_DEBUG_MESSAGE(
"DiffractionData::Rw()="<<tmp1,3);
 
  696    TAU_PROFILE(
"DiffractionData::R()",
" REAL()",TAU_DEFAULT);
 
  697    VFN_DEBUG_MESSAGE(
"DiffractionData::R()",3);
 
  721    for(
long i=nb;i>0;i--)
 
  723       tmp1 += ( *p1 - *p2) * ( *p1 - *p2);
 
  727    tmp1=sqrt(tmp1/tmp2);
 
  729    VFN_DEBUG_MESSAGE(
"DiffractionData::R()="<<tmp1,3);
 
  746    TAU_PROFILE(
"DiffractionData::Chi2()",
" REAL()",TAU_DEFAULT);
 
  747    VFN_DEBUG_ENTRY(
"DiffractionData::Chi2()",3);
 
  769    for(
long i=nb;i>0;i--)
 
  771       mChi2 += *p3++ * ( *p1 - *p2) * ( *p1 - *p2);
 
  806    VFN_DEBUG_EXIT(
"DiffractionData::Chi2()="<<
mChi2,3);
 
  812    TAU_PROFILE(
"DiffractionData::FitScaleFactorForRw()",
"void ()",TAU_DEFAULT);
 
  813    VFN_DEBUG_MESSAGE(
"DiffractionData::FitScaleFactorForRw()",3);
 
  841    for(
long i=nb;i>0;i--)
 
  843       tmp1 += *p3 * (*p1) * (*p2++);
 
  844       tmp2 += *p3++ * (*p1) * (*p1);
 
  857    TAU_PROFILE(
"DiffractionData::FitScaleFactorForR()",
"void ()",TAU_DEFAULT);
 
  858    VFN_DEBUG_MESSAGE(
"DiffractionData::FitScaleFactorForR()",3);
 
  883    for(
long i=nb;i>0;i--)
 
  885       tmp1 += (*p1) * (*p2++);
 
  886       tmp2 += (*p1) * (*p1);
 
  899    TAU_PROFILE(
"DiffractionData::GetBestRFactor()",
"void ()",TAU_DEFAULT);
 
  900    VFN_DEBUG_MESSAGE(
"DiffractionData::GetBestRFactor()",3);
 
  915    const REAL min=MaxAbs(
mObsSigma)*minRelatSigma;
 
  916    for(
long i=0;i<
mObsSigma.numElements();i++)
 
  932    cout << 
"DiffractionData : " << 
mName <<endl;
 
  933    cout << 
"Number of observed reflections : " << 
mNbRefl << endl;
 
  934    cout << 
"       H        K        L     Iobs        Sigma       sin(theta)/lambda)" <<endl;
 
  935    cout << 
mH.numElements()<<endl;
 
  936    cout << mK.numElements()<<endl;
 
  937    cout << mL.numElements()<<endl;
 
  941    cout << FormatVertVectorHKLFloats<REAL>
 
  948    CrystVector_REAL tmpTheta=
mTheta;
 
  960    cout << 
"DiffractionData : " << 
mName <<endl;
 
  962    cout << 
"Number of observed reflections : " << 
mNbRefl << endl;
 
  964    cout << 
"       H        K        L     Iobs        Sigma       Icalc  ";
 
  965    cout << 
"      multiplicity     Theta      SiThSL       Re(F)     Im(F)    Weight" <<endl;
 
  966    cout << FormatVertVectorHKLFloats<REAL>(
mH,mK,mL,
 
  972 void DiffractionDataSingleCrystal::SetUseOnlyLowAngleData(
 
  973                      const bool useOnlyLowAngle,
const REAL angle)
 
  975    throw ObjCrystException(
"DiffractionDataSingleCrystal::SetUseOnlyLowAngleData() :\ 
  976  not yet implemented for DiffractionDataSingleCrystal.");
 
  981    VFN_DEBUG_MESSAGE(
"DiffractionDataSingleCrystal::SaveHKLIobsIcalc",5)
 
  983    ofstream out(filename.c_str());
 
  984    CrystVector_REAL theta;
 
  990       out << 
"#    H        K        L      Icalc    theta  sin(theta)/lambda" 
  991           <<
"  Re(F)   Im(F)" << endl;
 
  997       out << 
"#    H        K        L      Iobs   Icalc    theta" 
  998           <<
" sin(theta)/lambda  Re(F)   Im(F)" << endl;
 
 1003    VFN_DEBUG_MESSAGE(
"DiffractionDataSingleCrystal::SaveHKLIobsIcalc:End",3)
 
 1018 void DiffractionDataSingleCrystal::InitRefParList()
 
 1020    VFN_DEBUG_MESSAGE(
"DiffractionDataSingleCrystal::InitRefParList()",5)
 
 1023                      false,true,true,false,1.);
 
 1026    tmp.SetDerivStep(1e-4);
 
 1030 const CrystVector_REAL&
 
 1034 const CrystVector_REAL&
 
 1038 const CrystVector_REAL&
 
 1046    std::map<RefinablePar*, CrystVector_REAL> fullderiv_old;
 
 1047    std::vector<const CrystVector_REAL*> v;
 
 1049    for(std::map<RefinablePar*, CrystVector_REAL>::reverse_iterator pos=mCalcIntensity_FullDeriv.rbegin();pos!=mCalcIntensity_FullDeriv.rend();++pos)
 
 1051       v.push_back(&(pos->second));
 
 1052       fullderiv_old[pos->first]=this->
GetLSQDeriv(0,*(pos->first));
 
 1053       v.push_back(&(fullderiv_old[pos->first]));
 
 1054       cout<<pos->first->GetName()<<
":"<<pos->second.size()<<
","<<mFhklCalcSq_FullDeriv[pos->first].size()<<endl;
 
 1057    cout<<FormatVertVector<REAL>(v,10)<<endl;
 
 1067    VFN_DEBUG_MESSAGE(
"DiffractionDataSingleCrystal::SetRadiationType():End",5)
 
 1073    VFN_DEBUG_MESSAGE(
"DiffractionDataSingleCrystal::SetWavelength() to "<<lambda,5)
 
 1078                                    const REAL alpha2Alpha2ratio)
 
 1080    VFN_DEBUG_MESSAGE(
"DiffractionDataSingleCrystal::SetWavelength() to "<<XRayTubeElementName,5)
 
 1091    TAU_PROFILE(
"DiffractionData::CalcIcalc()",
"void ()",TAU_DEFAULT);
 
 1092    VFN_DEBUG_MESSAGE(
"DiffractionData::CalcIcalc():"<<this->
GetName(),3)
 
 1119 void DiffractionDataSingleCrystal::CalcIcalc_FullDeriv(std::set<RefinablePar *> &vPar)
 
 1121    TAU_PROFILE(
"DiffractionDataSingleCrystal::CalcIcalc_FullDeriv()",
"void ()",TAU_DEFAULT);
 
 1122    this->GetFhklCalcSq_FullDeriv(vPar);
 
 1124    mCalcIntensity_FullDeriv.clear();
 
 1125    mCalcIntensity_FullDeriv=mFhklCalcSq_FullDeriv;
 
 1127    for(std::map<RefinablePar*, CrystVector_REAL>::iterator pos=mCalcIntensity_FullDeriv.begin(); pos!=mCalcIntensity_FullDeriv.end();pos++)
 
 1149       mGroupIcalc_FullDeriv.clear();
 
 1150       for(std::map<RefinablePar*, CrystVector_REAL>::iterator pos=mCalcIntensity_FullDeriv.begin(); pos!=mCalcIntensity_FullDeriv.end();pos++)
 
 1152          mGroupIcalc_FullDeriv[pos->first].resize(
mNbGroup);
 
 1153          mGroupIcalc_FullDeriv[pos->first]=0;
 
 1160                mGroupIcalc_FullDeriv[pos->first](i)+=mCalcIntensity_FullDeriv[pos->first](j);
 
 1170    TAU_PROFILE(
"DiffractionDataSingleCrystal::SortReflectionBySinThetaOverLambda()",
"void ()",TAU_DEFAULT);
 
 1171    VFN_DEBUG_ENTRY(
"DiffractionDataSingleCrystal::SortReflectionBySinThetaOverLambda()",5)
 
 1177       CrystVector_REAL tmpObs,tmpSigma,tmpWeight;
 
 1185          mWeight(i)=tmpWeight(index(i));
 
 1194          CrystVector_long tmp;
 
 1208             CrystVector_REAL oldGroupIobs, oldGroupWeight,oldGroupSigma;
 
 1237             CrystVector_long oldH,oldK,oldL,oldMult;
 
 1247                const long subs=index(i);
 
 1283    VFN_DEBUG_EXIT(
"DiffractionDataSingleCrystal::SortReflectionBySinThetaOverLambda()",5)
 
 1289    static string GroupOption;
 
 1290    static string GroupOptionChoices[3];
 
 1291    static bool needInitNames=
true;
 
 1292    if(
true==needInitNames)
 
 1294       GroupOption=
"Group Reflections";
 
 1295       GroupOptionChoices[0]=
"No";
 
 1296       GroupOptionChoices[1]=
"Sum equally-spaced reflections";
 
 1297       GroupOptionChoices[2]=
"Sum according to user data";
 
 1298       needInitNames=
false;
 
 1308    VFN_DEBUG_ENTRY(
"DiffractionDataSingleCrystal::PrepareTwinningCalc()",5)
 
 1312       const REAL dSiThOvLa=.0001;
 
 1350    VFN_DEBUG_EXIT(
"DiffractionDataSingleCrystal::PrepareTwinningCalc()",5)
 
 1353 #ifdef __WX__CRYST__ 
 1354 WXCrystObjBasic* DiffractionDataSingleCrystal::WXCreate(wxWindow* parent)
 
 1358    return mpWXCrystObj;
 
virtual long GetNbReflBelowMaxSinThetaOvLambda() const 
Recalc, and get the number of reflections which should be actually used, due to the maximuml sin(thet...
RefinableObjClock mClockHKL
Clock for the list of hkl. 
void AddSubRefObj(RefinableObj &)
void AddPar(const RefinablePar &newRefPar)
Add a refinable parameter. 
virtual const string & GetClassName() const 
Name for this class ("RefinableObj", "Crystal",...). 
virtual REAL GetLogLikelihood() const 
Get -log(likelihood) of the current configuration for the object. 
const CrystVector_REAL & GetIcalc() const 
returns the calculated diffracted intensity. 
void ImportHklIobsSigmaJanaM91(const string &fileName)
Import h,k,l,I,Sigma from a Jana98 '*.m91' file. 
virtual void PrepareHKLarrays()
float string2floatC(const string &s)
Function to convert a substring to a floating point value, imposing a C locale (using '...
const CrystVector_REAL & GetIobs() const 
Return the array of observed intensities for all peaks. 
RefObjOpt mGroupOption
Option for the type of grouping (0:no, 1:by theta values (twinning), 2:user-supplied groups) ...
const CrystVector_REAL & GetWeight() const 
Return the weights (for each reflection) used for computing Rw. 
virtual void CalcSinThetaLambda() const 
virtual void GlobalOptRandomMove(const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
Make a random move of the current configuration. 
virtual void PrintObsData() const 
Print H, K, L Iobs sigma for all reflections. 
REAL GetScaleFactor() const 
Scale factor (applied to Icalc to match Iobs) 
virtual const Radiation & GetRadiation() const 
Get the radiation object for this data. 
virtual void SetSigmaToSqrtIobs()
Set sigma for all observed intensities to sqrt(obs) 
virtual void FitScaleFactorForRw() const 
Compute the best scale factor minimising Rw. 
void ImportHklIobs(const string &fileName, const long nbRefl, const int skipLines=0)
Import h,k,l,I from a file. 
void SetIobs(const CrystVector_REAL &)
Return the array of observed intensities for all peaks. 
virtual CrystVector_long SortReflectionBySinThetaOverLambda(const REAL maxTheta=-1.)
void SetWeight(const CrystVector_REAL &)
Change the weights (for each reflection) used for computing Rw. 
CrystVector_REAL mGroupIcalc
The calculated intensities summed on all reflections that are grouped. 
void Click()
Record an event for this clock (generally, the 'time' an object has been modified, or some computation has been made) 
void AddChild(const RefinableObjClock &)
Add a 'child' clock. 
void CalcIcalc() const 
Calc intensities. 
RefinableObjClock mClockScaleFactor
Last modification of the scale factor. 
CrystVector_long mGroupIndex
The index of reflections which need to be summed. 
long mNbRefl
Number of H,K,L reflections. 
virtual void SetCrystal(Crystal &crystal)
Set the crystal for this experiment. 
virtual const CrystVector_REAL & GetLSQObs(const unsigned int) const 
Get the observed values for the LSQ function. 
virtual const CrystVector_REAL & GetLSQCalc(const unsigned int) const 
Get the current calculated value for the LSQ function. 
virtual unsigned int GetNbLSQFunction() const 
Number of LSQ functions. 
long mNbGroup
Number of groups. 
Class to compute structure factors for a set of reflections and a Crystal. 
ObjRegistry< RefinableObj > gTopRefinableObjRegistry("Global Top RefinableObj registry")
This is a special registry for 'top' object for an optimization. 
RefinableObjClock mClockMaster
Master clock, which is changed whenever the object has been altered. 
const RefParType * gpRefParTypeScattDataScale
Type for scattering data scale factors. 
CrystVector_int mMultiplicity
Multiplicity for each reflections (mostly for powder diffraction) 
virtual CrystVector_long SortReflectionBySinThetaOverLambda(const REAL maxSTOL=-1.)
Abstract base class for all objects in wxCryst. 
CrystVector_REAL mObsSigma
Sigma for observed intensities (either individual reflections or spectrum) 
ObjRegistry< DiffractionDataSingleCrystal > gDiffractionDataSingleCrystalRegistry("Global DiffractionDataSingleCrystal Registry")
Global registry for all PowderPattern objects. 
CrystVector_REAL mTheta
theta for the crystal and the HKL in ReciprSpace (in radians) 
string mName
Name for this RefinableObject. Should be unique, at least in the same scope.+. 
virtual void GlobalOptRandomMove(const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
Make a random move of the current configuration. 
CrystVector_REAL mGroupWeight
The weight on each reflection sum in case of grouped reflections. 
virtual const CrystVector_REAL & GetLSQDeriv(const unsigned int, RefinablePar &)
Get the first derivative values for the LSQ function, for a given parameter. 
virtual void SetRadiationType(const RadiationType radiation)
Set : neutron or x-ray experiment ? Wavelength ? 
CrystVector_REAL mH
H,K,L coordinates. 
virtual const CrystVector_REAL & GetLSQWeight(const unsigned int) const 
Get the weight values for the LSQ function. 
DiffractionData object for Single Crystal analysis. 
CrystVector_REAL mSinThetaLambda
 for the crystal and the reflections in ReciprSpace 
DiffractionDataSingleCrystal(const bool regist=true)
Default constructor. 
CrystVector_REAL mCalcIntensity
Calculated intensities. 
void RemoveChild(const RefinableObjClock &)
remove a child clock. This also tells the child clock to remove the parent. 
void SetWavelength(const REAL)
Set the (monochromatic) wavelength of the beam. 
const CrystVector_REAL & GetFhklCalcSq() const 
Returns the Array of calculated |F(hkl)|^2 for all reflections. 
void SetHklIobs(const CrystVector_long &h, const CrystVector_long &k, const CrystVector_long &l, const CrystVector_REAL &iObs, const CrystVector_REAL &sigma)
input H,K,L, Iobs and Sigma 
virtual void FitScaleFactorForR() const 
Compute the best scale factor minimising R. 
void SaveHKLIobsIcalc(const string &filename="hklIobsIcalc.out")
Save H,K,L Iobs Icalc to a file, text format, 3 columns theta Iobs Icalc. 
Main CIF class - parses the stream and separates data blocks, comments, items, loops. 
void SetEnergy(const REAL)
Set the (monochromatic) energy of the beam. 
void SetRadiationType(const RadiationType)
Set the radiation type (X-Rays, Neutron) 
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. 
void PrepareTwinningCalc() const 
Determine the index of reflections to be summed because of twinning (GroupOption==1) The reflections ...
CrystVector_REAL mFhklObsSq
Observed squared structure factors (zero-sized if none) 
CrystVector_REAL mGroupIobs
The observed intensities summed on all reflections that are (or could be) overlapped dur to a twinnin...
CrystVector_REAL mFhklCalcSq
F(HKL)^2 calc for each reflection. 
WX Class for DiffractionDataSingleCrystal objects. 
void ImportShelxHKLF4(const string &fileName)
Import h,k,l,I,Sigma from a file using shelx HKLF 4 format. 
std::map< std::string, CIFData > mvData
The data blocks, after parsing. The key is the name of the data block. 
long mNbReflUsed
Number of reflections which are below the max. 
CrystVector_REAL mGroupSigma
The uncertainty on observed grouped intensities. 
REAL mScaleFactor
Scale factor. 
const CrystVector_REAL & GetSigma() const 
Return the array of sigmas for observed intensities, for all peaks. 
void ImportHklIobsGroup(const string &fileName, const unsigned int skipLines=0)
Import h,k,l and grouped intensities from a file. 
virtual REAL GetR() const 
Return the Crystal R-factor (unweighted) 
void Reset()
Reset a Clock to 0, to force an update. 
Exception class for ObjCryst++ library. 
virtual void SetWeightToInvSigma2(const REAL minRelatSigma=1e-4, const REAL minIobsSigmaRatio=0)
Set the weight for all observed intensities to 1/sigma^2. 
virtual REAL GetBestRFactor() const 
Compute the best scale factor to minimize R, apply this scale factor and return the R value obtained...
RefinableObjClock mClockIcalc
Last time Icalc was computed. 
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++. 
CrystVector_REAL mObsIntensity
Observed intensity (after ABS and LP corrections) 
RefinableObjClock mClockChi2
Clock the last time Chi^2 was computed. 
Generic class for parameters of refinable objects. 
RefinableObjClock mClockStructFactorSq
Clock for the square modulus of the structure factor. 
RefinableObjClock mClockFhklObsSq
Last time observed squared structure factors were altered. 
virtual const string & GetName() const 
Name of the object. 
void SetSigma(const CrystVector_REAL &)
Return the array of sigmas for observed intensities, for all peaks. 
RadiationType
Type of radiation used. 
void ImportHklIobsSigma(const string &fileName, const long nbRefl, const int skipLines=0)
Import h,k,l,I,Sigma from a file. 
void SetIobsToIcalc()
Set Iobs to current values of Icalc. Mostly used for tests. 
CrystVector_REAL mWeight
weight for computing R-Factor, for each observed value. 
Crystal class: Unit cell, spacegroup, scatterers. 
void InitOptions()
Init options (currently only twinning). 
void SetGlobalOptimStep(const RefParType *type, const REAL step)
Change the maximum step to use during Global Optimization algorithms. 
RefinableObjClock mClockPrepareTwinningCorr
Clock for twinning, when the preparation of twinning correction was last made. 
virtual REAL GetRw() const 
Return the Crystal R-factor (weighted) 
ObjRegistry< RefObjOpt > mOptionRegistry
List of options for this object. 
class of refinable parameter types. 
bool mHasObservedData
Are there observed intensities ? 
CrystVector_REAL mFhklCalcReal
real &imaginary parts of F(HKL)calc 
Class to define the radiation (type, monochromaticity, wavelength(s)) of an experiment. 
virtual DiffractionDataSingleCrystal * CreateCopy() const 
So-called virtual copy constructor. 
void AddOption(RefObjOpt *opt)
virtual void PrintObsCalcData() const 
Print H, K, L Iobs sigma Icalc for all reflections Iobs and sigma (if given) are scaled to Icalc (if ...
std::map< RefinablePar *, CrystVector_REAL > & GetIcalc_FullDeriv(std::set< RefinablePar * > &vPar)
virtual REAL GetChi2() const 
Return conventionnal Chi^2. 
void ImportCIF(const string &fileName)
Import diffraction data from a CIF file. 
void SetWavelength(const REAL)
Set the (monochromatic) wavelength of the beam.