165 for (
size_t iy = 1; iy <=
nYmaxBins; ++iy) {
168 for (
int iM = 1; iM <=
nMjjBins; ++iM) {
171 Mjj = ((*
Mjj_edges)[iM-1] + (*Mjj_edges)[iM]) / 2;
172 int i =
genBinning->GetGlobalBinNumber(Mjj, Ymax);
174 BOOST_THROW_EXCEPTION( runtime_error(
"Mjj = "s + Mjj +
" and Ymax = "s + Ymax
175 +
" do not correspond to any bin index"s) );
179 bLeft = i-1, bCenter = i , bRight = i+1,
183 auto get = [&bias](
int i) {
184 double content = bias->GetBinContent(i);
186 BOOST_THROW_EXCEPTION(
DE::BadInput(
"Expecting only positive entries", bias) );
187 return content > 0 ? 1./content : 0;
189 double cUp = get(bUp ),
191 cRight = get(bRight),
194 cout << setw(3) << iy << setw(3) << iM
195 << setw(5) << bCenter << setw(15) << (cUp+cLeft+cRight+cDown)
196 << setw(5) << bUp << setw(15) << -cUp
197 << setw(5) << bLeft << setw(15) << -cLeft
198 << setw(5) << bRight << setw(15) << -cRight
199 << setw(5) << bDown << setw(15) << -cDown <<
'\n';
202 L->SetBinContent(i, bCenter, cUp+cLeft+cRight+cDown );
203 if (cUp > 0) L->SetBinContent(i, bUp , -cUp );
204 if (cLeft > 0) L->SetBinContent(i, bLeft , -cLeft );
205 if (cRight > 0) L->SetBinContent(i, bRight , -cRight );
206 if (cDown > 0) L->SetBinContent(i, bDown , -cDown );