Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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#include <list>
23
25public:
26
27 // Constructors, assignment etc
29
30 RooBinIntegrator(const RooAbsFunc& function) ;
31 RooBinIntegrator(const RooAbsFunc& function, const RooNumIntConfig& config) ;
32
33 virtual RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const ;
34 virtual ~RooBinIntegrator();
35
36 virtual Bool_t checkLimits() const;
37 virtual Double_t integral(const Double_t *yvec=0) ;
38
41 virtual Bool_t setUseIntegrandLimits(Bool_t flag) {_useIntegrandLimits = flag ; return kTRUE ; }
42
43 virtual Bool_t canIntegrate1D() const { return kTRUE ; }
44 virtual Bool_t canIntegrate2D() const { return kTRUE ; }
45 virtual Bool_t canIntegrateND() const { return kTRUE ; }
46 virtual Bool_t canIntegrateOpenEnded() const { return kFALSE ; }
47
48protected:
49
50 friend class RooNumIntFactory ;
51 static void registerIntegrator(RooNumIntFactory& fact) ;
53
54 // Numerical integrator workspace
55 mutable std::vector<Double_t> _xmin; //! Lower integration bound
56 mutable std::vector<Double_t> _xmax; //! Upper integration bound
57 std::vector<std::list<Double_t>*> _binb ; //! list of bin boundaries
58 mutable Int_t _numBins; //! Size of integration range
59
60 Bool_t _useIntegrandLimits; // If true limits of function binding are ued
61
62 Double_t* xvec(Double_t& xx) { _x[0] = xx ; return _x ; }
63 Double_t* xvec(Double_t& xx, Double_t &yy) { _x[0] = xx ; _x[1] = yy ; return _x ; }
64 Double_t* xvec(Double_t& xx, Double_t &yy, Double_t &zz) { _x[0] = xx ; _x[1] = yy ; _x[2] = zz ; return _x ; }
65
66 Double_t *_x ; //! do not persist
67
68 ClassDef(RooBinIntegrator,0) // 1-dimensional numerical integration engine
69};
70
71#endif
const Bool_t kFALSE
Definition RtypesCore.h:92
double Double_t
Definition RtypesCore.h:59
const Bool_t kTRUE
Definition RtypesCore.h:91
#define ClassDef(name, id)
Definition Rtypes.h:325
float xmin
float xmax
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition RooAbsFunc.h:27
RooAbsIntegrator is the abstract interface for integrators of real-valued functions that implement th...
virtual Bool_t setLimits(Double_t *, Double_t *)
RooBinIntegrator computes the integral over a binned distribution by summing the bin contents of all ...
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 ...