Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooGaussKronrodIntegrator1D.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooGaussKronrodIntegrator1D.h,v 1.5 2007/05/11 09:11:30 verkerke Exp $
5 * Authors: *
6 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8 * *
9 * Copyright (c) 2000-2005, Regents of the University of California *
10 * and Stanford University. All rights reserved. *
11 * *
12 * Redistribution and use in source and binary forms, *
13 * with or without modification, are permitted according to the terms *
14 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15 *****************************************************************************/
16#ifndef ROO_GAUSS_KRONROD_INTEGRATOR_1D
17#define ROO_GAUSS_KRONROD_INTEGRATOR_1D
18
19#include "RooAbsIntegrator.h"
20#include "RooNumIntConfig.h"
21
23
25public:
26 // Constructors, assignment etc
28 RooGaussKronrodIntegrator1D(const RooAbsFunc &function, double xmin, double xmax, const RooNumIntConfig &config);
29 bool checkLimits() const override;
30 double integral(const double *yvec = nullptr) override;
31
33 bool setLimits(double *xmin, double *xmax) override;
34 bool setUseIntegrandLimits(bool flag) override
35 {
37 return true;
38 }
39
40protected:
41 friend class RooNumIntFactory;
42 static void registerIntegrator(RooNumIntFactory &fact);
43
44 friend double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data);
45
46 bool initialize();
47
48 bool _useIntegrandLimits; // Use limits in function binding?
49
50 double *xvec(double &xx)
51 {
52 _x[0] = xx;
53 return _x.data();
54 }
55 std::vector<double> _x; //! do not persist
56
57 double _epsAbs; // Absolute precision
58 double _epsRel; // Relative precision
59
60 mutable double _xmin; //! Lower integration bound
61 mutable double _xmax; //! Upper integration bound
62};
63
64#endif
RooAbsReal & function()
double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
float xmin
float xmax
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition RooAbsFunc.h:27
Abstract interface for integrators of real-valued functions that implement the RooAbsFunc interface.
virtual bool setLimits(double *, double *)
Implements the Gauss-Kronrod integration algorithm.
double integral(const double *yvec=nullptr) override
Calculate and return integral.
double _xmax
Lower integration bound.
friend double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
bool initialize()
Perform one-time initialization of integrator.
bool checkLimits() const override
Check that our integration range is finite and otherwise return false.
bool setUseIntegrandLimits(bool flag) override
Interface function that allows to defer limit definition to integrand definition.
bool setLimits(double *xmin, double *xmax) override
Change our integration limits.
static void registerIntegrator(RooNumIntFactory &fact)
Register RooGaussKronrodIntegrator1D, its parameters and capabilities with RooNumIntConfig.
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
Factory to instantiate numeric integrators from a given function binding and a given configuration.
Double_t x[n]
Definition legend1.C:17