Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAdaptiveGaussKronrodIntegrator1D.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooAdaptiveGaussKronrodIntegrator1D.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_ADAPTIVE_GAUSS_KRONROD_INTEGRATOR_1D
17#define ROO_ADAPTIVE_GAUSS_KRONROD_INTEGRATOR_1D
18
19#include "RooAbsIntegrator.h"
20#include "RooNumIntConfig.h"
21
23
25public:
26
27 // Constructors, assignment etc
28 RooAdaptiveGaussKronrodIntegrator1D(const RooAbsFunc& function, const RooNumIntConfig& config) ;
29 RooAdaptiveGaussKronrodIntegrator1D(const RooAbsFunc& function, double xmin, double xmax,
30 const RooNumIntConfig& config) ;
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 {
39 // If flag is true, integration limits are taken from definition in input function binding
40 _useIntegrandLimits = flag ; return true ;
41 }
42
43protected:
44
45 friend class RooNumIntFactory ;
46 static void registerIntegrator(RooNumIntFactory& fact) ;
47
50
52
53 bool initialize();
54
56
57 double* xvec(double& xx) {
58 // Return contents of xx in internal array pointer
59 _x[0] = xx ; return _x.data();
60 }
61 std::vector<double> _x ; //! Current coordinate
62
63 double _epsAbs ; // Absolute precision
64 double _epsRel ; // Relative precision
65 Int_t _methodKey ; // GSL method key
66 Int_t _maxSeg ; // Maximum number of segments
67 void* _workspace = nullptr; // GSL workspace
68
69 mutable double _xmin; //! Lower integration bound
70 mutable double _xmax; //! Upper integration bound
71
72 ClassDefOverride(RooAdaptiveGaussKronrodIntegrator1D,0) // 1-dimensional adaptive Gauss-Kronrod numerical integration engine
73};
74
75#endif
double RooAdaptiveGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
Glue function interacing to GSL code.
#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
Abstract interface for integrators of real-valued functions that implement the RooAbsFunc interface.
virtual bool setLimits(double *, double *)
RooAdaptiveGaussKronrodIntegrator1D implements the Gauss-Kronrod integration algorithm.
double integral(const double *yvec=nullptr) override
Calculate and return integral at at given parameter values.
bool initialize()
Initialize integrator allocate buffers and setup GSL workspace.
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.
bool checkLimits() const override
Check that our integration range is finite and otherwise return false.
friend double RooAdaptiveGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
Glue function interacing to GSL code.
static void registerIntegrator(RooNumIntFactory &fact)
Register this class with RooNumIntConfig as a possible choice of numeric integrator for one-dimension...
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