11 #include "BCSummaryTool.h"
19 #include "BCParameter.h"
20 #include "BCSummaryPriorModel.h"
26 #include <TGraphAsymmErrors.h>
27 #include <TGraphErrors.h>
33 #include <TPostScript.h>
39 unsigned int BCSummaryTool::fHCounter=0;
45 , fFlagInfoMarg(false)
49 fSumProb.push_back(0.05);
50 fSumProb.push_back(0.10);
51 fSumProb.push_back(0.1587);
52 fSumProb.push_back(0.50);
53 fSumProb.push_back(0.8413);
54 fSumProb.push_back(0.90);
55 fSumProb.push_back(0.95);
58 gStyle->SetPaintTextFormat(
".2g");
65 , fFlagInfoMarg(false)
69 fSumProb.push_back(0.05);
70 fSumProb.push_back(0.10);
71 fSumProb.push_back(0.1587);
72 fSumProb.push_back(0.50);
73 fSumProb.push_back(0.8413);
74 fSumProb.push_back(0.90);
75 fSumProb.push_back(0.95);
78 gStyle->SetPaintTextFormat(
".2g");
107 for (
unsigned i = 0; i < fModel->GetNParameters(); ++i) {
110 fParName.push_back( (fModel->GetParameter(i)->GetLatexName()) );
111 fParMin.push_back( fModel->GetParameter(i)->GetLowerLimit() );
112 fParMax.push_back( fModel->GetParameter(i)->GetUpperLimit() );
115 BCH1D * bch1d_temp = fModel->GetMarginalized(i);
117 fFlagInfoMarg =
true;
118 fMean.push_back( bch1d_temp->
GetMean() );
119 fRMS.push_back( bch1d_temp->
GetRMS() );
120 fMargMode.push_back( bch1d_temp->
GetMode() );
121 for (
unsigned j = 0; j < fSumProb.size(); ++j)
122 fQuantiles.push_back( bch1d_temp->
GetQuantile( fSumProb.at(j) ) );
124 int nintervals = int(intervals.size() / 5);
125 fSmallInt.push_back(nintervals);
126 fSmallInt.insert( fSmallInt.end(), intervals.begin(), intervals.end() );
129 double tmpval = fModel->GetParameter(i)->GetUpperLimit() - fModel->GetParameter(i)->GetLowerLimit();
130 tmpval = fModel->GetParameter(i)->GetLowerLimit() - 2. * tmpval;
131 fMean.push_back( tmpval );
132 fRMS.push_back( tmpval );
133 fMargMode.push_back( tmpval );
134 for (
unsigned j = 0; j < fSumProb.size(); ++j)
135 fQuantiles.push_back( tmpval );
136 fSmallInt.push_back( 0 );
140 for (
unsigned j = 0; j < fModel->GetNParameters(); ++j) {
142 fCorrCoeff.push_back(1.);
144 BCH2D * bch2d_temp = fModel->GetMarginalized(i, j);
146 fFlagInfoMarg =
true;
147 fCorrCoeff.push_back( bch2d_temp->
GetHistogram()->GetCorrelationFactor() );
150 fCorrCoeff.push_back( 0. );
155 if ((fModel->GetBestFitParameters()).size() > 0) {
157 fGlobalMode.push_back ( (fModel->GetBestFitParameters()).at(i) );
173 int npar = fModel->GetNParameters();
174 int nquantiles = int( fSumProb.size() );
177 TH1D * hist_axes =
new TH1D(
178 TString::Format(
"hist_axes_par_%d",getNextIndex()),
179 ";;Scaled parameter range [a.u.]",npar, -0.5, npar-0.5);
180 hist_axes->SetStats(kFALSE);
181 for (
int i = 0; i < npar; ++i)
182 hist_axes->GetXaxis()->SetBinLabel( i+1, fParName.at(i).c_str() );
183 hist_axes->GetXaxis()->SetLabelOffset(0.015);
184 hist_axes->GetXaxis()->SetLabelSize(0.06);
185 hist_axes->GetXaxis()->SetTickLength(0.0);
186 hist_axes->GetYaxis()->SetRangeUser(-0.1, 1.1);
187 hist_axes->GetYaxis()->SetTickLength(0.0);
190 TGraphErrors * graph_quantiles =
new TGraphErrors(npar*nquantiles);
191 graph_quantiles->SetMarkerSize(0);
192 graph_quantiles->SetLineColor(38);
193 graph_quantiles->SetLineStyle(2);
195 TGraphErrors * graph_mean =
new TGraphErrors(npar);
196 graph_mean->SetMarkerColor(kBlack);
197 graph_mean->SetMarkerStyle(20);
199 TGraphErrors * graph_mode =
new TGraphErrors(npar);
200 graph_mode->SetMarkerColor(kRed);
201 graph_mode->SetMarkerStyle(20);
203 TGraphAsymmErrors * graph_intervals =
new TGraphAsymmErrors(0);
204 graph_intervals->SetFillColor(kYellow);
205 graph_intervals->SetLineStyle(2);
206 graph_intervals->SetLineColor(kRed);
207 graph_intervals->SetMarkerSize(0);
210 int indexintervals = 0;
214 for (
int i = 0; i < npar; ++i) {
215 for (
int j = 0; j < nquantiles; ++j) {
216 graph_quantiles->SetPoint(i*nquantiles+j,
double(i),
217 (fQuantiles.at(i*nquantiles+j) - fParMin.at(i))/(fParMax.at(i)-fParMin.at(i)));
218 graph_quantiles->SetPointError(i*nquantiles+j, 0.5, 0.0);
225 for (
int i = 0; i < npar; ++i) {
227 graph_mean->SetPoint(i,
double(i), (fMean.at(i) - fParMin.at(i))/(fParMax.at(i)-fParMin.at(i)));
228 graph_mean->SetPointError(i, 0.0, fRMS.at(i)/(fParMax.at(i)-fParMin.at(i)));
234 for (
int i = 0; i < npar; ++i)
235 graph_mode->SetPoint(i,
double(i), (fGlobalMode.at(i) - fParMin.at(i))/(fParMax.at(i)-fParMin.at(i)));
240 for (
int i = 0; i < npar; ++i) {
241 int nintervals = int(fSmallInt.at(indexintervals++));
242 for (
int j = 0; j < nintervals; ++j) {
243 double xmin = fSmallInt.at(indexintervals++);
244 double xmax = fSmallInt.at(indexintervals++);
246 double xlocalmaxpos = fSmallInt.at(indexintervals++);
248 int npoints = graph_intervals->GetN();
249 graph_intervals->SetPoint(npoints,
double(i),
250 (xlocalmaxpos - fParMin.at(i))/(fParMax.at(i)-fParMin.at(i)));
251 graph_intervals->SetPointError(npoints,0.5, 0.5,
252 (xlocalmaxpos - xmin)/(fParMax.at(i)-fParMin.at(i)),
253 (xmax - xlocalmaxpos)/(fParMax.at(i)-fParMin.at(i)));
259 TLegend * legend =
new TLegend(0.15, 0.88, 0.85, 0.99);
260 legend->SetBorderSize(0);
261 legend->SetFillColor(0);
264 TLatex * latex =
new TLatex();
265 latex->SetTextSize(0.02);
268 TLine * line_top =
new TLine(-0.5, 1.0, npar-0.5, 1.0);
269 line_top->SetLineColor(kBlack);
270 line_top->SetLineStyle(1);
271 line_top->SetLineWidth(2);
273 TLine * line_bot =
new TLine(-0.5, 0.0, npar-0.5, 0.0);
274 line_bot->SetLineColor(kBlack);
275 line_bot->SetLineStyle(1);
276 line_bot->SetLineWidth(2);
279 TCanvas * c_par =
new TCanvas(TString::Format(
"c_par_%d",getNextIndex()));
285 graph_intervals->DrawClone(
"SAME2");
286 for (
int i = 0; i < graph_intervals->GetN(); ++i)
287 graph_intervals->SetPointError(i, 0.5, 0.5, 0.0, 0.0);
288 graph_intervals->Draw(
"SAMEPZ");
289 graph_quantiles->Draw(
"SAMEPZ");
290 graph_mean->Draw(
"SAMEP");
291 legend->AddEntry(graph_quantiles,
"Quantiles (5%, 10%, 16%, 50%, 84%, 90%, 95%)",
"L");
292 legend->AddEntry(graph_mean,
"Mean and RMS",
"LEP");
293 legend->AddEntry(graph_intervals,
"Smallest 68% intervals and local modes",
"FL");
296 graph_mode->Draw(
"SAMEP");
297 legend->AddEntry(graph_mode,
"Global mode",
"P");
299 for (
int i = 0; i < npar;++i) {
302 latex->DrawLatex(
double(i)-0.1, 0.010-0.07, Form(
"%+3.3g", fParMin.at(i)));
303 latex->DrawLatex(
double(i)-0.1, 0.965+0.07, Form(
"%+3.3g", fParMax.at(i)));
306 latex->DrawLatex(0.9, 0.175,
"Par. min.");
307 latex->DrawLatex(0.9, 0.83,
"Par. max.");
308 legend->Draw(
"SAME");
310 c_par->Print(filename);
328 int npar = fModel->GetNParameters();
331 TH2D * hist_corr =
new TH2D(
332 TString::Format(
"hist_corr_%d",getNextIndex()),
333 ";;",npar, -0.5, npar-0.5,npar, -0.5, npar-0.5);
334 hist_corr->SetStats(kFALSE);
335 hist_corr->GetXaxis()->SetTickLength(0.0);
336 hist_corr->GetYaxis()->SetTickLength(0.0);
337 hist_corr->GetZaxis()->SetRangeUser(-1.0, 1.0);
339 for (
int i = 0; i < npar; ++i) {
340 hist_corr->GetXaxis()->SetLabelSize(0.06);
341 hist_corr->GetYaxis()->SetLabelSize(0.06);
343 hist_corr->GetXaxis()->SetBinLabel( i+1, fParName.at(i).c_str() );
344 hist_corr->GetYaxis()->SetBinLabel( npar-i, fParName.at(i).c_str() );
347 hist_corr->GetXaxis()->SetBinLabel( i+1, TString::Format(
"%d",i) );
348 hist_corr->GetYaxis()->SetBinLabel( npar-i, TString::Format(
"%d",i) );
353 for (
int i = 0; i < npar; ++i)
354 for (
int j = 0; j < npar; ++j) {
355 int index = i * npar + j;
356 double corr = fCorrCoeff.at(index);
357 hist_corr->SetBinContent(i+1, npar-j, corr);
361 TCanvas * c_corr =
new TCanvas(TString::Format(
"c_corr_matrix_%d",getNextIndex()));
363 hist_corr->Draw(
"colz text");
365 TF1 * f =
new TF1(
"fUp",
"x",-0.5,npar-0.5);
366 TGaxis * A1 =
new TGaxis(-0.5,npar-0.5,npar-0.5,npar-0.5,
"fUp",100,
"-");
367 A1->ImportAxisAttributes(hist_corr->GetXaxis());
372 hist_corr->GetXaxis()->SetLabelSize(0.);
373 hist_corr->Draw(
"colz text same");
375 for (
int i = 0; i < npar; ++i)
376 for (
int j = 0; j < npar; ++j) {
377 BCH2D * bch2d_temp = fModel->GetMarginalized(fModel->GetParameter(i),fModel->GetParameter(j));
378 if ( bch2d_temp || i==j )
381 TBox * bempty =
new TBox(
382 hist_corr->GetXaxis()->GetBinLowEdge(i+1),
383 hist_corr->GetYaxis()->GetBinLowEdge(npar-j),
384 hist_corr->GetXaxis()->GetBinLowEdge(i+2),
385 hist_corr->GetYaxis()->GetBinLowEdge(npar-j+1)
387 bempty->SetLineStyle(0);
388 bempty->SetLineWidth(0);
389 bempty->SetFillColor(kWhite);
394 TLine * lA1 =
new TLine(-0.5,npar-0.5,npar-0.5,npar-0.5);
396 TLine * lA2 =
new TLine(npar-0.5,npar-0.5,npar-0.5,-0.5);
400 c_corr->Print(filename);
417 int npar = fModel->GetNParameters();
419 TCanvas * c =
new TCanvas(TString::Format(
"c_corr_%d",getNextIndex()));
423 double padsize = (1. - 2.*margin) / (
double)npar;
426 TPad ** pad =
new TPad*[npar*npar];
429 double xlow, xup, ylow, yup;
430 double marginleft, marginright, margintop, marginbottom;
431 marginleft=marginright=margintop=marginbottom=0.01;
434 size_t maxlength = 0;
435 for (
int i = 0; i < npar ; ++i) {
436 maxlength = std::max(maxlength, fModel->GetParameter(i)->
GetName().length());
440 short xalignment = 22;
441 short yalignment = 22;
443 if (maxlength > 20) {
450 for (
int i=npar-1;i>=0;--i) {
451 xlow = (double)i*padsize + margin;
454 for (
int j=i;j<=npar-1;j++) {
455 yup = 1. - (double)j*padsize - margin;
460 pad[ipad]=
new TPad(TString::Format(
"pad_%d_%d",ipad,getNextIndex()),
"", xlow, ylow, xup, yup);
461 pad[ipad]->SetTopMargin(margintop);
462 pad[ipad]->SetBottomMargin(marginbottom);
463 pad[ipad]->SetLeftMargin(marginleft);
464 pad[ipad]->SetRightMargin(marginright);
465 pad[ipad]->SetFillColor(kWhite);
475 bh1 = fModel->GetMarginalized(fModel->GetParameter(i));
480 bh2 = fModel->GetMarginalized(fModel->GetParameter(i),fModel->GetParameter(j));
487 pad[ipad]->SetFillColor(kGray);
488 TBox * box =
new TBox(marginleft,marginbottom,1.-marginright,1.-margintop);
489 box->SetLineWidth(1);
490 box->SetLineColor(kGray+1);
491 box->SetFillColor(kWhite);
494 TText * text_na =
new TText(.5,.5,
"N/A");
495 text_na->SetTextFont(42);
496 text_na->SetTextAlign(22);
497 text_na->SetTextSize(.8/(
double)npar);
498 text_na->SetTextColor(kGray+1);
504 bh1->
Draw(
"BTsiB3CS1D0");
507 bh2->
Draw(
"BTfB3CS1nL");
510 hh->GetXaxis()->SetLabelOffset(5500);
511 hh->GetYaxis()->SetLabelOffset(5500);
512 hh->GetXaxis()->SetTitleSize(10.00);
513 hh->GetYaxis()->SetTitleSize(10.00);
519 double labelsize = .8/(double)npar/10.;
524 TLatex * label =
new TLatex();
525 label->SetTextFont(62);
526 label->SetTextSize(labelsize);
527 label->SetTextAlign(yalignment);
530 label->SetTextAngle(90 - rotation);
532 xtext = margin * (1. - 8. * labelsize);
533 ytext = yup - padsize / 2.;
535 label->DrawLatex(xtext,ytext,fModel->GetParameter(j)->GetLatexName().c_str());
540 TLatex * label =
new TLatex();
541 label->SetTextFont(62);
542 label->SetTextSize(labelsize);
543 label->SetTextAlign(xalignment);
546 label->SetTextAngle(360 - rotation);
548 xtext = xlow + padsize / 2.;
549 ytext = margin * (1. - 6. * labelsize);
551 label->DrawLatex(xtext,ytext, fModel->GetParameter(i)->GetLatexName().c_str());
569 TCanvas * c =
new TCanvas();
586 bool flag_slice_post =
false;
587 bool flag_slice_prior =
false;
590 if (options_post.find(
"slice") < options_post.size()) {
591 flag_slice_post =
true;
593 if (options_prior.find(
"slice") < options_prior.size()) {
594 flag_slice_prior =
true;
598 TLegend* legend =
new TLegend();
599 legend->SetBorderSize(0);
600 legend->SetFillColor(kWhite);
601 legend->SetTextAlign(12);
602 legend->SetTextFont(62);
603 legend->SetTextSize(0.03);
606 const BCParameter * par = fModel->GetParameter(index);
607 BCH1D* hist_prior = fPriorModel->GetMarginalized(par);
608 BCH1D* hist_posterior = 0;
610 if (flag_slice_prior && fPriorModel->GetNParameters()==2) {
612 TH1D* hist = fPriorModel->GetSlice(fPriorModel->GetParameter(0),fPriorModel->GetParameter(1))->GetHistogram()->ProjectionX(Form(
"projx_%i",
BCLog::GetHIndex()));
613 hist->Scale(1.0/hist->Integral(
"width"));
614 for (
int i = 1; i <= hist_prior->
GetHistogram()->GetNbinsX(); ++i)
615 hist_prior->
GetHistogram()->SetBinContent(i, hist->GetBinContent(i));
618 TH1D* hist = fPriorModel->GetSlice(fPriorModel->GetParameter(0),fPriorModel->GetParameter(1))->GetHistogram()->ProjectionY(Form(
"projy_%i",
BCLog::GetHIndex()));
619 hist->Scale(1.0/hist->Integral(
"width"));
620 for (
int i = 1; i <= hist_prior->
GetHistogram()->GetNbinsX(); ++i)
621 hist_prior->
GetHistogram()->SetBinContent(i, hist->GetBinContent(i));
625 else if (flag_slice_prior && fPriorModel->GetNParameters()==1) {
626 hist_prior = fPriorModel->GetSlice(par);
635 hist_posterior = fModel->GetMarginalized(par);
636 if (flag_slice_post && fModel->GetNParameters()==2) {
638 TH1D* hist = fModel->GetSlice(fModel->GetParameter(0),fModel->GetParameter(1))->GetHistogram()->ProjectionX(Form(
"projx_%i",
BCLog::GetHIndex()));
639 hist->Scale(1.0/hist->Integral(
"width"));
640 for (
int i = 1; i <= hist_posterior->
GetHistogram()->GetNbinsX(); ++i)
641 hist_posterior->
GetHistogram()->SetBinContent(i, hist->GetBinContent(i));
644 TH1D* hist = fModel->GetSlice(fModel->GetParameter(0),fModel->GetParameter(1))->GetHistogram()->ProjectionY(Form(
"projy_%i",
BCLog::GetHIndex()));
645 hist->Scale(1.0/hist->Integral(
"width"));
646 for (
int i = 1; i <= hist_posterior->
GetHistogram()->GetNbinsX(); ++i)
647 hist_posterior->
GetHistogram()->SetBinContent(i, hist->GetBinContent(i));
651 else if (flag_slice_post && fModel->GetNParameters()==1) {
652 hist_posterior = fModel->GetSlice(par);
657 if ( !hist_posterior)
660 legend->AddEntry(hist_prior->
GetHistogram(),
"prior",
"L");
661 legend->AddEntry(hist_posterior->
GetHistogram(),
"posterior",
"L");
668 double max_prior = hist_prior->
GetHistogram()->GetMaximum();
669 double max_posterior = hist_posterior->
GetHistogram()->GetMaximum();
670 double maxy = 1.1 * TMath::Max(max_prior, max_posterior);
672 double height = 0.03*legend->GetNRows();
675 hist_prior->
GetHistogram()->GetXaxis()->SetNdivisions(508);
676 hist_posterior->
GetHistogram()->GetXaxis()->SetNdivisions(508);
678 hist_prior->
Draw(options_prior);
679 hist_posterior->
Draw(std::string(options_post+
"same").c_str());
682 hist_prior->
GetHistogram()->GetYaxis()->SetRangeUser(0.0, maxy);
683 hist_posterior->
GetHistogram()->GetYaxis()->SetRangeUser(0.0, maxy);
685 gPad->SetTopMargin(0.02);
686 double xlegend1 = gPad->GetLeftMargin() + 0.10 * (1.0 - gPad->GetRightMargin() - gPad->GetLeftMargin());
687 double xlegend2 = 1.0-gPad->GetRightMargin();
688 double ylegend1 = 1.-gPad->GetTopMargin()-height;
689 double ylegend2 = 1.-gPad->GetTopMargin();
692 legend->SetX1NDC(xlegend1);
693 legend->SetX2NDC(xlegend2);
694 legend->SetY1NDC(ylegend1);
695 legend->SetY2NDC(ylegend2);
701 gPad->SetTopMargin(1.-ylegend1+0.01);
715 bool flag_slice =
false;
718 if (options.find(
"slice") < options.size()) {
722 std::string file(filename);
725 if ( (file.find_last_of(
".") != std::string::npos) &&
726 (file.substr(file.find_last_of(
".")+1) ==
"pdf") ) {
730 else if ( (file.find_last_of(
".") != std::string::npos) &&
731 (file.substr(file.find_last_of(
".")+1) ==
"ps") ) {
740 TCanvas * c =
new TCanvas(TString::Format(
"c_%d",getNextIndex()));
744 int npar = fModel->GetNParameters();
745 c->Print(std::string(file +
"[").c_str());
746 for (
int i = 0; i < npar; ++i) {
749 c->Print(file.c_str());
753 TLegend * legend2d =
new TLegend();
754 legend2d->SetBorderSize(0);
755 legend2d->SetFillColor(0);
756 legend2d->SetTextAlign(12);
757 legend2d->SetTextFont(62);
758 legend2d->SetTextSize(0.03);
761 TMarker * marker_prior =
new TMarker();
762 marker_prior->SetMarkerStyle(24);
763 marker_prior->SetMarkerColor(kRed);
765 TMarker * marker_posterior =
new TMarker();
766 marker_posterior->SetMarkerStyle(24);
767 marker_posterior->SetMarkerColor(kBlack);
769 TArrow * arrow =
new TArrow();
770 arrow->SetArrowSize(0.02);
771 arrow->SetLineColor(kBlue);
775 for (
int i = 0; i < npar; ++i) {
776 for (
int j = 0; j < i; ++j) {
780 const BCParameter * par1 = fModel->GetParameter(i);
781 const BCParameter * par2 = fModel->GetParameter(j);
784 BCH2D* bch2d_2dprior = 0;
785 BCH2D* bch2d_2dposterior = 0;
786 if (flag_slice && npar == 2) {
787 bch2d_2dprior = fPriorModel->GetSlice(par2, par1);
788 bch2d_2dposterior = fModel->GetSlice(par2, par1);
791 bch2d_2dprior = fPriorModel->GetMarginalized(par1, par2);
792 bch2d_2dposterior = fModel->GetMarginalized(par1, par2);
796 if ( !bch2d_2dprior || !bch2d_2dposterior)
801 hist_2dprior->SetLineColor(kRed);
802 TH2D* hist_2dposterior = bch2d_2dposterior->
GetHistogram();
805 hist_2dprior->Scale(1.0/hist_2dprior->Integral(
"width"));
806 hist_2dposterior->Scale(1.0/hist_2dposterior->Integral(
"width"));
812 double level[1] = {bch2d_2dprior->
GetLevel(0.32)};
813 hist_2dprior->SetContour(1, level);
814 hist_2dprior->Draw(
"CONT3");
815 level[0] = bch2d_2dposterior->
GetLevel(0.32);
816 hist_2dposterior->SetContour(1, level);
817 hist_2dposterior->Draw(
"CONT3 SAME");
819 std::vector<double> mode_prior = fPriorModel->GetBestFitParameters();
820 std::vector<double> mode_posterior = fModel->GetBestFitParameters();
822 marker_prior->DrawMarker(mode_prior.at(j), mode_prior.at(i));
823 marker_posterior->DrawMarker(mode_posterior.at(j), mode_posterior.at(i));
824 arrow->DrawArrow(mode_prior.at(j), mode_prior.at(i), mode_posterior.at(j), mode_posterior.at(i));
826 if (i==1 && j == 0) {
827 legend2d->AddEntry(hist_2dprior,
"smallest 68% interval(s) of prior",
"L");
828 legend2d->AddEntry(hist_2dposterior,
"smallest 68% interval(s) of posterior",
"L");
829 legend2d->AddEntry(marker_prior,
"prior mode",
"P");
830 legend2d->AddEntry(marker_posterior,
"posterior mode",
"P");
831 legend2d->AddEntry(arrow,
"change in mode",
"L");
833 gPad->SetTopMargin(0.02);
835 double height = 0.03*legend2d->GetNRows();
837 double xlegend1 = gPad->GetLeftMargin();
838 double xlegend2 = 1.0-gPad->GetRightMargin();
839 double ylegend1 = 1.-gPad->GetTopMargin()-height;
840 double ylegend2 = 1.-gPad->GetTopMargin();
843 legend2d->SetX1NDC(xlegend1);
844 legend2d->SetX2NDC(xlegend2);
845 legend2d->SetY1NDC(ylegend1);
846 legend2d->SetY2NDC(ylegend2);
850 gPad->SetTopMargin(1.-ylegend1+0.01);
853 c->Print(file.c_str());
858 c->Print(std::string(file +
"]").c_str());
864 delete marker_posterior;
876 std::ofstream ofi(filename);
881 std::cerr <<
"Couldn't open file " << filename <<std::endl;
886 int npar = fModel->GetNParameters();
890 <<
"\\documentclass[11pt, a4paper]{article}" << std::endl
892 <<
"\\begin{document}" << std::endl
894 <<
"\\begin{table}[ht!]" << std::endl
895 <<
"\\begin{center}" << std::endl
896 <<
"\\begin{tabular}{llllllll}" << std::endl
897 <<
"\\hline" << std::endl
898 <<
"Parameter & Mean & RMS & Gl. mode & Mode & Median & 16\\% quant. & 84\\% quant. \\\\" << std::endl
899 <<
"\\hline" << std::endl;
901 for (
int i = 0; i < npar; ++i) {
903 BCH1D * bch1d = fModel->GetMarginalized(par);
907 << bch1d->
GetRMS() <<
" & "
908 << fModel->GetBestFitParameters().at(i) <<
" & "
912 << bch1d->
GetQuantile(0.84) <<
" \\\\" << std::endl;
915 <<
"\\hline" << std::endl
916 <<
"\\end{tabular}" << std::endl
917 <<
"\\caption{Summary of the parameter estimates.}" << std::endl
918 <<
"\\end{center}" << std::endl
919 <<
"\\end{table}" << std::endl
921 <<
"\\end{document}" << std::endl;
942 fPriorModel->MarginalizeAll();
945 fPriorModel->FindMode( fPriorModel->GetBestFitParameters() );
A helper class for the BCSummaryTool.
void Draw(std::string options="BTfB3CS1meangmodelmode", std::vector< double > intervals=std::vector< double >(0))
The base class for all user-defined models.
A class for handling 2D distributions.
double GetLevel(double p)
void SetModel(BCModel *model)
A class representing a parameter of a model.
A class for handling 1D distributions.
std::vector< double > GetSmallestIntervals(double content=0.68)
double GetQuantile(double probablity)
const std::string & GetName() const
void CalculateIntegratedHistogram()
const std::string & GetName() const
void Draw(std::string options="BTsiB3CS1D0Lmeanmode", std::vector< double > intervals=std::vector< double >(0))