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 // Constructors, assignment etc
29 const RooNumIntConfig &config);
31
32 bool checkLimits() const override;
33 double integral(const double *yvec = nullptr) override;
34
36 bool setLimits(double *xmin, double *xmax) override;
37 bool setUseIntegrandLimits(bool flag) override
38 {
39 // If flag is true, integration limits are taken from definition in input function binding
41 return true;
42 }
43
44protected:
45 friend class RooNumIntFactory;
46 static void registerIntegrator(RooNumIntFactory &fact);
47
50
52
53 bool initialize();
54
56
57 double *xvec(double &xx)
58 {
59 // Return contents of xx in internal array pointer
60 _x[0] = xx;
61 return _x.data();
62 }
63 std::vector<double> _x; //! Current coordinate
64
65 double _epsAbs; // Absolute precision
66 double _epsRel; // Relative precision
67 Int_t _methodKey; // GSL method key
68 Int_t _maxSeg; // Maximum number of segments
69 void *_workspace = nullptr; // GSL workspace
70
71 mutable double _xmin; //! Lower integration bound
72 mutable double _xmax; //! Upper integration bound
73};
74
75#endif
RooAbsReal & function()
double RooAdaptiveGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
Glue function interacing to GSL code.
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 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...
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