Skip to content

Commit 3af0417

Browse files
committed
Improve wording in rf614 tutorial.
1 parent 0c40b9d commit 3af0417

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tutorials/roofit/rf614_binned_fit_problems.C

+7-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
// One should in principle be able to use
2727
// pdf.generateBinned(x, nEvents, RooFit::ExpectedData()).
2828
// Unfortunately it has a problem: it also has the bin bias that this tutorial
29-
// demostrates, to if we would use it, the biases would cancel out.
29+
// demostrates. If we used it, the biases would cancel out.
3030
std::unique_ptr<RooDataHist> generateBinnedAsimov(RooAbsPdf const &pdf, RooRealVar &x, int nEvents)
3131
{
3232
auto dataH = std::make_unique<RooDataHist>("dataH", "dataH", RooArgSet{x});
@@ -82,14 +82,14 @@ void rf614_binned_fit_problems()
8282
// result and the true parameters comes from binning effects.
8383
std::unique_ptr<RooAbsData> expoData{generateBinnedAsimov(expo, x, 10000)};
8484

85-
// If you do the fit the usual was in RooFit, you will get a bias in the
85+
// If you do the fit the usual way in RooFit, you will get a biased
8686
// result. This is because the continuous, normalized pdf is evaluated only
8787
// at the bin centers.
8888
std::unique_ptr<RooFitResult> fit1{expo.fitTo(*expoData, Save(), PrintLevel(-1), SumW2Error(false))};
8989
fit1->Print();
9090

9191
// In the case of an exponential function, the bias that you get by
92-
// evaluating the pdf only at the bin centers is a constant scale factor in
92+
// evaluating the pdf only at the bin centers is an almost constant scale factor in
9393
// each bin. Here, we can do a trick to get rid of the bias: we also
9494
// evaluate the normalization integral for the pdf the same way, i.e.,
9595
// summing the values of the unnormalized pdf at the bin centers. Like this
@@ -103,7 +103,7 @@ void rf614_binned_fit_problems()
103103
// Power law example
104104
// -----------------
105105

106-
// Let's not look at another example: a power law \f[x^a\f].
106+
// Let's now look at another example: a power law \f[x^a\f].
107107
RooRealVar a{"a", "a", -0.3, -5.0, 5.0};
108108
RooPower powerlaw{"powerlaw", "powerlaw", x, RooConst(1.0), a};
109109
std::unique_ptr<RooAbsData> powerlawData{generateBinnedAsimov(powerlaw, x, 10000)};
@@ -116,8 +116,8 @@ void rf614_binned_fit_problems()
116116
// trick by sampling the integral in the same way doesn't cancel out the
117117
// bias completely. The average bias is canceled, but there are per-bin
118118
// biases that remain. Still, this method has some value: it is cheaper than
119-
// rigurously correcting the bias by integrating the pdf in each bin. So if
120-
// you know your per-bin bias variations are small or performance is an
119+
// rigorously correcting the bias by integrating the pdf in each bin. So if
120+
// you know your per-bin bias, variations are small or performance is an
121121
// issue, this approach can be sufficient.
122122
enableBinIntegrator(powerlaw, x.numBins());
123123
std::unique_ptr<RooFitResult> fit4{powerlaw.fitTo(*powerlawData, Save(), PrintLevel(-1), SumW2Error(false))};
@@ -184,7 +184,7 @@ void rf614_binned_fit_problems()
184184
// initial model is not extremely off. Proving this mathematically is left
185185
// as an excercise to the reader.
186186

187-
// This counterterms can be enabled in RooFit if you use a binned
187+
// These counterterms can be enabled in RooFit if you use a binned
188188
// RooDataHist to do your fit and pass the Offset("bin") option to
189189
// RooAbsPdf::fitTo() or RooAbsPdf::createNLL().
190190

0 commit comments

Comments
 (0)