Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
MnPlot.cxx
Go to the documentation of this file.
1// @(#)root/minuit2:$Id$
2// Authors: M. Winkler, F. James, L. Moneta, A. Zsenei 2003-2005
3
4/**********************************************************************
5 * *
6 * Copyright (c) 2005 LCG ROOT Math team, CERN/PH-SFT *
7 * *
8 **********************************************************************/
9
10#include "Minuit2/MnPlot.h"
11
12#include <string>
13namespace ROOT {
14
15namespace Minuit2 {
16
17void mnplot(double *xpt, double *ypt, char *chpt, int nxypt, int npagwd, int npagln);
18
19void MnPlot::operator()(std::span<const std::pair<double, double>> points) const
20{
21 // call routine from Fortran minuit (mnplot) to plot the vector of (x,y) points
22 std::vector<double> x;
23 x.reserve(points.size());
24 std::vector<double> y;
25 y.reserve(points.size());
26 std::string chpt;
27 chpt.reserve(points.size() + 1);
28
29 for (auto &ipoint : points) {
30 x.push_back(ipoint.first);
31 y.push_back(ipoint.second);
32 chpt += '*';
33 }
34
35 mnplot(x.data(), y.data(), chpt.data(), points.size(), Width(), Length());
36}
37
38void MnPlot::operator()(double xmin, double ymin, std::span<const std::pair<double, double>> points) const
39{
40 // call routine from Fortran minuit (mnplot) to plot the vector of (x,y) points + minimum values
41 std::vector<double> x;
42 x.reserve(points.size() + 2);
43 x.push_back(xmin);
44 x.push_back(xmin);
45 std::vector<double> y;
46 y.reserve(points.size() + 2);
47 y.push_back(ymin);
48 y.push_back(ymin);
49 std::string chpt;
50 chpt.reserve(points.size() + 3);
51 chpt += ' ';
52 chpt += 'X';
53
54 for (auto &ipoint : points) {
55 x.push_back(ipoint.first);
56 y.push_back(ipoint.second);
57 chpt += '*';
58 }
59
60 mnplot(x.data(), y.data(), chpt.data(), points.size() + 2, Width(), Length());
61}
62
63} // namespace Minuit2
64
65} // namespace ROOT
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t points
float xmin
float ymin
void operator()(std::span< const std::pair< double, double > >) const
Definition MnPlot.cxx:19
unsigned int Width() const
Definition MnPlot.h:46
unsigned int Length() const
Definition MnPlot.h:47
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
void mnplot(double *xpt, double *ypt, char *chpt, int nxypt, int npagwd, int npagln)
Definition mntplot.cxx:25
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...