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
27 // Constructors, assignment etc
29 RooGaussKronrodIntegrator1D(const RooAbsFunc& function, const RooNumIntConfig& config) ;
30 RooGaussKronrodIntegrator1D(const RooAbsFunc& function, double xmin, double xmax, const RooNumIntConfig& config) ;
31 RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const override ;
32
33 bool checkLimits() const override;
34 double integral(const double *yvec=nullptr) override ;
35
37 bool setLimits(double* xmin, double* xmax) override;
38 bool setUseIntegrandLimits(bool flag) override {_useIntegrandLimits = flag ; return true ; }
39
40 bool canIntegrate1D() const override { return true ; }
41 bool canIntegrate2D() const override { return false ; }
42 bool canIntegrateND() const override { return false ; }
43 bool canIntegrateOpenEnded() const override { return true ; }
44
45protected:
46
47 friend class RooNumIntFactory ;
48 static void registerIntegrator(RooNumIntFactory& fact) ;
49
50 friend double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data) ;
51
52 bool initialize();
53
54 bool _useIntegrandLimits; // Use limits in function binding?
55
56 double* xvec(double& xx) { _x[0] = xx ; return _x.data(); }
57 std::vector<double> _x ; //! do not persist
58
59 double _epsAbs ; // Absolute precision
60 double _epsRel ; // Relative precision
61
62 mutable double _xmin; //! Lower integration bound
63 mutable double _xmax; //! Upper integration bound
64
65 ClassDefOverride(RooGaussKronrodIntegrator1D,0) // 1-dimensional Gauss-Kronrod numerical integration engine
66};
67
68#endif
double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
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
RooAbsIntegrator is the abstract interface for integrators of real-valued functions that implement th...
virtual bool setLimits(double *, double *)
RooGaussKronrodIntegrator1D 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.
RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const override
Clone integrator with given function and configuration. Needed for RooNumIntFactory.
bool setLimits(double *xmin, double *xmax) override
Change our integration limits.
static void registerIntegrator(RooNumIntFactory &fact)
Register RooGaussKronrodIntegrator1D, its parameters and capabilities with RooNumIntConfig.
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
RooNumIntFactory is a factory to instantiate numeric integrators from a given function binding and a ...
Double_t x[n]
Definition legend1.C:17