Logo ROOT  
Reference Guide
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
30 RooGaussKronrodIntegrator1D(const RooAbsFunc& function, double xmin, double xmax, const RooNumIntConfig& config) ;
31 RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const override ;
33
34 bool checkLimits() const override;
35 double integral(const double *yvec=0) override ;
36
38 bool setLimits(double* xmin, double* xmax) override;
39 bool setUseIntegrandLimits(bool flag) override {_useIntegrandLimits = flag ; return true ; }
40
41 bool canIntegrate1D() const override { return true ; }
42 bool canIntegrate2D() const override { return false ; }
43 bool canIntegrateND() const override { return false ; }
44 bool canIntegrateOpenEnded() const override { return true ; }
45
46protected:
47
48 friend class RooNumIntFactory ;
49 static void registerIntegrator(RooNumIntFactory& fact) ;
50
51 friend double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data) ;
52
53 bool initialize();
54
55 bool _useIntegrandLimits; // Use limits in function binding?
56
57 double* xvec(double& xx) { _x[0] = xx ; return _x ; }
58 double *_x ; //! do not persist
59
60 double _epsAbs ; // Absolute precision
61 double _epsRel ; // Relative precision
62
63 mutable double _xmin; //! Lower integration bound
64 mutable double _xmax; //! Upper integration bound
65
66 ClassDefOverride(RooGaussKronrodIntegrator1D,0) // 1-dimensional Gauss-Kronrod numerical integration engine
67};
68
69#endif
double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
float xmin
Definition: THbookFile.cxx:95
float xmax
Definition: THbookFile.cxx:95
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=0) override
Calculate and return integral.
double _xmax
Lower integration bound.
~RooGaussKronrodIntegrator1D() override
Destructor.
friend double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
bool initialize()
Perform one-time initialization of integrator.
RooGaussKronrodIntegrator1D()
coverity[UNINIT_CTOR] Default constructor
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 canIntegrateOpenEnded() const override
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
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition: RExports.h:167