1 #ifndef PhysicsTools_Utilities_rootPlot_h 2 #define PhysicsTools_Utilities_rootPlot_h 20 Color_t lineColor0 = kRed,
21 Width_t lineWidth0 = 1,
22 Style_t lineStyle0 = kDashed,
24 Color_t lineColor1 = kGreen,
25 Width_t lineWidth1 = 1,
26 Style_t lineStyle1 = kDashed,
28 const char*
title =
"Histo Title",
29 const char* xTitle =
"X Title",
30 const char* yTitle =
"Y Title") {
31 fun0.SetLineColor(lineColor0);
32 fun0.SetLineWidth(lineWidth0);
33 fun0.SetLineStyle(lineStyle0);
35 fun1.SetLineColor(lineColor1);
36 fun1.SetLineWidth(lineWidth1);
37 fun1.SetLineStyle(lineStyle1);
39 TCanvas*
canvas =
new TCanvas(
"canvas");
41 histo.SetXTitle(xTitle);
42 histo.SetYTitle(yTitle);
50 canvas->SaveAs(logPlotName.c_str());
62 const char*
title =
"Histo Title",
63 const char* xTitle =
"X Title",
64 const char* yTitle =
"Y Title") {
69 TCanvas*
canvas =
new TCanvas(
"canvas");
71 histo.SetXTitle(xTitle);
72 histo.SetYTitle(yTitle);
79 canvas->SaveAs(logPlotName.c_str());
92 const char*
title =
"Histo Title",
93 const char* xTitle =
"X Title",
94 const char* yTitle =
"Y Title") {
96 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
110 const char*
title =
"Histo Title",
111 const char* xTitle =
"X Title",
112 const char* yTitle =
"Y Title") {
114 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
117 template <
typename F>
129 const char*
title =
"Histo Title",
130 const char* xTitle =
"X Title",
131 const char* yTitle =
"Y Title") {
133 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
136 template <
typename F>
149 const char*
title =
"Histo Title",
150 const char* xTitle =
"X Title",
151 const char* yTitle =
"Y Title") {
153 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
156 template <
typename F>
170 const char*
title =
"Histo Title",
171 const char* xTitle =
"X Title",
172 const char* yTitle =
"Y Title") {
174 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
177 template <
typename F>
192 const char*
title =
"Histo Title",
193 const char* xTitle =
"X Title",
194 const char* yTitle =
"Y Title") {
196 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
199 template <
typename F>
215 const char*
title =
"Histo Title",
216 const char* xTitle =
"X Title",
217 const char* yTitle =
"Y Title") {
219 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
222 template <
typename F>
239 const char*
title =
"Histo Title",
240 const char* xTitle =
"X Title",
241 const char* yTitle =
"Y Title") {
242 TF1 fun =
root::tf1(
"fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6);
243 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
246 template <
typename F>
264 const char*
title =
"Histo Title",
265 const char* xTitle =
"X Title",
266 const char* yTitle =
"Y Title") {
267 TF1 fun =
root::tf1(
"fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7);
268 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
271 template <
typename F>
290 const char*
title =
"Histo Title",
291 const char* xTitle =
"X Title",
292 const char* yTitle =
"Y Title") {
293 TF1 fun =
root::tf1(
"fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7, p8);
294 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
297 template <
typename F>
317 const char*
title =
"Histo Title",
318 const char* xTitle =
"X Title",
319 const char* yTitle =
"Y Title") {
320 TF1 fun =
root::tf1(
"fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7, p8, p9);
321 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
324 template <
typename F>
345 const char*
title =
"Histo Title",
346 const char* xTitle =
"X Title",
347 const char* yTitle =
"Y Title") {
348 TF1 fun =
root::tf1(
"fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7, p8, p9, p10);
349 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
352 template <
typename F>
374 const char*
title =
"Histo Title",
375 const char* xTitle =
"X Title",
376 const char* yTitle =
"Y Title") {
377 TF1 fun =
root::tf1(
"fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7, p8, p9, p10, p11);
378 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
381 template <
typename F>
404 const char*
title =
"Histo Title",
405 const char* xTitle =
"X Title",
406 const char* yTitle =
"Y Title") {
407 TF1 fun =
root::tf1(
"fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7, p8, p9, p10, p11, p12);
408 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
411 template <
typename F>
435 const char*
title =
"Histo Title",
436 const char* xTitle =
"X Title",
437 const char* yTitle =
"Y Title") {
438 TF1 fun =
root::tf1(
"fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13);
439 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
442 template <
typename F>
467 const char*
title =
"Histo Title",
468 const char* xTitle =
"X Title",
469 const char* yTitle =
"Y Title") {
470 TF1 fun =
root::tf1(
"fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14);
471 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
474 template <
typename F>
500 const char*
title =
"Histo Title",
501 const char* xTitle =
"X Title",
502 const char* yTitle =
"Y Title") {
503 TF1 fun =
root::tf1(
"fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15);
504 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
507 template <
typename F>
534 const char*
title =
"Histo Title",
535 const char* xTitle =
"X Title",
536 const char* yTitle =
"Y Title") {
537 TF1 fun =
root::tf1(
"fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16);
538 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
541 template <
typename F>
569 const char*
title =
"Histo Title",
570 const char* xTitle =
"X Title",
571 const char* yTitle =
"Y Title") {
573 root::tf1(
"fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17);
574 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
577 template <
typename F>
606 const char*
title =
"Histo Title",
607 const char* xTitle =
"X Title",
608 const char* yTitle =
"Y Title") {
610 "fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18);
611 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
614 template <
typename F>
644 const char*
title =
"Histo Title",
645 const char* xTitle =
"X Title",
646 const char* yTitle =
"Y Title") {
648 "fun",
f,
min,
max, p0,
p1,
p2,
p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19);
649 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
652 template <
typename F>
658 const std::vector<funct::Parameter>&
p,
663 const char*
title =
"Histo Title",
664 const char* xTitle =
"X Title",
665 const char* yTitle =
"Y Title") {
667 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
670 template <
typename F>
681 const char*
title =
"Histo Title",
682 const char* xTitle =
"X Title",
683 const char* yTitle =
"Y Title") {
685 plotTF1(
name, fun,
histo,
min,
max,
lineColor,
lineWidth,
lineStyle, npx,
title, xTitle, yTitle);
void plot(const char *name, TH1 &histo, F &f, double min, double max, Color_t lineColor=kRed, Width_t lineWidth=1, Style_t lineStyle=kDashed, Int_t npx=1000, const char *title="Histo Title", const char *xTitle="X Title", const char *yTitle="Y Title")
TF1 tf1(const char *name, F &f, double min, double max)
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
void plotTF1(const char *name, TF1 &fun0, TF1 &fun1, TH1 &histo, double min, double max, Color_t lineColor0=kRed, Width_t lineWidth0=1, Style_t lineStyle0=kDashed, Int_t npx0=1000, Color_t lineColor1=kGreen, Width_t lineWidth1=1, Style_t lineStyle1=kDashed, Int_t npx1=1000, const char *title="Histo Title", const char *xTitle="X Title", const char *yTitle="Y Title")