Logo ROOT   6.18/05
Reference Guide
RooBinIntegrator.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id$
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_BIN_INTEGRATOR
17#define ROO_BIN_INTEGRATOR
18
19#include "RooAbsIntegrator.h"
20#include "RooNumIntConfig.h"
21#include <vector>
22
24public:
25
26 // Constructors, assignment etc
28
30 RooBinIntegrator(const RooAbsFunc& function, const RooNumIntConfig& config) ;
31
32 virtual RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const ;
33 virtual ~RooBinIntegrator();
34
35 virtual Bool_t checkLimits() const;
36 virtual Double_t integral(const Double_t *yvec=0) ;
37
40 virtual Bool_t setUseIntegrandLimits(Bool_t flag) {_useIntegrandLimits = flag ; return kTRUE ; }
41
42 virtual Bool_t canIntegrate1D() const { return kTRUE ; }
43 virtual Bool_t canIntegrate2D() const { return kTRUE ; }
44 virtual Bool_t canIntegrateND() const { return kTRUE ; }
45 virtual Bool_t canIntegrateOpenEnded() const { return kFALSE ; }
46
47protected:
48
49 friend class RooNumIntFactory ;
50 static void registerIntegrator(RooNumIntFactory& fact) ;
52
53 // Numerical integrator workspace
54 mutable std::vector<Double_t> _xmin; //! Lower integration bound
55 mutable std::vector<Double_t> _xmax; //! Upper integration bound
56 std::vector<std::list<Double_t>*> _binb ; //! list of bin boundaries
57 mutable Int_t _numBins; //! Size of integration range
58
59 Bool_t _useIntegrandLimits; // If true limits of function binding are ued
60
61 Double_t* xvec(Double_t& xx) { _x[0] = xx ; return _x ; }
62 Double_t* xvec(Double_t& xx, Double_t &yy) { _x[0] = xx ; _x[1] = yy ; return _x ; }
63 Double_t* xvec(Double_t& xx, Double_t &yy, Double_t &zz) { _x[0] = xx ; _x[1] = yy ; _x[2] = zz ; return _x ; }
64
65 Double_t *_x ; //! do not persist
66
67 ClassDef(RooBinIntegrator,0) // 1-dimensional numerical integration engine
68};
69
70#endif
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
const Bool_t kTRUE
Definition: RtypesCore.h:87
#define ClassDef(name, id)
Definition: Rtypes.h:326
float xmin
Definition: THbookFile.cxx:93
float xmax
Definition: THbookFile.cxx:93
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition: RooAbsFunc.h:23
RooAbsIntegrator is the abstract interface for integrators of real-valued functions that implement th...
virtual Bool_t setLimits(Double_t *, Double_t *)
RooBinIntegrator implements an adaptive one-dimensional numerical integration algorithm.
std::vector< std::list< Double_t > * > _binb
Upper integration bound.
std::vector< Double_t > _xmin
static void registerIntegrator(RooNumIntFactory &fact)
Register RooBinIntegrator, is parameters and capabilities with RooNumIntFactory.
Double_t * xvec(Double_t &xx)
virtual Bool_t canIntegrate1D() const
RooBinIntegrator(const RooBinIntegrator &)
Double_t * xvec(Double_t &xx, Double_t &yy)
Int_t _numBins
list of bin boundaries
virtual Bool_t setUseIntegrandLimits(Bool_t flag)
Interface function that allows to defer limit definition to integrand definition.
std::vector< Double_t > _xmax
Lower integration bound.
virtual ~RooBinIntegrator()
Destructor.
Bool_t _useIntegrandLimits
Size of integration range.
virtual RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const
Clone integrator with new function binding and configuration. Needed by RooNumIntFactory.
virtual Bool_t canIntegrateOpenEnded() const
virtual Bool_t checkLimits() const
Check that our integration range is finite and otherwise return kFALSE.
virtual Double_t integral(const Double_t *yvec=0)
Calculate numeric integral at given set of function binding parameters.
Double_t * xvec(Double_t &xx, Double_t &yy, Double_t &zz)
virtual Bool_t canIntegrateND() const
Bool_t setLimits(Double_t *xmin, Double_t *xmax)
Change our integration limits.
RooBinIntegrator()
Default constructor.
virtual Bool_t canIntegrate2D() const
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 ...
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition: RExports.h:151