26
26
// One should in principle be able to use
27
27
// pdf.generateBinned(x, nEvents, RooFit::ExpectedData()).
28
28
// 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.
30
30
std ::unique_ptr < RooDataHist > generateBinnedAsimov (RooAbsPdf const & pdf , RooRealVar & x , int nEvents )
31
31
{
32
32
auto dataH = std ::make_unique < RooDataHist > ("dataH ", " dataH ", RooArgSet{x});
@@ -82,14 +82,14 @@ void rf614_binned_fit_problems()
82
82
// result and the true parameters comes from binning effects.
83
83
std ::unique_ptr < RooAbsData > expoData {generateBinnedAsimov (expo , x , 10000 )};
84
84
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
86
86
// result. This is because the continuous, normalized pdf is evaluated only
87
87
// at the bin centers.
88
88
std ::unique_ptr < RooFitResult > fit1 {expo .fitTo (* expoData , Save (), PrintLevel (-1 ), SumW2Error (false))};
89
89
fit1 -> Print ();
90
90
91
91
// 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
93
93
// each bin. Here, we can do a trick to get rid of the bias: we also
94
94
// evaluate the normalization integral for the pdf the same way, i.e.,
95
95
// summing the values of the unnormalized pdf at the bin centers. Like this
@@ -103,7 +103,7 @@ void rf614_binned_fit_problems()
103
103
// Power law example
104
104
// -----------------
105
105
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].
107
107
RooRealVar a {"a" , "a" , -0.3 , -5.0 , 5.0 };
108
108
RooPower powerlaw {"powerlaw" , "powerlaw" , x , RooConst (1.0 ), a };
109
109
std ::unique_ptr < RooAbsData > powerlawData {generateBinnedAsimov (powerlaw , x , 10000 )};
@@ -116,8 +116,8 @@ void rf614_binned_fit_problems()
116
116
// trick by sampling the integral in the same way doesn't cancel out the
117
117
// bias completely. The average bias is canceled, but there are per-bin
118
118
// 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
121
121
// issue, this approach can be sufficient.
122
122
enableBinIntegrator (powerlaw , x .numBins ());
123
123
std ::unique_ptr < RooFitResult > fit4 {powerlaw .fitTo (* powerlawData , Save (), PrintLevel (-1 ), SumW2Error (false))};
@@ -184,7 +184,7 @@ void rf614_binned_fit_problems()
184
184
// initial model is not extremely off. Proving this mathematically is left
185
185
// as an excercise to the reader.
186
186
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
188
188
// RooDataHist to do your fit and pass the Offset("bin") option to
189
189
// RooAbsPdf::fitTo() or RooAbsPdf::createNLL().
190
190
0 commit comments