19 #include "ObjCryst/ObjCryst/ScatteringCorr.h" 
   20 #include "ObjCryst/Quirks/VFNStreamFormat.h" 
   26    class TexturePhaseMarchDollase;
 
   28 #include "ObjCryst/wxCryst/wxPowderPattern.h" 
   41    VFN_DEBUG_MESSAGE(
"ScatteringCorr::ScatteringCorr(&scattData)",5)
 
   44 ScatteringCorr::~ScatteringCorr()
 
   46    VFN_DEBUG_MESSAGE(
"ScatteringCorr::~ScatteringCorr()",5)
 
   65 LorentzCorr::~LorentzCorr()
 
   71    const static string mName=
"LorentzCorr";
 
   77    const static string className=
"LorentzCorr";
 
   85    TAU_PROFILE(
"LorentzCorr::CalcCorr()",
"void ()",TAU_DEFAULT);
 
  100 PolarizationCorr::~PolarizationCorr()
 
  106    const static string mName=
"PolarizationCorr";
 
  112    const static string className=
"PolarizationCorr";
 
  121        && (fabs(mPolarAfactor-((1-f)/(1+f))) <(mPolarAfactor*.0001)) ) 
return;
 
  122    VFN_DEBUG_MESSAGE(
"PolarizationCorr::CalcCorr()",10)
 
  123    TAU_PROFILE(
"PolarizationCorr::CalcCorr()",
"void ()",TAU_DEFAULT);
 
  124    mPolarAfactor=((1-f)/(1+f));
 
  128       mCorr(i) =(1.+mPolarAfactor*(0.5+0.5*cos(4*(*theta)(i))))/(1.+mPolarAfactor);
 
  138 PowderSlitApertureCorr::PowderSlitApertureCorr(
const ScatteringData & data):
 
  142 PowderSlitApertureCorr::~PowderSlitApertureCorr()
 
  148    const static string mName=
"PowderSlitApertureCorr";
 
  154    const static string className=
"PowderSlitApertureCorr";
 
  162    TAU_PROFILE(
"PowderSlitApertureCorr::CalcCorr()",
"void ()",TAU_DEFAULT);
 
  172 TexturePhaseMarchDollase::TexturePhaseMarchDollase(
const REAL f,
 
  178 mFraction(f),mMarchCoeff(c),mH(h),mK(k),mL(l),mpTextureMarchDollase(&tex)
 
  184 TexturePhaseMarchDollase::~TexturePhaseMarchDollase()
 
  190 const string& TexturePhaseMarchDollase::GetClassName()
const 
  192    const static string className=
"March-Dollase Texture Phase";
 
  195 const string& TexturePhaseMarchDollase::GetName()
const 
  197    const static string name=
"March-Dollase Texture Phase";
 
  201 void TexturePhaseMarchDollase::SetPar(
const REAL f, 
const REAL c,
const REAL h,
const REAL k, 
const REAL l)
 
  202 {mFraction=f;mMarchCoeff=c;mH=h;mK=k;mL=l;}
 
  203 void TexturePhaseMarchDollase::XMLOutput(ostream &os,
int indent)
const 
  205    VFN_DEBUG_ENTRY(
"TexturePhaseMarchDollase::XMLOutput():"<<this->GetName(),5)
 
  206    for(
int i=0;i<indent;i++) os << "  " ;
 
  207    XMLCrystTag tag("TexturePhaseMarchDollase");
 
  227    tag.SetIsEndTag(true);
 
  228    for(
int i=0;i<indent;i++) os << "  " ;
 
  230    VFN_DEBUG_EXIT("TexturePhaseMarchDollase::XMLOutput():"<<this->GetName(),5)
 
  233 void TexturePhaseMarchDollase::XMLInput(istream &is,const XMLCrystTag &tagg)
 
  235    VFN_DEBUG_ENTRY(
"TexturePhaseMarchDollase::XMLInput():",5)
 
  236    for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
 
  243       if((
"TexturePhaseMarchDollase"==tag.GetName())&&tag.IsEndTag())
 
  245          VFN_DEBUG_EXIT(
"TexturePhaseMarchDollase::XMLInput()",5)
 
  248       if("Par"==tag.GetName())
 
  250          for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
 
  252             if(
"Name"==tag.GetAttributeName(i))
 
  254                if(
"Fraction"==tag.GetAttributeValue(i))
 
  259                if(
"MarchCoeff"==tag.GetAttributeValue(i))
 
  264                if(
"H"==tag.GetAttributeValue(i))
 
  269                if(
"K"==tag.GetAttributeValue(i))
 
  274                if(
"L"==tag.GetAttributeValue(i))
 
  288 WXCrystObjBasic* TexturePhaseMarchDollase::WXCreate(wxWindow* parent)
 
  293 WXCrystObjBasic* TexturePhaseMarchDollase::WXGet()
 
  298 void TexturePhaseMarchDollase::WXDelete()
 
  302       VFN_DEBUG_MESSAGE(
"TexturePhaseMarchDollase::WXDelete()",5)
 
  306 void TexturePhaseMarchDollase::WXNotifyDelete(){mpWXCrystObj=0;}
 
  313 TextureMarchDollase::TextureMarchDollase(
const ScatteringData & data):
 
  314 ScatteringCorr(data),mNbReflUsed(0)
 
  316    mClockMaster.AddChild(mClockTexturePar);
 
  319 TextureMarchDollase::~TextureMarchDollase()
 
  326    const static string name=
"TextureMarchDollase";
 
  333    const static string name=
"TextureMarchDollase";
 
  337 void TextureMarchDollase::AddPhase(
const REAL f, 
const REAL c,
 
  338                                    const REAL h,
const REAL k, 
const REAL l)
 
  341    VFN_DEBUG_ENTRY(
"TextureMarchDollase::AddPhase()",5)
 
  342    TexturePhaseMarchDollase* phase=new TexturePhaseMarchDollase(f,c,h,k,l,*this);
 
  345    const 
unsigned int nbPhase=this->GetNbPhase();
 
  347    sprintf(buf,"%d",nbPhase);
 
  349       RefinablePar tmp(
"Fraction_"+(
string)buf,&(phase->mFraction),0.,1.,
 
  351                         REFPAR_DERIV_STEP_ABSOLUTE,
true,
true,
true,
false,1.);
 
  352       tmp.AssignClock(mClockTexturePar);
 
  353       tmp.SetDerivStep(1e-7);
 
  354       tmp.SetGlobalOptimStep(.05);
 
  358       RefinablePar tmp(
"MarchCoeff_"+(
string)buf,&(phase->mMarchCoeff),.1,10.,
 
  360                         REFPAR_DERIV_STEP_ABSOLUTE,
true,
true,
true,
false,1.);
 
  361       tmp.AssignClock(mClockTexturePar);
 
  362       tmp.SetDerivStep(1e-7);
 
  363       tmp.SetGlobalOptimStep(.1);
 
  367       RefinablePar tmp(
"H_"+(
string)buf,&(phase->mH),-10.,10.,
 
  369                         REFPAR_DERIV_STEP_ABSOLUTE,
false,
true,
true,
false,1.);
 
  370       tmp.AssignClock(mClockTexturePar);
 
  371       tmp.SetDerivStep(1e-7);
 
  372       tmp.SetGlobalOptimStep(.01);
 
  376       RefinablePar tmp(
"K_"+(
string)buf,&(phase->mK),-10.,10.,
 
  378                         REFPAR_DERIV_STEP_ABSOLUTE,
false,
true,
true,
false,1.);
 
  379       tmp.AssignClock(mClockTexturePar);
 
  380       tmp.SetDerivStep(1e-7);
 
  381       tmp.SetGlobalOptimStep(.01);
 
  385       RefinablePar tmp(
"L_"+(
string)buf,&(phase->mL),-10.,10.,
 
  387                         REFPAR_DERIV_STEP_ABSOLUTE,
false,
true,
true,
false,1.);
 
  388       tmp.AssignClock(mClockTexturePar);
 
  389       tmp.SetDerivStep(1e-7);
 
  390       tmp.SetGlobalOptimStep(.01);
 
  395    mPhaseRegistry.Register(*phase);
 
  396    VFN_DEBUG_EXIT(
"TextureMarchDollase::AddPhase()=",5)
 
  399 void TextureMarchDollase::SetPhasePar(
const unsigned int i, 
const REAL f, 
const REAL c,
 
  400                  const REAL h,
const REAL k, 
const REAL l)
 
  402    mPhaseRegistry.GetObj(i).SetPar(f,c,h,k,l);
 
  407 unsigned int TextureMarchDollase::GetNbPhase()
 const {
return mPhaseRegistry.GetNb();}
 
  409 REAL TextureMarchDollase::GetFraction(
const unsigned int i)
const 
  410 {
return mPhaseRegistry.GetObj(i).mFraction;}
 
  412 REAL TextureMarchDollase::GetMarchCoeff(
const unsigned int i)
const 
  413 {
return mPhaseRegistry.GetObj(i).mMarchCoeff;}
 
  415 REAL TextureMarchDollase::GetPhaseH(
const unsigned int i)
const 
  416 {
return mPhaseRegistry.GetObj(i).mH;}
 
  418 REAL TextureMarchDollase::GetPhaseK(
const unsigned int i)
const 
  419 {
return mPhaseRegistry.GetObj(i).mK;}
 
  421 REAL TextureMarchDollase::GetPhaseL(
const unsigned int i)
const 
  422 {
return mPhaseRegistry.GetObj(i).mL;}
 
  435       VFN_DEBUG_MESSAGE(
"TextureMarchDollase::GlobalOptRandomMove()",1)
 
  436       for(
unsigned int i=0;i<this->GetNbPhase();i++)
 
  446          if(pF->IsFixed()==
false)
 
  449             const REAL sig=4*delta;
 
  450             const REAL y0=mPhaseRegistry.GetObj(i).mBiasFraction;
 
  454             ymax=.5+1/M_PI*atan((y+delta-y0)/(2.*sig));
 
  455             ymin=.5+1/M_PI*atan((y-delta-y0)/(2.*sig));
 
  456             y=ymin+rand()/(REAL)RAND_MAX*(ymax-ymin);
 
  462          if((pH->IsFixed()==
false)||(pK->IsFixed()==
false)||(pL->IsFixed()==
false))
 
  469                REAL tx0=mPhaseRegistry.GetObj(i).mBiasH;
 
  470                REAL ty0=mPhaseRegistry.GetObj(i).mBiasK;
 
  471                REAL tz0=mPhaseRegistry.GetObj(i).mBiasL;
 
  473                const REAL delta=pH->
GetGlobalOptimStep()*mutationAmplitude*mPhaseRegistry.GetObj(i).mNorm;
 
  474                const REAL sig=2*delta;
 
  477                ymax=.5+1/M_PI*atan((tx+delta-tx0)/(2.*sig));
 
  478                ymin=.5+1/M_PI*atan((tx-delta-tx0)/(2.*sig));
 
  479                y=ymin+rand()/(REAL)RAND_MAX*(ymax-ymin);
 
  483                tx=tx0+2*sig*tan(M_PI*y);
 
  485                ymax=.5+1/M_PI*atan((ty+delta-ty0)/(2.*sig));
 
  486                ymin=.5+1/M_PI*atan((ty-delta-ty0)/(2.*sig));
 
  487                y=ymin+rand()/(REAL)RAND_MAX*(ymax-ymin);
 
  491                ty=ty0+2*sig*tan(M_PI*y);
 
  493                ymax=.5+1/M_PI*atan((tz+delta-tz0)/(2.*sig));
 
  494                ymin=.5+1/M_PI*atan((tz-delta-tz0)/(2.*sig));
 
  495                y=ymin+rand()/(REAL)RAND_MAX*(ymax-ymin);
 
  499                tz=tz0+2*sig*tan(M_PI*y);
 
  501             const REAL factor=mPhaseRegistry.GetObj(i).mNorm/sqrt(tx*tx+ty*ty+tz*tz);
 
  510          if(pM->IsFixed()==
false)
 
  514             const REAL sig=2*delta;
 
  517             const REAL y0=log(mPhaseRegistry.GetObj(i).mBiasMarchCoeff);
 
  519             ymin=.5+1/M_PI*atan((y-delta-y0)/(2.*sig));
 
  520             ymax=.5+1/M_PI*atan((y+delta-y0)/(2.*sig));
 
  521             y=ymin+rand()/(REAL)RAND_MAX*(ymax-ymin);
 
  525             pM->
MutateTo(exp(y0+2*sig*tan(M_PI*y)));
 
  532 REAL TextureMarchDollase::GetBiasingCost()
const 
  536    for(
unsigned int i=0; i<this->GetNbPhase();i++)
 
  538       tmp =(mPhaseRegistry.GetObj(i).mBiasFraction-mPhaseRegistry.GetObj(i).mFraction)/.04;
 
  541       tmp =log10(mPhaseRegistry.GetObj(i).mBiasMarchCoeff/mPhaseRegistry.GetObj(i).mMarchCoeff)/.04;
 
  544       REAL tx=mPhaseRegistry.GetObj(i).mH-mPhaseRegistry.GetObj(i).mBiasH;
 
  545       REAL ty=mPhaseRegistry.GetObj(i).mK-mPhaseRegistry.GetObj(i).mBiasK;
 
  546       REAL tz=mPhaseRegistry.GetObj(i).mL-mPhaseRegistry.GetObj(i).mBiasL;
 
  549       cost +=(tx*tx+ty*ty+tz*tz)/mPhaseRegistry.GetObj(i).mNorm/.04;
 
  551    VFN_DEBUG_MESSAGE(
"TextureMarchDollase::GetBiasingCost()="<<cost<<
"("<<
mName<<
")",1)
 
  556    VFN_DEBUG_ENTRY(
"TextureMarchDollase::XMLOutput():",5)
 
  557    for(
int i=0;i<indent;i++) os << 
"  " ;
 
  562    for(
int i=0;i<mPhaseRegistry.GetNb();i++) mPhaseRegistry.GetObj(i).XMLOutput(os,indent);
 
  565    tag.SetIsEndTag(
true);
 
  566    for(
int i=0;i<indent;i++) os << 
"  " ;
 
  568    VFN_DEBUG_EXIT(
"TextureMarchDollase::XMLOutput():"<<this->
GetName(),5)
 
  573    VFN_DEBUG_ENTRY(
"TextureMarchDollase::XMLInput():"<<this->
GetName(),5)
 
  574    for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
 
  581       if((
"TextureMarchDollase"==tag.GetName())&&tag.IsEndTag())
 
  583          VFN_DEBUG_EXIT(
"TextureMarchDollase::XMLInput()",5)
 
  586       if(
"TexturePhaseMarchDollase"==tag.GetName())
 
  588          const long nb=mPhaseRegistry.GetNb();
 
  589          this->AddPhase(0.,1.,1.,0.,0.);
 
  590          mPhaseRegistry.GetObj(nb).XMLInput(is,tag);
 
  595                                             const bool enableRestraints)
 
  597    for(
unsigned int i=0; i<this->GetNbPhase();i++)
 
  602       if((pH->IsFixed()==
false)||(pK->IsFixed()==
false)||(pL->IsFixed()==
false))
 
  604          pH->SetIsFixed(
false);
 
  605          pK->SetIsFixed(
false);
 
  606          pL->SetIsFixed(
false);
 
  612       mPhaseRegistry.GetObj(i).mNorm=sqrt(tx*tx+ty*ty+tz*tz);
 
  614       if(mPhaseRegistry.GetObj(i).mNorm<1e-6) mPhaseRegistry.GetObj(i).mNorm=1;
 
  620    for(
unsigned int i=0; i<this->GetNbPhase();i++)
 
  622       mPhaseRegistry.GetObj(i).mBiasFraction  =mPhaseRegistry.GetObj(i).mFraction;
 
  623       mPhaseRegistry.GetObj(i).mBiasMarchCoeff=mPhaseRegistry.GetObj(i).mMarchCoeff;
 
  624       mPhaseRegistry.GetObj(i).mBiasH         =mPhaseRegistry.GetObj(i).mH;
 
  625       mPhaseRegistry.GetObj(i).mBiasK         =mPhaseRegistry.GetObj(i).mK;
 
  626       mPhaseRegistry.GetObj(i).mBiasL         =mPhaseRegistry.GetObj(i).mL;
 
  632    if(this->GetNbPhase()==0)
 
  640    VFN_DEBUG_ENTRY(
"TextureMarchDollase::CalcCorr()",3)
 
  641    TAU_PROFILE(
"TextureMarchDollase::CalcCorr()",
"void ()",TAU_DEFAULT);
 
  645       REAL fractionNorm=0,nonTexturedFraction;
 
  646       for(
unsigned int i=0; i<this->GetNbPhase();i++) fractionNorm+=this->GetFraction(i);
 
  649          nonTexturedFraction= 1.-fractionNorm;
 
  652       else nonTexturedFraction=0.;
 
  655       mCorr.resize(nbRefl);
 
  656       mCorr=nonTexturedFraction;
 
  657       CrystVector_REAL reflNorm(nbRefl);
 
  662          for(
long i=0;i<nbReflUsed;i++)
 
  664             reflNorm(i)= sqrt(*xx * *xx + *yy * *yy + *zz * *zz);
 
  668       CrystMatrix_REAL hkl;
 
  669       for(
unsigned int i=0; i<this->GetNbPhase();i++)
 
  676                .
GetAllEquivRefl(this->GetPhaseH(i),this->GetPhaseK(i),this->GetPhaseL(i),
true);
 
  678             const REAL march=1./(this->GetMarchCoeff(i)+1e-6);
 
  679             const REAL march2=this->GetMarchCoeff(i)*this->GetMarchCoeff(i)-march;
 
  681             const REAL frac=this->GetFraction(i)/(fractionNorm+1e-6)/hkl.rows();
 
  683          for(
long j=0;j<hkl.rows();j++)
 
  693                const REAL *xyznorm=reflNorm.data();
 
  696                   const REAL norm=sqrt(tx*tx+ty*ty+tz*tz);
 
  703                for(
long k=0;k<nbReflUsed;k++)
 
  705                   tmp=(tx * (*xx++) + ty * (*yy++) + tz * (*zz++))/ (*xyznorm++);
 
  706                   tmp=march+march2*tmp*tmp;
 
  708                   mCorr(k)+=frac*pow((
float)tmp,(
float)-1.5);
 
  722    VFN_DEBUG_EXIT(
"TextureMarchDollase::CalcCorr()",3)
 
  724 void TextureMarchDollase::DeleteAllPhase()
 
  729 WXCrystObjBasic* TextureMarchDollase::WXCreate(wxWindow* parent)
 
  742 TextureEllipsoid::TextureEllipsoid(
const ScatteringData & data,
 
  743                                    const REAL EPR1, 
const REAL EPR2, 
const REAL EPR3,
 
  744                                    const REAL EPR4, 
const REAL EPR5, 
const REAL EPR6):
 
  757 TextureEllipsoid::~TextureEllipsoid()
 
  771    const static string name=
"TextureEllipsoid";
 
  778    const static string name=
"TextureEllipsoid";
 
  782 void TextureEllipsoid::SetParams(
const REAL EPR1, 
const REAL EPR2, 
const REAL EPR3,
 
  783                                  const REAL EPR4, 
const REAL EPR5, 
const REAL EPR6)
 
  806       VFN_DEBUG_MESSAGE(
"TextureEllipsoid::GlobalOptRandomMove()",1)
 
  809       for (
int i=0; i<6; i++)
 
  811          pEPR[i] = &(this->
GetPar(&(mEPR[i])));
 
  812          if (pEPR[i]->IsFixed()==
false)
 
  813             pEPR[i]->Mutate(pEPR[i]->GetGlobalOptimStep()*2*(rand()/(REAL)RAND_MAX-0.5)*mutationAmplitude);
 
  822    if((mEPR[0]==0) && (mEPR[1]==0) && (mEPR[2]==0) && (mEPR[3]==0) && (mEPR[4]==0) && (mEPR[5]==0))
 
  824    VFN_DEBUG_ENTRY(
"TextureEllipsoid::XMLOutput():"<<this->
GetName(),5)
 
  825    for(
int i=0;i<indent;i++) os << 
"  " ;
 
  844    tag.SetIsEndTag(
true);
 
  845    for(
int i=0;i<indent;i++) os << 
"  " ;
 
  847    VFN_DEBUG_EXIT(
"TextureEllipsoid::XMLOutput():"<<this->
GetName(),5)
 
  852    VFN_DEBUG_ENTRY(
"TextureEllipsoid::XMLInput():"<<this->
GetName(),5)
 
  853    for(
unsigned int i=0;i<tagg.GetNbAttribute();i++)
 
  860       if((
"TextureEllipsoid"==tag.GetName())&&tag.IsEndTag())
 
  862          VFN_DEBUG_EXIT(
"TextureEllipsoid::XMLInput()",5)
 
  865       if(
"Par"==tag.GetName())
 
  867          for(
unsigned int i=0;i<tag.GetNbAttribute();i++)
 
  869             if(
"Name"==tag.GetAttributeName(i))
 
  871                if(
"EPR1"==tag.GetAttributeValue(i))
 
  876                if(
"EPR2"==tag.GetAttributeValue(i))
 
  881                if(
"EPR3"==tag.GetAttributeValue(i))
 
  886                if(
"EPR4"==tag.GetAttributeValue(i))
 
  891                if(
"EPR5"==tag.GetAttributeValue(i))
 
  896                if(
"EPR6"==tag.GetAttributeValue(i))
 
  909                                             const bool enableRestraints)
 
  916    if((mEPR[0]==0) && (mEPR[1]==0) && (mEPR[2]==0) && (mEPR[3]==0) && (mEPR[4]==0) && (mEPR[5]==0))
 
  925    VFN_DEBUG_ENTRY(
"TextureEllipsoid::CalcCorr()",3)
 
  926    TAU_PROFILE(
"TextureEllipsoid::CalcCorr()",
"void ()",TAU_DEFAULT)
 
  930    mCorr.resize(nbRefl);
 
  935    REAL *pCorr=
mCorr.data();
 
  940    for(
long i=0;i<nbReflUsed;i++)
 
  942       dhkl=1.0/(2* (*pstol++));
 
  943       dhkl=0.001*dhkl*dhkl;
 
  944       tmp=(mEPR[0]* (*pH) * (*pH) +
 
  945            mEPR[1]* (*pK) * (*pK) +
 
  946            mEPR[2]* (*pL) * (*pL) +
 
  947            mEPR[3]*2* (*pH) * (*pK) +
 
  948            mEPR[4]*2* (*pH) * (*pL) +
 
  949            mEPR[5]*2* (*pK) * (*pL)) *
 
  952       tmp=pow((
float)(1.0+tmp),(
float)-1.5);
 
  960    for(
long i=0;i<nbReflUsed;i++)
 
  965    VFN_DEBUG_EXIT(
"TextureEllipsoid::CalcCorr()",3)
 
  970    VFN_DEBUG_ENTRY(
"TextureEllipsoid::UpdateEllipsoidPar().",3)
 
  977    for (
int i=0; i<6; i++)
 
 1027       mEPR[3]=mEPR[0]*0.5;
 
 1048    for (
int i=0; i<6; i++)
 
 1050    VFN_DEBUG_EXIT(
"TextureEllipsoid::UpdateEllipsoidPar().",3)
 
 1055    VFN_DEBUG_ENTRY(
"TextureEllipsoid::InitRefParList()",5)
 
 1059       for (
int i=0; i<6; i++)
 
 1061          sprintf(buf,
"%d",i+1);
 
 1062          RefinablePar tmp(
"EPR"+(
string)buf, &(mEPR[i]), -10., 10.,
 
 1064                      false, 
true, 
true, 
false, 1.0);
 
 1071    VFN_DEBUG_EXIT(
"TextureEllipsoid::InitRefParList():Finished",5)
 
 1074 #ifdef __WX__CRYST__ 
 1077    VFN_DEBUG_ENTRY(
"TextureEllipsoid::WXCreate()",6)
 
 1081    return mpWXCrystObj;
 
 1101    const static string mName=
"TOFCorr";
 
 1107    const static string className=
"TOFCorr";
 
 1115    TAU_PROFILE(
"TOFCorr::CalcCorr()",
"void ()",TAU_DEFAULT);
 
const RefinableObjClock & GetClockNbReflBelowMaxSinThetaOvLambda() const 
Clock the last time the number of reflections used was changed. 
void SetDerivStep(const REAL)
Fixed step to use to compute numerical derivative. 
const CrystVector_REAL & GetH() const 
Return the 1D array of H coordinates for all reflections. 
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream. 
virtual long GetNbReflBelowMaxSinThetaOvLambda() const 
Recalc, and get the number of reflections which should be actually used, due to the maximuml sin(thet...
Texture correction using the March-Dollase model. 
void AddPar(const RefinablePar &newRefPar)
Add a refinable parameter. 
const CrystVector_REAL & GetSinThetaOverLambda() const 
Return an array with  for all reflections. 
virtual void CalcCorr() const =0
Do the computation of corrected intensities. 
const RefParType * gpRefParTypeScattDataCorrInt
Generic type for correction to calculated intensities. 
CrystVector_REAL mCorr
The vector of correction to intensities. 
const CrystVector_REAL & GetTheta() const 
Return an array with theta values for all reflections. 
virtual void XMLOutput(ostream &os, int indent=0) const 
Output to stream in well-formed XML. 
virtual void GlobalOptRandomMove(const REAL mutationAmplitude, const RefParType *type=gpRefParTypeObjCryst)
Make a random move of the current configuration. 
virtual const string & GetClassName() const 
Get the name of the class. 
virtual void TagNewBestConfig() const 
During a global optimization, tells the object that the current config is the latest "best" config...
We need to record exactly when refinable objects have been modified for the last time (to avoid re-co...
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. 
void MillerToOrthonormalCoords(REAL &x, REAL &y, REAL &z) const 
Get Miller H,K, L indices from orthonormal coordinates in reciprocal space. 
bool HasCrystal() const 
Has a Crystal structure associated yet ? 
virtual void CalcCorr() const 
Do the computation of corrected intensities. 
Texture correction using the Ellipsoidal preferred orientation function. 
void Click()
Record an event for this clock (generally, the 'time' an object has been modified, or some computation has been made) 
long GetNbPar() const 
Total number of refinable parameter in the object. 
void UpdateEllipsoidPar()
Update ellipsoid parameters for tetragonal, trigonal, hexagonal, cubic lattices. 
void AddChild(const RefinableObjClock &)
Add a 'child' clock. 
const RefParType * gpRefParTypeScattDataCorrInt_Ellipsoid
Parameter type for the ellipsoid coefficient. 
unsigned int GetUniqueAxis() const 
Which is the unique axis (for monoclinic space groups ) 
virtual const string & GetName() const 
Get the name of this object. 
void XMLInput(istream &is, const XMLCrystTag &tag)
XMLInput From stream. 
RefinablePar & GetPar(const long i)
Access all parameters in the order they were inputted. 
virtual const string & GetClassName() const 
Get the name of the class. 
void SetIsUsed(const bool)
Is the parameter used (if not, it is simply irrelevant in the 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. 
Class to compute structure factors for a set of reflections and a Crystal. 
RefinableObjClock mClockMaster
Master clock, which is changed whenever the object has been altered. 
virtual const Radiation & GetRadiation() const =0
Get the radiation object for this data. 
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 void CalcCorr() const 
Do the computation of corrected intensities. 
const SpaceGroup & GetSpaceGroup() const 
Access to the SpaceGroup object. 
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. 
const CrystVector_REAL & GetReflZ() const 
Return the 1D array of orthonormal z coordinates for all reflections (recipr. space) ...
Abstract base class for all objects in wxCryst. 
void OrthonormalToMillerCoords(REAL &x, REAL &y, REAL &z) const 
Get orthonormal coordinates given a set of H,K, L indices in reciprocal space. 
string mName
Name for this RefinableObject. Should be unique, at least in the same scope.+. 
virtual void CalcCorr() const 
Do the computation of corrected intensities. 
virtual const string & GetClassName() const 
Get the name of the class. 
const RefParType * gpRefParTypeScattDataCorrIntPO_Amplitude
Parameter type for the amplitude of preferred orientation. 
virtual const string & GetClassName() const 
Get the name of the class. 
virtual void CalcCorr() const 
Do the computation of corrected intensities. 
void AssignClock(RefinableObjClock &clock)
Base class to compute all kind of corrections to intensities: Lorentz, Polar, absorption, texcture, extinction, etc... 
virtual const string & GetName() const 
Get the name of this object. 
const CrystVector_REAL & GetReflY() const 
Return the 1D array of orthonormal y coordinates for all reflections (recipr. space) ...
void InitRefParList()
Prepare the refinable parameters list. 
const CrystVector_REAL & GetReflX() const 
Return the 1D array of orthonormal x coordinates for all reflections (recipr. space) ...
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. 
CrystMatrix_REAL GetAllEquivRefl(const REAL h, const REAL k, const REAL l, const bool excludeFriedelMate=false, const bool forceFriedelLaw=false, const REAL sf_re=0, const REAL sf_im=0) const 
Get the list of all equivalent reflections. 
const ScatteringData * mpData
The associated ScatteringData object. 
const Crystal & GetCrystal() const 
Const access to the data's crystal. 
RefinableObjClock mClockCorrCalc
The clock marking the last time the correction was calculated. 
virtual void XMLInput(istream &is, const XMLCrystTag &tag)
Input From stream. 
TextureMarchDollase * mpTextureMarchDollase
The parent TextureMarchDollase object. 
void MutateTo(const REAL newValue)
Change the current value to the given one. 
virtual const string & GetName() const 
Get the name of this object. 
Class to display one Preferred Orientation phase using the Ellipsoid model. 
bool IsDescendantFromOrSameAs(const RefParType *type) const 
Returns true if the parameter is a descendant of 'type'. 
virtual const string & GetClassName() const 
Get the name of the class. 
long GetNbRefl() const 
Return the number of reflections in this experiment. 
const RefinableObjClock & GetClockTheta() const 
Clock the last time the sin(theta)/lambda and theta arrays were re-computed. 
The namespace which includes all objects (crystallographic and algorithmic) in ObjCryst++. 
const CrystVector_REAL & GetCorr() const 
Get the vector of corrections for all reflections. 
Generic class for parameters of refinable objects. 
const RefParType * gpRefParTypeScattDataCorrIntPO_Direction
Parameter type for preferred orientation direction. 
REAL GetGlobalOptimStep() const 
Maximum step to use during Global Optimization algorithms. 
int GetSpaceGroupNumber() const 
Id number of the spacegroup. 
REAL GetValue() const 
of the parameter. 
const RefParType * gpRefParTypeScattDataCorrIntPO_Fraction
Parameter type for fraction of preferred orientation. 
unsigned long mNbReflUsed
Number of reflexion for which the calculation is actually done. 
virtual const string & GetName() const 
Get the name of this object. 
class to input or output a well-formatted xml beginning or ending tag. 
class of refinable parameter types. 
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 SetGlobalOptimStep(const REAL)
Maximum step to use during Global Optimization algorithms. 
virtual const string & GetName() const 
Get the name of this object. 
void XMLOutput(ostream &os, const string &name, int indent=0) const 
XMLOutput to stream in well-formed XML.