3 #include "TEfficiency.h"
5 #include "TGraphErrors.h"
13 #include "TRatioPlot.h"
73 float excess = 0.92 - (x_trial + x_width);
74 float x_new = x_trial;
77 std::cout <<
"smart_legend_x(): x width overshoots range - shifting by " << excess << std::endl;
78 x_new = x_trial + excess;
87 float excess = 0.92 - (y_trial + y_height);
88 float y_new = y_trial;
91 std::cout <<
"smart_legend_y(): y height overshoots range - shifting by " << excess << std::endl;
92 y_new = y_trial + excess;
99 inline TLegend*
smart_legend(std::string where =
"upper right",
float legend_width = 0.30,
float legend_height = 0.10)
101 TLegend* legend =
nullptr;
103 float legend_x = 0.65;
104 float legend_y = 0.85;
106 if (where ==
"upper right") {
109 }
else if (where ==
"center right") {
112 }
else if (where ==
"lower right") {
115 }
else if (where ==
"upper left") {
118 }
else if (where ==
"center left") {
121 }
else if (where ==
"lower left") {
125 std::cout <<
"You specified a placement of " << where <<
" that is unknown..." << std::endl;
129 legend =
new TLegend(legend_x, legend_y, legend_x + legend_width, legend_y + legend_height);
130 legend->SetFillStyle(0);
131 legend->SetBorderSize(0);
138 hist->SetAxisRange(min, max, which.c_str());
139 std::cout <<
"set_axis_range: setting " << which <<
" axis range to: [" << min <<
", " << max <<
"]" << std::endl;
141 hist->GetXaxis()->SetLimits(min, max);
142 hist->GetXaxis()->SetRangeUser(min, max);
143 }
else if (which ==
"Y") {
144 hist->GetYaxis()->SetLimits(min, max);
145 hist->GetYaxis()->SetRangeUser(min, max);
155 }
else if (which ==
"charm") {
156 object->SetLineColor(kBlue+1);
157 object->SetMarkerColor(kBlue+1);
158 object->SetMarkerStyle(kOpenDiamond);
159 }
else if (which ==
"light") {
160 object->SetLineColor(kRed+1);
161 object->SetMarkerColor(kRed+1);
162 object->SetMarkerStyle(kFullCircle);
163 }
else if (which ==
"errorband") {
167 object->SetLineWidth(2);
168 object->SetMarkerSize(2);
175 inline TLatex
make_title(TString text =
"CC-DIS, 10GeVx275GeV, Q^{2}>100 GeV^{2}") {
178 plot_title.SetTextSize(0.035);
179 plot_title.SetTextAlign(22);
180 plot_title.DrawLatexNDC(0.55, 0.97, text.Data());
186 inline std::vector<std::string>
fileVector(
const std::string& pattern){
188 glob(pattern.c_str(),GLOB_TILDE,NULL,&glob_result);
189 std::vector<std::string>
files;
190 for(
unsigned int i=0;i<glob_result.gl_pathc;++i){
191 files.push_back(std::string(glob_result.gl_pathv[i]));
193 globfree(&glob_result);
201 if (samplename.Contains(
"CC") && samplename.Contains(
"DIS")) {
203 xsection = 1.47637e-08*
u_mb;
204 }
else if (samplename.Contains(
"NC") && samplename.Contains(
"DIS")) {
206 xsection = 7.444e-06*
u_mb;
221 data->Project(plot->GetName(), x.Data(), selection);
223 plot->SetLineColor(draw_config.
linecolor);
224 plot->SetLineStyle(draw_config.
linestyle);
226 plot->SetFillStyle(draw_config.
fillstyle);
227 plot->SetFillColor(draw_config.
fillcolor);
232 plot->SetXTitle( draw_config.
xtitle );
233 plot->SetYTitle( draw_config.
ytitle );