Skip to content

Commit ad201be

Browse files
author
Rob
committed
modified JeongPeakWidth to include new Q_broad term as per https://doi.org/10.1107/S0108767391011327
1 parent 1ac3dcf commit ad201be

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

src/diffpy/srreal/JeongPeakWidth.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ JeongPeakWidth::JeongPeakWidth() :
3838
this, &JeongPeakWidth::getDelta2, &JeongPeakWidth::setDelta2);
3939
this->registerDoubleAttribute("qbroad",
4040
this, &JeongPeakWidth::getQbroad, &JeongPeakWidth::setQbroad);
41+
this->registerDoubleAttribute("qbroad_new",
42+
this, &JeongPeakWidth::getQbroad_new, &JeongPeakWidth::setQbroad_new);
4143
}
4244

4345

@@ -69,15 +71,17 @@ double JeongPeakWidth::calculate(const BaseBondGenerator& bnds) const
6971
double corr = this->msdSharpeningRatio(r);
7072
// avoid calculating square root of negative value
7173
double fwhm = (corr <= 0) ? 0.0 :
72-
(sqrt(corr) * this->DebyeWallerPeakWidth::calculate(bnds));
74+
(sqrt(corr) * this->DebyeWallerPeakWidth::calculate(bnds) +
75+
pow(this->getQbroad_new()*r, 2));
7376
return fwhm;
7477
}
7578

7679

7780
double JeongPeakWidth::maxWidth(StructureAdapterPtr stru,
7881
double rmin, double rmax) const
7982
{
80-
double maxwidth0 = this->DebyeWallerPeakWidth::maxWidth(stru, rmin, rmax);
83+
double maxwidth0 = this->DebyeWallerPeakWidth::maxWidth(stru, rmin, rmax) +
84+
pow(this->getQbroad_new()*r, 2);
8185
double maxmsdsharp = max(
8286
this->msdSharpeningRatio(rmin),
8387
this->msdSharpeningRatio(rmax));
@@ -118,6 +122,19 @@ const double& JeongPeakWidth::getQbroad() const
118122
}
119123

120124

125+
const double& JeongPeakWidth::getQbroad_new() const
126+
{
127+
return mqbroad_new;
128+
}
129+
130+
131+
void JeongPeakWidth::setQbroad_new(double qbroad_new)
132+
{
133+
if (mqbroad_new != qbroad_new) mticker.click();
134+
mqbroad_new = qbroad_new;
135+
}
136+
137+
121138
void JeongPeakWidth::setQbroad(double qbroad)
122139
{
123140
if (mqbroad != qbroad) mticker.click();

0 commit comments

Comments
 (0)