Logo ROOT  
Reference Guide
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 namespace ROOT {
13 
14 namespace Minuit2 {
15 
16 void mnplot(double *xpt, double *ypt, char *chpt, int nxypt, int npagwd, int npagln);
17 
18 void MnPlot::operator()(const std::vector<std::pair<double, double>> &points) const
19 {
20  // call routine from Fortran minuit (mnplot) to plot the vector of (x,y) points
21  std::vector<double> x;
22  x.reserve(points.size());
23  std::vector<double> y;
24  y.reserve(points.size());
25  std::vector<char> chpt;
26  chpt.reserve(points.size());
27 
28  for (std::vector<std::pair<double, double>>::const_iterator ipoint = points.begin(); ipoint != points.end();
29  ++ipoint) {
30  x.push_back((*ipoint).first);
31  y.push_back((*ipoint).second);
32  chpt.push_back('*');
33  }
34 
35  mnplot(&(x.front()), &(y.front()), &(chpt.front()), points.size(), Width(), Length());
36 }
37 
38 void MnPlot::operator()(double xmin, double ymin, const std::vector<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::vector<char> chpt;
50  chpt.reserve(points.size() + 2);
51  chpt.push_back(' ');
52  chpt.push_back('X');
53 
54  for (std::vector<std::pair<double, double>>::const_iterator ipoint = points.begin(); ipoint != points.end();
55  ++ipoint) {
56  x.push_back((*ipoint).first);
57  y.push_back((*ipoint).second);
58  chpt.push_back('*');
59  }
60 
61  mnplot(&(x.front()), &(y.front()), &(chpt.front()), points.size() + 2, Width(), Length());
62 }
63 
64 } // namespace Minuit2
65 
66 } // namespace ROOT
ROOT::Minuit2::MnPlot::operator()
void operator()(const std::vector< std::pair< double, double >> &) const
Definition: MnPlot.cxx:18
MnPlot.h
ROOT::Minuit2::mnplot
void mnplot(double *xpt, double *ypt, char *chpt, int nxypt, int npagwd, int npagln)
Definition: mntplot.cxx:25
x
Double_t x[n]
Definition: legend1.C:17
xmin
float xmin
Definition: THbookFile.cxx:95
y
Double_t y[n]
Definition: legend1.C:17
ymin
float ymin
Definition: THbookFile.cxx:95
ROOT::Minuit2::MnPlot::Length
unsigned int Length() const
Definition: MnPlot.h:44
ROOT::Minuit2::MnPlot::Width
unsigned int Width() const
Definition: MnPlot.h:43
points
point * points
Definition: X3DBuffer.c:22
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4