[go: up one dir, main page]

File: contours.cpp

package info (click to toggle)
iminuit 2.11.2-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,780 kB
  • sloc: cpp: 24,851; python: 6,975; makefile: 18
file content (22 lines) | stat: -rw-r--r-- 678 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <Minuit2/ContoursError.h>
#include <Minuit2/FCNBase.h>
#include <Minuit2/FunctionMinimum.h>
#include <Minuit2/MnContours.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

namespace py = pybind11;
using namespace ROOT::Minuit2;

void bind_contours(py::module m) {
  py::class_<MnContours>(m, "MnContours")

      .def(py::init<const FCNBase&, const FunctionMinimum&, const MnStrategy&>())
      .def("__call__",
           [](const MnContours& self, unsigned ix, unsigned iy, unsigned npoints) {
             const auto ce = self.Contour(ix, iy, npoints);
             return py::make_tuple(ce.XMinosError(), ce.YMinosError(), ce());
           })

      ;
}