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 
17 void mnplot(double* xpt, double* ypt, char* chpt, int nxypt, int npagwd, int npagln);
18 
19 void MnPlot::operator()(const std::vector<std::pair<double,double> >& points) const {
20  // call routine from Fortran minuit (mnplot) to plot the vector of (x,y) points
21  std::vector<double> x; x.reserve(points.size());
22  std::vector<double> y; y.reserve(points.size());
23  std::vector<char> chpt; chpt.reserve(points.size());
24 
25  for(std::vector<std::pair<double,double> >::const_iterator ipoint = points.begin(); ipoint != points.end(); ++ipoint) {
26  x.push_back((*ipoint).first);
27  y.push_back((*ipoint).second);
28  chpt.push_back('*');
29  }
30 
31  mnplot(&(x.front()), &(y.front()), &(chpt.front()), points.size(), Width(), Length());
32 
33 }
34 
35 void MnPlot::operator()(double xmin, double ymin, const std::vector<std::pair<double,double> >& points) const {
36  // call routine from Fortran minuit (mnplot) to plot the vector of (x,y) points + minimum values
37  std::vector<double> x; x.reserve(points.size()+2);
38  x.push_back(xmin);
39  x.push_back(xmin);
40  std::vector<double> y; y.reserve(points.size()+2);
41  y.push_back(ymin);
42  y.push_back(ymin);
43  std::vector<char> chpt; chpt.reserve(points.size()+2);
44  chpt.push_back(' ');
45  chpt.push_back('X');
46 
47  for(std::vector<std::pair<double,double> >::const_iterator ipoint = points.begin(); ipoint != points.end(); ++ipoint) {
48  x.push_back((*ipoint).first);
49  y.push_back((*ipoint).second);
50  chpt.push_back('*');
51  }
52 
53  mnplot(&(x.front()), &(y.front()), &(chpt.front()), points.size()+2, Width(), Length());
54 }
55 
56  } // namespace Minuit2
57 
58 } // namespace ROOT
MnPlot.h
ROOT::Minuit2::MnPlot::operator()
void operator()(const std::vector< std::pair< double, double > > &) const
Definition: MnPlot.cxx:27
ROOT::Minuit2::mnplot
void mnplot(double *xpt, double *ypt, char *chpt, int nxypt, int npagwd, int npagln)
Definition: mntplot.cxx:34
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:55
ROOT::Minuit2::MnPlot::Width
unsigned int Width() const
Definition: MnPlot.h:54
points
point * points
Definition: X3DBuffer.c:22
ROOT
VSD Structures.
Definition: StringConv.hxx:21