00001 #ifndef PhysicsTools_Utilities_rootPlot_h 00002 #define PhysicsTools_Utilities_rootPlot_h 00003 #include "PhysicsTools/Utilities/interface/rootTf1.h" 00004 #include "TF1.h" 00005 #include "TH1.h" 00006 #include "TCanvas.h" 00007 #include "PhysicsTools/Utilities/interface/Parameter.h" 00008 00009 namespace root { 00010 namespace helper { 00011 struct PlotNoArg { }; 00012 } 00013 00014 inline void plotTF1(const char * name, TF1 & fun0, TF1 & fun1, TH1 & histo, 00015 double min, double max, 00016 Color_t lineColor0 = kRed, Width_t lineWidth0 = 1, 00017 Style_t lineStyle0 = kDashed, Int_t npx0 = 1000, 00018 Color_t lineColor1 = kGreen, Width_t lineWidth1 = 1, 00019 Style_t lineStyle1 = kDashed, Int_t npx1 = 1000, 00020 const char * title = "Histo Title", const char * xTitle = "X Title", 00021 const char * yTitle = "Y Title") { 00022 fun0.SetLineColor(lineColor0); 00023 fun0.SetLineWidth(lineWidth0); 00024 fun0.SetLineStyle(lineStyle0); 00025 fun0.SetNpx(npx0); 00026 fun1.SetLineColor(lineColor1); 00027 fun1.SetLineWidth(lineWidth1); 00028 fun1.SetLineStyle(lineStyle1); 00029 fun1.SetNpx(npx1); 00030 TCanvas *canvas = new TCanvas("canvas"); 00031 histo.SetTitle(title); 00032 histo.SetXTitle(xTitle); 00033 histo.SetYTitle(yTitle); 00034 histo.Draw("e"); 00035 fun0.Draw("same"); 00036 fun1.Draw("same"); 00037 std::string plotName = name; 00038 canvas->SaveAs(plotName.c_str()); 00039 canvas->SetLogy(); 00040 std::string logPlotName = "log_" + plotName; 00041 canvas->SaveAs(logPlotName.c_str()); 00042 } 00043 00044 inline void plotTF1(const char * name, TF1 & fun, TH1 & histo, 00045 double min, double max, 00046 Color_t lineColor = kRed, Width_t lineWidth = 1, 00047 Style_t lineStyle = kDashed, Int_t npx = 1000, 00048 const char * title = "Histo Title", const char * xTitle = "X Title", 00049 const char * yTitle = "Y Title") { 00050 fun.SetLineColor(lineColor); 00051 fun.SetLineWidth(lineWidth); 00052 fun.SetLineStyle(lineStyle); 00053 fun.SetNpx(npx); 00054 TCanvas *canvas = new TCanvas("canvas"); 00055 histo.SetTitle(title); 00056 histo.SetXTitle(xTitle); 00057 histo.SetYTitle(yTitle); 00058 histo.Draw("e"); 00059 fun.Draw("same"); 00060 std::string plotName = name; 00061 canvas->SaveAs(plotName.c_str()); 00062 canvas->SetLogy(); 00063 std::string logPlotName = "log_" + plotName; 00064 canvas->SaveAs(logPlotName.c_str()); 00065 } 00066 00067 template<typename F> 00068 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00069 Color_t lineColor = kRed, Width_t lineWidth = 1, 00070 Style_t lineStyle = kDashed, Int_t npx = 1000, 00071 const char * title = "Histo Title", const char * xTitle = "X Title", 00072 const char * yTitle = "Y Title") { 00073 TF1 fun = root::tf1("fun", f, min, max); 00074 plotTF1(name, fun, histo, min, max, 00075 lineColor, lineWidth, lineStyle, npx, 00076 title, xTitle, yTitle); 00077 } 00078 00079 template<typename F> 00080 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00081 const funct::Parameter & p0, 00082 Color_t lineColor = kRed, Width_t lineWidth = 1, 00083 Style_t lineStyle = kDashed, Int_t npx = 1000, 00084 const char * title = "Histo Title", const char * xTitle = "X Title", 00085 const char * yTitle = "Y Title") { 00086 TF1 fun = root::tf1("fun", f, min, max, p0); 00087 plotTF1(name, fun, histo, min, max, 00088 lineColor, lineWidth, lineStyle, npx, 00089 title, xTitle, yTitle); 00090 } 00091 00092 template<typename F> 00093 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00094 const funct::Parameter & p0, 00095 const funct::Parameter & p1, 00096 Color_t lineColor = kRed, Width_t lineWidth = 1, 00097 Style_t lineStyle = kDashed, Int_t npx = 1000, 00098 const char * title = "Histo Title", const char * xTitle = "X Title", 00099 const char * yTitle = "Y Title") { 00100 TF1 fun = root::tf1("fun", f, min, max, p0, p1); 00101 plotTF1(name, fun, histo, min, max, 00102 lineColor, lineWidth, lineStyle, npx, 00103 title, xTitle, yTitle); 00104 } 00105 00106 template<typename F> 00107 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00108 const funct::Parameter & p0, 00109 const funct::Parameter & p1, 00110 const funct::Parameter & p2, 00111 Color_t lineColor = kRed, Width_t lineWidth = 1, 00112 Style_t lineStyle = kDashed, Int_t npx = 1000, 00113 const char * title = "Histo Title", const char * xTitle = "X Title", 00114 const char * yTitle = "Y Title") { 00115 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2); 00116 plotTF1(name, fun, histo, min, max, 00117 lineColor, lineWidth, lineStyle, npx, 00118 title, xTitle, yTitle); 00119 } 00120 00121 template<typename F> 00122 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00123 const funct::Parameter & p0, 00124 const funct::Parameter & p1, 00125 const funct::Parameter & p2, 00126 const funct::Parameter & p3, 00127 Color_t lineColor = kRed, Width_t lineWidth = 1, 00128 Style_t lineStyle = kDashed, Int_t npx = 1000, 00129 const char * title = "Histo Title", const char * xTitle = "X Title", 00130 const char * yTitle = "Y Title") { 00131 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3); 00132 plotTF1(name, fun, histo, min, max, 00133 lineColor, lineWidth, lineStyle, npx, 00134 title, xTitle, yTitle); 00135 } 00136 00137 template<typename F> 00138 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00139 const funct::Parameter & p0, 00140 const funct::Parameter & p1, 00141 const funct::Parameter & p2, 00142 const funct::Parameter & p3, 00143 const funct::Parameter & p4, 00144 Color_t lineColor = kRed, Width_t lineWidth = 1, 00145 Style_t lineStyle = kDashed, Int_t npx = 1000, 00146 const char * title = "Histo Title", const char * xTitle = "X Title", 00147 const char * yTitle = "Y Title") { 00148 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4); 00149 plotTF1(name, fun, histo, min, max, 00150 lineColor, lineWidth, lineStyle, npx, 00151 title, xTitle, yTitle); 00152 } 00153 00154 template<typename F> 00155 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00156 const funct::Parameter & p0, 00157 const funct::Parameter & p1, 00158 const funct::Parameter & p2, 00159 const funct::Parameter & p3, 00160 const funct::Parameter & p4, 00161 const funct::Parameter & p5, 00162 Color_t lineColor = kRed, Width_t lineWidth = 1, 00163 Style_t lineStyle = kDashed, Int_t npx = 1000, 00164 const char * title = "Histo Title", const char * xTitle = "X Title", 00165 const char * yTitle = "Y Title") { 00166 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5); 00167 plotTF1(name, fun, histo, min, max, 00168 lineColor, lineWidth, lineStyle, npx, 00169 title, xTitle, yTitle); 00170 } 00171 00172 template<typename F> 00173 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00174 const funct::Parameter & p0, 00175 const funct::Parameter & p1, 00176 const funct::Parameter & p2, 00177 const funct::Parameter & p3, 00178 const funct::Parameter & p4, 00179 const funct::Parameter & p5, 00180 const funct::Parameter & p6, 00181 Color_t lineColor = kRed, Width_t lineWidth = 1, 00182 Style_t lineStyle = kDashed, Int_t npx = 1000, 00183 const char * title = "Histo Title", const char * xTitle = "X Title", 00184 const char * yTitle = "Y Title") { 00185 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6); 00186 plotTF1(name, fun, histo, min, max, 00187 lineColor, lineWidth, lineStyle, npx, 00188 title, xTitle, yTitle); 00189 } 00190 00191 template<typename F> 00192 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00193 const funct::Parameter & p0, 00194 const funct::Parameter & p1, 00195 const funct::Parameter & p2, 00196 const funct::Parameter & p3, 00197 const funct::Parameter & p4, 00198 const funct::Parameter & p5, 00199 const funct::Parameter & p6, 00200 const funct::Parameter & p7, 00201 Color_t lineColor = kRed, Width_t lineWidth = 1, 00202 Style_t lineStyle = kDashed, Int_t npx = 1000, 00203 const char * title = "Histo Title", const char * xTitle = "X Title", 00204 const char * yTitle = "Y Title") { 00205 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7); 00206 plotTF1(name, fun, histo, min, max, 00207 lineColor, lineWidth, lineStyle, npx, 00208 title, xTitle, yTitle); 00209 } 00210 00211 template<typename F> 00212 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00213 const funct::Parameter & p0, 00214 const funct::Parameter & p1, 00215 const funct::Parameter & p2, 00216 const funct::Parameter & p3, 00217 const funct::Parameter & p4, 00218 const funct::Parameter & p5, 00219 const funct::Parameter & p6, 00220 const funct::Parameter & p7, 00221 const funct::Parameter & p8, 00222 Color_t lineColor = kRed, Width_t lineWidth = 1, 00223 Style_t lineStyle = kDashed, Int_t npx = 1000, 00224 const char * title = "Histo Title", const char * xTitle = "X Title", 00225 const char * yTitle = "Y Title") { 00226 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7, p8); 00227 plotTF1(name, fun, histo, min, max, 00228 lineColor, lineWidth, lineStyle, npx, 00229 title, xTitle, yTitle); 00230 } 00231 00232 template<typename F> 00233 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00234 const funct::Parameter & p0, 00235 const funct::Parameter & p1, 00236 const funct::Parameter & p2, 00237 const funct::Parameter & p3, 00238 const funct::Parameter & p4, 00239 const funct::Parameter & p5, 00240 const funct::Parameter & p6, 00241 const funct::Parameter & p7, 00242 const funct::Parameter & p8, 00243 const funct::Parameter & p9, 00244 Color_t lineColor = kRed, Width_t lineWidth = 1, 00245 Style_t lineStyle = kDashed, Int_t npx = 1000, 00246 const char * title = "Histo Title", const char * xTitle = "X Title", 00247 const char * yTitle = "Y Title") { 00248 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); 00249 plotTF1(name, fun, histo, min, max, 00250 lineColor, lineWidth, lineStyle, npx, 00251 title, xTitle, yTitle); 00252 } 00253 00254 template<typename F> 00255 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00256 const funct::Parameter & p0, 00257 const funct::Parameter & p1, 00258 const funct::Parameter & p2, 00259 const funct::Parameter & p3, 00260 const funct::Parameter & p4, 00261 const funct::Parameter & p5, 00262 const funct::Parameter & p6, 00263 const funct::Parameter & p7, 00264 const funct::Parameter & p8, 00265 const funct::Parameter & p9, 00266 const funct::Parameter & p10, 00267 Color_t lineColor = kRed, Width_t lineWidth = 1, 00268 Style_t lineStyle = kDashed, Int_t npx = 1000, 00269 const char * title = "Histo Title", const char * xTitle = "X Title", 00270 const char * yTitle = "Y Title") { 00271 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, 00272 p10); 00273 plotTF1(name, fun, histo, min, max, 00274 lineColor, lineWidth, lineStyle, npx, 00275 title, xTitle, yTitle); 00276 } 00277 00278 template<typename F> 00279 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00280 const funct::Parameter & p0, 00281 const funct::Parameter & p1, 00282 const funct::Parameter & p2, 00283 const funct::Parameter & p3, 00284 const funct::Parameter & p4, 00285 const funct::Parameter & p5, 00286 const funct::Parameter & p6, 00287 const funct::Parameter & p7, 00288 const funct::Parameter & p8, 00289 const funct::Parameter & p9, 00290 const funct::Parameter & p10, 00291 const funct::Parameter & p11, 00292 Color_t lineColor = kRed, Width_t lineWidth = 1, 00293 Style_t lineStyle = kDashed, Int_t npx = 1000, 00294 const char * title = "Histo Title", const char * xTitle = "X Title", 00295 const char * yTitle = "Y Title") { 00296 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, 00297 p10, p11); 00298 plotTF1(name, fun, histo, min, max, 00299 lineColor, lineWidth, lineStyle, npx, 00300 title, xTitle, yTitle); 00301 } 00302 00303 template<typename F> 00304 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00305 const funct::Parameter & p0, 00306 const funct::Parameter & p1, 00307 const funct::Parameter & p2, 00308 const funct::Parameter & p3, 00309 const funct::Parameter & p4, 00310 const funct::Parameter & p5, 00311 const funct::Parameter & p6, 00312 const funct::Parameter & p7, 00313 const funct::Parameter & p8, 00314 const funct::Parameter & p9, 00315 const funct::Parameter & p10, 00316 const funct::Parameter & p11, 00317 const funct::Parameter & p12, 00318 Color_t lineColor = kRed, Width_t lineWidth = 1, 00319 Style_t lineStyle = kDashed, Int_t npx = 1000, 00320 const char * title = "Histo Title", const char * xTitle = "X Title", 00321 const char * yTitle = "Y Title") { 00322 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, 00323 p10, p11, p12); 00324 plotTF1(name, fun, histo, min, max, 00325 lineColor, lineWidth, lineStyle, npx, 00326 title, xTitle, yTitle); 00327 } 00328 00329 template<typename F> 00330 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00331 const funct::Parameter & p0, 00332 const funct::Parameter & p1, 00333 const funct::Parameter & p2, 00334 const funct::Parameter & p3, 00335 const funct::Parameter & p4, 00336 const funct::Parameter & p5, 00337 const funct::Parameter & p6, 00338 const funct::Parameter & p7, 00339 const funct::Parameter & p8, 00340 const funct::Parameter & p9, 00341 const funct::Parameter & p10, 00342 const funct::Parameter & p11, 00343 const funct::Parameter & p12, 00344 const funct::Parameter & p13, 00345 Color_t lineColor = kRed, Width_t lineWidth = 1, 00346 Style_t lineStyle = kDashed, Int_t npx = 1000, 00347 const char * title = "Histo Title", const char * xTitle = "X Title", 00348 const char * yTitle = "Y Title") { 00349 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, 00350 p10, p11, p12, p13); 00351 plotTF1(name, fun, histo, min, max, 00352 lineColor, lineWidth, lineStyle, npx, 00353 title, xTitle, yTitle); 00354 } 00355 00356 template<typename F> 00357 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00358 const funct::Parameter & p0, 00359 const funct::Parameter & p1, 00360 const funct::Parameter & p2, 00361 const funct::Parameter & p3, 00362 const funct::Parameter & p4, 00363 const funct::Parameter & p5, 00364 const funct::Parameter & p6, 00365 const funct::Parameter & p7, 00366 const funct::Parameter & p8, 00367 const funct::Parameter & p9, 00368 const funct::Parameter & p10, 00369 const funct::Parameter & p11, 00370 const funct::Parameter & p12, 00371 const funct::Parameter & p13, 00372 const funct::Parameter & p14, 00373 Color_t lineColor = kRed, Width_t lineWidth = 1, 00374 Style_t lineStyle = kDashed, Int_t npx = 1000, 00375 const char * title = "Histo Title", const char * xTitle = "X Title", 00376 const char * yTitle = "Y Title") { 00377 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, 00378 p10, p11, p12, p13, p14); 00379 plotTF1(name, fun, histo, min, max, 00380 lineColor, lineWidth, lineStyle, npx, 00381 title, xTitle, yTitle); 00382 } 00383 00384 template<typename F> 00385 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00386 const funct::Parameter & p0, 00387 const funct::Parameter & p1, 00388 const funct::Parameter & p2, 00389 const funct::Parameter & p3, 00390 const funct::Parameter & p4, 00391 const funct::Parameter & p5, 00392 const funct::Parameter & p6, 00393 const funct::Parameter & p7, 00394 const funct::Parameter & p8, 00395 const funct::Parameter & p9, 00396 const funct::Parameter & p10, 00397 const funct::Parameter & p11, 00398 const funct::Parameter & p12, 00399 const funct::Parameter & p13, 00400 const funct::Parameter & p14, 00401 const funct::Parameter & p15, 00402 Color_t lineColor = kRed, Width_t lineWidth = 1, 00403 Style_t lineStyle = kDashed, Int_t npx = 1000, 00404 const char * title = "Histo Title", const char * xTitle = "X Title", 00405 const char * yTitle = "Y Title") { 00406 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, 00407 p10, p11, p12, p13, p14, p15); 00408 plotTF1(name, fun, histo, min, max, 00409 lineColor, lineWidth, lineStyle, npx, 00410 title, xTitle, yTitle); 00411 } 00412 00413 template<typename F> 00414 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00415 const funct::Parameter & p0, 00416 const funct::Parameter & p1, 00417 const funct::Parameter & p2, 00418 const funct::Parameter & p3, 00419 const funct::Parameter & p4, 00420 const funct::Parameter & p5, 00421 const funct::Parameter & p6, 00422 const funct::Parameter & p7, 00423 const funct::Parameter & p8, 00424 const funct::Parameter & p9, 00425 const funct::Parameter & p10, 00426 const funct::Parameter & p11, 00427 const funct::Parameter & p12, 00428 const funct::Parameter & p13, 00429 const funct::Parameter & p14, 00430 const funct::Parameter & p15, 00431 const funct::Parameter & p16, 00432 Color_t lineColor = kRed, Width_t lineWidth = 1, 00433 Style_t lineStyle = kDashed, Int_t npx = 1000, 00434 const char * title = "Histo Title", const char * xTitle = "X Title", 00435 const char * yTitle = "Y Title") { 00436 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, 00437 p10, p11, p12, p13, p14, p15, p16); 00438 plotTF1(name, fun, histo, min, max, 00439 lineColor, lineWidth, lineStyle, npx, 00440 title, xTitle, yTitle); 00441 } 00442 00443 template<typename F> 00444 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00445 const funct::Parameter & p0, 00446 const funct::Parameter & p1, 00447 const funct::Parameter & p2, 00448 const funct::Parameter & p3, 00449 const funct::Parameter & p4, 00450 const funct::Parameter & p5, 00451 const funct::Parameter & p6, 00452 const funct::Parameter & p7, 00453 const funct::Parameter & p8, 00454 const funct::Parameter & p9, 00455 const funct::Parameter & p10, 00456 const funct::Parameter & p11, 00457 const funct::Parameter & p12, 00458 const funct::Parameter & p13, 00459 const funct::Parameter & p14, 00460 const funct::Parameter & p15, 00461 const funct::Parameter & p16, 00462 const funct::Parameter & p17, 00463 Color_t lineColor = kRed, Width_t lineWidth = 1, 00464 Style_t lineStyle = kDashed, Int_t npx = 1000, 00465 const char * title = "Histo Title", const char * xTitle = "X Title", 00466 const char * yTitle = "Y Title") { 00467 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, 00468 p10, p11, p12, p13, p14, p15, p16, p17); 00469 plotTF1(name, fun, histo, min, max, 00470 lineColor, lineWidth, lineStyle, npx, 00471 title, xTitle, yTitle); 00472 } 00473 00474 template<typename F> 00475 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00476 const funct::Parameter & p0, 00477 const funct::Parameter & p1, 00478 const funct::Parameter & p2, 00479 const funct::Parameter & p3, 00480 const funct::Parameter & p4, 00481 const funct::Parameter & p5, 00482 const funct::Parameter & p6, 00483 const funct::Parameter & p7, 00484 const funct::Parameter & p8, 00485 const funct::Parameter & p9, 00486 const funct::Parameter & p10, 00487 const funct::Parameter & p11, 00488 const funct::Parameter & p12, 00489 const funct::Parameter & p13, 00490 const funct::Parameter & p14, 00491 const funct::Parameter & p15, 00492 const funct::Parameter & p16, 00493 const funct::Parameter & p17, 00494 const funct::Parameter & p18, 00495 Color_t lineColor = kRed, Width_t lineWidth = 1, 00496 Style_t lineStyle = kDashed, Int_t npx = 1000, 00497 const char * title = "Histo Title", const char * xTitle = "X Title", 00498 const char * yTitle = "Y Title") { 00499 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, 00500 p10, p11, p12, p13, p14, p15, p16, p17, p18); 00501 plotTF1(name, fun, histo, min, max, 00502 lineColor, lineWidth, lineStyle, npx, 00503 title, xTitle, yTitle); 00504 } 00505 00506 template<typename F> 00507 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00508 const funct::Parameter & p0, 00509 const funct::Parameter & p1, 00510 const funct::Parameter & p2, 00511 const funct::Parameter & p3, 00512 const funct::Parameter & p4, 00513 const funct::Parameter & p5, 00514 const funct::Parameter & p6, 00515 const funct::Parameter & p7, 00516 const funct::Parameter & p8, 00517 const funct::Parameter & p9, 00518 const funct::Parameter & p10, 00519 const funct::Parameter & p11, 00520 const funct::Parameter & p12, 00521 const funct::Parameter & p13, 00522 const funct::Parameter & p14, 00523 const funct::Parameter & p15, 00524 const funct::Parameter & p16, 00525 const funct::Parameter & p17, 00526 const funct::Parameter & p18, 00527 const funct::Parameter & p19, 00528 Color_t lineColor = kRed, Width_t lineWidth = 1, 00529 Style_t lineStyle = kDashed, Int_t npx = 1000, 00530 const char * title = "Histo Title", const char * xTitle = "X Title", 00531 const char * yTitle = "Y Title") { 00532 TF1 fun = root::tf1("fun", f, min, max, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, 00533 p10, p11, p12, p13, p14, p15, p16, p17, p18, p19); 00534 plotTF1(name, fun, histo, min, max, 00535 lineColor, lineWidth, lineStyle, npx, 00536 title, xTitle, yTitle); 00537 } 00538 00539 template<typename F> 00540 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00541 const std::vector<funct::Parameter> & p, 00542 Color_t lineColor = kRed, Width_t lineWidth = 1, 00543 Style_t lineStyle = kDashed, Int_t npx = 1000, 00544 const char * title = "Histo Title", const char * xTitle = "X Title", 00545 const char * yTitle = "Y Title") { 00546 TF1 fun = root::tf1("fun", f, min, max, p); 00547 plotTF1(name, fun, histo, min, max, 00548 lineColor, lineWidth, lineStyle, npx, 00549 title, xTitle, yTitle); 00550 } 00551 00552 template<typename F> 00553 void plot(const char * name, TH1 & histo, F& f, double min, double max, 00554 const std::vector<boost::shared_ptr<double> > & p, 00555 Color_t lineColor = kRed, Width_t lineWidth = 1, 00556 Style_t lineStyle = kDashed, Int_t npx = 1000, 00557 const char * title = "Histo Title", const char * xTitle = "X Title", 00558 const char * yTitle = "Y Title") { 00559 TF1 fun = root::tf1("fun", f, min, max, p); 00560 plotTF1(name, fun, histo, min, max, 00561 lineColor, lineWidth, lineStyle, npx, 00562 title, xTitle, yTitle); 00563 } 00564 } 00565 00566 #endif