27 , fFlagFillErrorBand(true)
28 , fFitFunctionIndexX(-1)
29 , fFitFunctionIndexY(-1)
30 , fErrorBandContinuous(true)
31 , fErrorBandX(std::vector<double>(0))
32 , fErrorBandNbinsX(100)
33 , fErrorBandNbinsY(500)
41 , fFlagFillErrorBand(true)
42 , fFitFunctionIndexX(-1)
43 , fFitFunctionIndexY(-1)
44 , fErrorBandContinuous(true)
45 , fErrorBandX(std::vector<double>(0))
46 , fErrorBandNbinsX(100)
47 , fErrorBandNbinsY(500)
116 std::vector<double> xvec;
136 for (
unsigned ix = 0; ix < ndatapoints; ++ix) {
141 std::vector<double> xvec;
161 std::vector<double> errorband;
167 errorband.assign(nx, 0.);
170 for (
int ix = 1; ix <= nx; ix++) {
171 TH1D * temphist =
fErrorBandXY->ProjectionY(
"temphist", ix, ix);
178 temphist->GetQuantiles(nprobSum, q, probSum);
180 errorband[ix - 1] = q[0];
195 TGraph * graph =
new TGraph(2 * nx);
196 graph->SetFillStyle(1001);
197 graph->SetFillColor(kYellow);
203 for (
int i = 0; i < nx; i++) {
204 graph->SetPoint(i,
fErrorBandXY->GetXaxis()->GetBinCenter(i + 1), ymin[i]);
205 graph->SetPoint(nx + i,
fErrorBandXY->GetXaxis()->GetBinCenter(nx - i), ymax[nx - i - 1]);
222 TString::Format(
"%s_sub_%f.2",
fErrorBandXY->GetName(), level));
223 hist_tempxy->Reset();
224 hist_tempxy->SetFillColor(kYellow);
227 for (
int ix = 1; ix < nx; ix++) {
230 TH1D * hproj =
fErrorBandXY->ProjectionY(
"temphist", ix, ix);
232 hproj->Smooth(nsmooth);
238 for (
int iy = 1; iy <= ny; ++iy)
239 hist_tempxy->SetBinContent(ix, iy, hist_temp_yellow->GetBinContent(iy));
241 delete hist_temp_yellow;
256 TGraph * graph =
new TGraph(nx);
259 for (
int i = 0; i < nx; i++) {
260 double x =
fErrorBandXY->GetXaxis()->GetBinCenter(i + 1);
262 std::vector<double> xvec;
267 graph->SetPoint(i, x, y);
277 TGraph * graph =
new TGraph(n + 1);
279 double dx = (xmax - xmin) / (
double) n;
282 for (
int i = 0; i <= n; i++) {
283 double x = (double) i * dx + xmin;
284 std::vector<double> xvec;
290 graph->SetPoint(i, x, y);
299 TFile * froot = TFile::Open(file);
300 if (!froot->IsOpen()) {
301 BCLog::OutError(Form(
"BCFitter::ReadErrorBandFromFile. Couldn't open file %s.", file));
307 TH2D * h2 = (TH2D*) froot->Get(
"errorbandxy");
316 Form(
"BCFitter::ReadErrorBandFromFile : Couldn't read histogram \"errorbandxy\" from file %s.",file));