ROOT  6.06/09
Reference Guide
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 
25 public:
26 
27  // Constructors, assignment etc
29  RooAdaptiveGaussKronrodIntegrator1D(const RooAbsFunc& function, const RooNumIntConfig& config) ;
31  const RooNumIntConfig& config) ;
32  virtual RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const ;
34 
35  virtual Bool_t checkLimits() const;
36  virtual Double_t integral(const Double_t *yvec=0) ;
37 
39  Bool_t setLimits(Double_t* xmin, Double_t* xmax);
41  // If flag is true, intergration limits are taken from definition in input function binding
42  _useIntegrandLimits = flag ; return kTRUE ;
43  }
44 
45  virtual Bool_t canIntegrate1D() const {
46  // We can integrate 1-dimensional functions
47  return kTRUE ;
48  }
49  virtual Bool_t canIntegrate2D() const {
50  // We can not integrate 2-dimensional functions
51  return kFALSE ;
52  }
53  virtual Bool_t canIntegrateND() const {
54  // We can not integrate >2-dimensional functions
55  return kFALSE ;
56  }
57  virtual Bool_t canIntegrateOpenEnded() const {
58  // We can integrate over open-ended domains
59  return kTRUE ;
60  }
61 
62 protected:
63 
64  friend class RooNumIntFactory ;
65  static void registerIntegrator(RooNumIntFactory& fact) ;
66 
69 
70  friend double RooAdaptiveGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data) ;
71 
73 
75 
77  // Return contents of xx in internal array pointer
78  _x[0] = xx ; return _x ;
79  }
80  Double_t *_x ; //! Current coordinate
81 
82  Double_t _epsAbs ; // Absolute precision
83  Double_t _epsRel ; // Relative precision
84  Int_t _methodKey ; // GSL method key
85  Int_t _maxSeg ; // Maximum number of segments
86  void* _workspace ; // GSL workspace
87 
88  mutable Double_t _xmin; //! Lower integration bound
89  mutable Double_t _xmax; //! Upper integration bound
90 
91  ClassDef(RooAdaptiveGaussKronrodIntegrator1D,0) // 1-dimensional adaptive Gauss-Kronrod numerical integration engine
92 };
93 
94 #endif
double RooAdaptiveGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
Glue function interacing to GSL code.
float xmin
Definition: THbookFile.cxx:93
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual Bool_t setLimits(Double_t *, Double_t *)
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual Bool_t checkLimits() const
Check that our integration range is finite and otherwise return kFALSE.
Bool_t setLimits(Double_t *xmin, Double_t *xmax)
Change our integration limits.
float xmax
Definition: THbookFile.cxx:93
virtual Bool_t setUseIntegrandLimits(Bool_t flag)
Interface function that allows to defer limit definition to integrand definition. ...
double Double_t
Definition: RtypesCore.h:55
virtual RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const
Virtual constructor.
virtual Double_t integral(const Double_t *yvec=0)
Calculate and return integral at at given parameter values.
static void registerIntegrator(RooNumIntFactory &fact)
Register this class with RooNumIntConfig as a possible choice of numeric integrator for one-dimension...
friend double RooAdaptiveGaussKronrodIntegrator1D_GSL_GlueFunction(double x, void *data)
Glue function interacing to GSL code.
const Bool_t kTRUE
Definition: Rtypes.h:91
RooAdaptiveGaussKronrodIntegrator1D()
coverity[UNINIT_CTOR] Default constructor
Bool_t initialize()
Initialize integrator allocate buffers and setup GSL workspace.