ROOT  6.06/09
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 
24 public:
25 
26  // Constructors, assignment etc
28 
29  RooBinIntegrator(const RooAbsFunc& function) ;
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 
47 protected:
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
float xmin
Definition: THbookFile.cxx:93
virtual ~RooBinIntegrator()
Destructor.
Double_t * xvec(Double_t &xx, Double_t &yy)
virtual Bool_t canIntegrateOpenEnded() const
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 *)
virtual Bool_t canIntegrateND() const
std::vector< std::list< Double_t > * > _binb
Upper integration bound.
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const
Clone integrator with new function binding and configuration. Needed by RooNumIntFactory.
Bool_t _useIntegrandLimits
Size of integration range.
virtual Bool_t checkLimits() const
Check that our integration range is finite and otherwise return kFALSE.
virtual Bool_t canIntegrate2D() const
virtual Bool_t canIntegrate1D() const
float xmax
Definition: THbookFile.cxx:93
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. ...
static void registerIntegrator(RooNumIntFactory &fact)
Register RooBinIntegrator, is parameters and capabilities with RooNumIntFactory.
Double_t * xvec(Double_t &xx)
double Double_t
Definition: RtypesCore.h:55
std::vector< Double_t > _xmax
Lower integration bound.
Bool_t setLimits(Double_t *xmin, Double_t *xmax)
Change our integration limits.
Double_t * xvec(Double_t &xx, Double_t &yy, Double_t &zz)
std::vector< Double_t > _xmin
RooBinIntegrator()
Default constructor.
virtual Double_t integral(const Double_t *yvec=0)
Calculate numeric integral at given set of function binding parameters.
const Bool_t kTRUE
Definition: Rtypes.h:91