12 std::string base_filename = path.substr(path.find_last_of(
"/\\") + 1);
13 std::string::size_type
const p(base_filename.find_last_of(
'.'));
14 std::string file_without_extension = base_filename.substr(0,
p) + ext;
15 return file_without_extension;
20 while (gDirectory->FindObjectAny(Form(
"%s__%i",
prefix,
i))!=
nullptr) ++
i;
25 c->SetFillColor(kCyan);
26 c->SetFillStyle(1001);
33 "TextColor",kBlack,
"TextColorAlpha",kBlack, 1.,
"TextSize",22,
"TextFont",43,
34 "TextAlign",12,
"TextAngle",0., }})
38 tlatex.SetTextColorAlpha(dict(
"TextColorAlpha",1),dict(
"TextColorAlpha",2));
39 tlatex.SetTextAlign(dict(
"TextAlign"));
40 tlatex.SetTextSize (dict(
"TextSize"));
41 tlatex.SetTextFont (dict(
"TextFont"));
42 tlatex.SetTextAngle (dict(
"TextAngle"));
43 tlatex.DrawLatex(x, y, msg);
46 "LineColorAlpha",kBlack,1.0,
"LineStyle",1,
"LineWidth",1 }})
49 TLine*
line =
new TLine(x0,y0,x1,y1);
55 auto i0 = sub.length();
56 auto i1 = word.length();
57 if (i1 < i0)
return word;
58 return (word.substr(i1-i0,i0)==sub)
59 ? word.substr(0,i1-i0)
63 for (
auto sub : endings) {
69 auto i0 = sub.length();
70 auto i1 = word.length();
71 if (i0>i1)
return word;
72 word = (word.substr(0,i0) == sub)
73 ? word.substr(i0,i1-i0)
78 for (
auto pre : startings) {
86 case 9:
return "antipi";
88 case 12:
return "antiK";
90 case 15:
return "pbar";
93 case 1:
return "antipi";
95 case 3:
return "antiK";
97 case 5:
return "pbar";
114 case 8:
return "#pi";
115 case 9:
return "#pi^{-}";
117 case 12:
return "K^{-}";
119 case 15:
return "#bar{p}";
121 case 0:
return "#pi";
122 case 1:
return "#pi^{-}";
124 case 3:
return "K^{-}";
126 case 5:
return "#bar{p}";
138 norm_num = num->Integral();
139 norm_den = den->Integral();
141 if (dict[
"print"]) cout <<
" norms: " << norm_num <<
" and " << norm_den << endl;
144 if (dict[
"style-den"]) {
150 for (
int j=1;
j<den->GetNbinsX()+1;++
j){
151 double n = num->GetBinContent(
j) / norm_num;
152 double d = den->GetBinContent(
j) / norm_den;
153 if (n == 0 || d == 0) {
154 ret->SetBinContent(
j,0);
155 ret->SetBinError(
j,0);
159 double n_err = num->GetBinError(
j) / norm_num;
160 double d_err = den->GetBinError(
j) / norm_den;
162 double err = val * pow( pow(n_err/n,2)+pow(d_err/d,2),0.5);
163 ret->SetBinContent(
j,val);
164 ret->SetBinError(
j,err);
171 if (word.find(
".",1) != string::npos) word = word.substr(0,word.find(
".",1));
176 if (x.size() != y.size())
177 throw std::runtime_error(
"noiMakeTGraph(vec, vec) required vectors of same length");
178 const unsigned int n = x.size();
179 double* xpts =
new double[
n];
180 double* ypts =
new double[
n];
181 for (
unsigned int i{0};
i<
n; ++
i) {
185 return new TGraph(n,xpts,ypts);