11 #include "BCMTFComparisonTool.h" 16 #include <TGraphAsymmErrors.h> 31 delete fHistogramContainer[i];
38 fNameContainer.push_back(name);
46 fHistogramContainer.push_back(h);
49 fCentralValueContainer.push_back(hist.GetMean());
52 fUncertaintyContainer.push_back(hist.GetRMS());
59 fNameContainer.push_back(name);
62 fHistogramContainer.push_back(NULL);
65 fCentralValueContainer.push_back(centralvalue);
68 fUncertaintyContainer.push_back(uncertainty);
79 for (
unsigned i = 0; i < fHistogramContainer.size(); ++i) {
81 TH1D* hist = fHistogramContainer.at(i);
84 hist->SetLineColor(2 + i);
89 std::cout <<
" here as well." << std::endl;
91 hist->Draw(
"SAMEHIST");
92 std::cout <<
" here as well 2." << std::endl;
97 c1.Print(filename.data());
107 TGraphAsymmErrors* graph_contributions =
new TGraphAsymmErrors(ncontributions);
108 fTrash.Put(graph_contributions);
109 graph_contributions->SetMarkerStyle(20);
110 graph_contributions->SetMarkerSize(1);
117 double ymax = double(ncontributions) - 0.5;
122 for (
int i = 0; i < ncontributions; ++i) {
125 double centralvalue = fCentralValueContainer.at(i);
126 double uncertainty = fUncertaintyContainer.at(i);
129 if ((centralvalue - uncertainty) < xmin || i == 0)
130 xmin = centralvalue - uncertainty;
131 if ((centralvalue + uncertainty) > xmax || i == 0)
132 xmax = centralvalue + uncertainty;
133 xwidth = xmax - xmin;
136 graph_contributions->SetPoint(i, centralvalue,
double(ncontributions - i - 1));
137 graph_contributions->SetPointError(i, uncertainty, uncertainty, 0, 0);
143 TH2D* hist_axes =
new TH2D(
"", Form(
";%s;",
GetSafeName().c_str()), 1, xmin - 0.25 * xwidth, xmax + 1.75 * xwidth, ncontributions, ymin, ymax);
144 fTrash.Put(hist_axes);
145 hist_axes->SetStats(kFALSE);
146 hist_axes->GetYaxis()->SetNdivisions(0);
147 hist_axes->GetYaxis()->SetTitleOffset(1.0);
150 TLatex* latex =
new TLatex();
152 latex->SetTextSize(0.04);
153 if (ncontributions >= 10)
154 latex->SetTextSize(0.02);
155 latex->SetTextAlign(12);
159 graph_contributions->Draw(
"SAMEPZ");
162 for (
int i = 0; i < ncontributions; ++i) {
163 latex->DrawLatex(xmax + 0.25 * xwidth,
double(ncontributions - i - 1), fNameContainer.at(i).c_str());
165 hist_axes->Draw(
"SAMEAXIS");
179 c1.Print(filename.data());
A guard object to prevent ROOT from taking over ownership of TNamed objects.