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 
22 double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data) ;
23 
25 public:
26 
27  // Constructors, assignment etc
29  RooGaussKronrodIntegrator1D(const RooAbsFunc& function, const RooNumIntConfig& config) ;
31  virtual RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const ;
33 
34  virtual Bool_t checkLimits() const;
35  virtual Double_t integral(const Double_t *yvec=0) ;
36 
39  virtual Bool_t setUseIntegrandLimits(Bool_t flag) {_useIntegrandLimits = flag ; return kTRUE ; }
40 
41  virtual Bool_t canIntegrate1D() const { return kTRUE ; }
42  virtual Bool_t canIntegrate2D() const { return kFALSE ; }
43  virtual Bool_t canIntegrateND() const { return kFALSE ; }
44  virtual Bool_t canIntegrateOpenEnded() const { return kTRUE ; }
45 
46 protected:
47 
48  friend class RooNumIntFactory ;
49  static void registerIntegrator(RooNumIntFactory& fact) ;
50 
51  friend double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data) ;
52 
54 
55  Bool_t _useIntegrandLimits; // Use limits in function binding?
56 
57  Double_t* xvec(Double_t& xx) { _x[0] = xx ; return _x ; }
58  Double_t *_x ; //! do not persist
59 
60  Double_t _epsAbs ; // Absolute precision
61  Double_t _epsRel ; // Relative precision
62 
63  mutable Double_t _xmin; //! Lower integration bound
64  mutable Double_t _xmax; //! Upper integration bound
65 
66  ClassDef(RooGaussKronrodIntegrator1D,0) // 1-dimensional Gauss-Kronrod numerical integration engine
67 };
68 
69 #endif
RooNumIntFactory
Definition: RooNumIntFactory.h:30
RooGaussKronrodIntegrator1D::canIntegrateOpenEnded
virtual Bool_t canIntegrateOpenEnded() const
Definition: RooGaussKronrodIntegrator1D.h:44
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooGaussKronrodIntegrator1D
Definition: RooGaussKronrodIntegrator1D.h:24
RooGaussKronrodIntegrator1D::xvec
Double_t * xvec(Double_t &xx)
Definition: RooGaussKronrodIntegrator1D.h:57
RooNumIntConfig.h
RooGaussKronrodIntegrator1D_GSL_GlueFunction
double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
Definition: RooGaussKronrodIntegrator1D.cxx:225
RooGaussKronrodIntegrator1D::_x
Double_t * _x
Definition: RooGaussKronrodIntegrator1D.h:58
xmax
float xmax
Definition: THbookFile.cxx:95
x
Double_t x[n]
Definition: legend1.C:17
RooGaussKronrodIntegrator1D::canIntegrate2D
virtual Bool_t canIntegrate2D() const
Definition: RooGaussKronrodIntegrator1D.h:42
RooGaussKronrodIntegrator1D::_epsRel
Double_t _epsRel
Definition: RooGaussKronrodIntegrator1D.h:61
bool
RooAbsFunc
Definition: RooAbsFunc.h:23
RooGaussKronrodIntegrator1D::checkLimits
virtual Bool_t checkLimits() const
Check that our integration range is finite and otherwise return kFALSE.
Definition: RooGaussKronrodIntegrator1D.cxx:213
RooGaussKronrodIntegrator1D::clone
virtual RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const
Clone integrator with given function and configuration. Needed for RooNumIntFactory.
Definition: RooGaussKronrodIntegrator1D.cxx:159
RooAbsIntegrator::setLimits
virtual Bool_t setLimits(Double_t *, Double_t *)
Definition: RooAbsIntegrator.h:75
xmin
float xmin
Definition: THbookFile.cxx:95
RooGaussKronrodIntegrator1D::RooGaussKronrodIntegrator1D_GSL_GlueFunction
friend double RooGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
Definition: RooGaussKronrodIntegrator1D.cxx:225
RooGaussKronrodIntegrator1D::~RooGaussKronrodIntegrator1D
virtual ~RooGaussKronrodIntegrator1D()
Destructor.
Definition: RooGaussKronrodIntegrator1D.cxx:182
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooGaussKronrodIntegrator1D::_xmin
Double_t _xmin
Definition: RooGaussKronrodIntegrator1D.h:63
RooAbsIntegrator.h
RooGaussKronrodIntegrator1D::RooGaussKronrodIntegrator1D
RooGaussKronrodIntegrator1D()
coverity[UNINIT_CTOR] Default constructor
Definition: RooGaussKronrodIntegrator1D.cxx:118
RooGaussKronrodIntegrator1D::_useIntegrandLimits
Bool_t _useIntegrandLimits
Definition: RooGaussKronrodIntegrator1D.h:55
RooGaussKronrodIntegrator1D::canIntegrate1D
virtual Bool_t canIntegrate1D() const
Definition: RooGaussKronrodIntegrator1D.h:41
RooGaussKronrodIntegrator1D::setUseIntegrandLimits
virtual Bool_t setUseIntegrandLimits(Bool_t flag)
Interface function that allows to defer limit definition to integrand definition.
Definition: RooGaussKronrodIntegrator1D.h:39
RooGaussKronrodIntegrator1D::initialize
Bool_t initialize()
Perform one-time initialization of integrator.
Definition: RooGaussKronrodIntegrator1D.cxx:169
Double_t
double Double_t
Definition: RtypesCore.h:59
RooGaussKronrodIntegrator1D::registerIntegrator
static void registerIntegrator(RooNumIntFactory &fact)
Register RooGaussKronrodIntegrator1D, its parameters and capabilities with RooNumIntConfig.
Definition: RooGaussKronrodIntegrator1D.cxx:106
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooGaussKronrodIntegrator1D::_epsAbs
Double_t _epsAbs
do not persist
Definition: RooGaussKronrodIntegrator1D.h:60
RooGaussKronrodIntegrator1D::integral
virtual Double_t integral(const Double_t *yvec=0)
Calculate and return integral.
Definition: RooGaussKronrodIntegrator1D.cxx:236
RooNumIntConfig
Definition: RooNumIntConfig.h:25
RooAbsIntegrator
Definition: RooAbsIntegrator.h:22
RooGaussKronrodIntegrator1D::setLimits
Bool_t setLimits(Double_t *xmin, Double_t *xmax)
Change our integration limits.
Definition: RooGaussKronrodIntegrator1D.cxx:196
RooGaussKronrodIntegrator1D::canIntegrateND
virtual Bool_t canIntegrateND() const
Definition: RooGaussKronrodIntegrator1D.h:43
RooGaussKronrodIntegrator1D::_xmax
Double_t _xmax
Lower integration bound.
Definition: RooGaussKronrodIntegrator1D.h:64