ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RooAbsIntegrator.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooAbsIntegrator.h,v 1.18 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_ABS_INTEGRATOR
17 #define ROO_ABS_INTEGRATOR
18 
19 #include "RooAbsFunc.h"
20 #include "RooNumIntConfig.h"
21 
22 class RooAbsIntegrator : public TObject {
23 public:
26  inline virtual ~RooAbsIntegrator() {
27  // Destructor
28  }
29  virtual RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const = 0 ;
30 
31  inline Bool_t isValid() const {
32  // Is integrator in valid state
33  return _valid;
34  }
35 
36  inline Double_t integrand(const Double_t x[]) const {
37  // Return value of integrand at given observable values
38  return (*_function)(x);
39  }
40  inline const RooAbsFunc *integrand() const {
41  // Return integrand function binding
42  return _function;
43  }
44 
45  inline virtual Bool_t checkLimits() const {
46  // If true, finite limits are required on the observable range
47  return kTRUE;
48  }
49 
50  Double_t calculate(const Double_t *yvec=0) ;
51  virtual Double_t integral(const Double_t *yvec=0)=0 ;
52 
53  virtual Bool_t canIntegrate1D() const = 0 ;
54  virtual Bool_t canIntegrate2D() const = 0 ;
55  virtual Bool_t canIntegrateND() const = 0 ;
56  virtual Bool_t canIntegrateOpenEnded() const = 0 ;
57 
60 
61  virtual Bool_t setLimits(Double_t*, Double_t*) { return kFALSE ; }
63  virtual Bool_t setUseIntegrandLimits(Bool_t flag) ;
64 
65 protected:
66 
67  const RooAbsFunc *_function; // Pointer to function binding of integrand
68  Bool_t _valid; // Is integrator in valid state?
69  Bool_t _printEvalCounter ; // If true print number of function evaluation required for integration
70 
71  ClassDef(RooAbsIntegrator,0) // Abstract interface for real-valued function integrators
72 };
73 
74 #endif
RooAbsIntegrator is the abstract interface for integrators of real-valued functions that implement th...
virtual Bool_t checkLimits() const
float xmin
Definition: THbookFile.cxx:93
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
virtual RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const =0
virtual Bool_t canIntegrateND() const =0
void setPrintEvalCounter(Bool_t value)
virtual Bool_t canIntegrate2D() const =0
bool Bool_t
Definition: RtypesCore.h:59
Double_t calculate(const Double_t *yvec=0)
Calculate integral value with given array of parameter values.
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 Double_t integral(const Double_t *yvec=0)=0
Bool_t printEvalCounter() const
RooAbsIntegrator()
Default constructor.
const RooAbsFunc * _function
float xmax
Definition: THbookFile.cxx:93
Double_t integrand(const Double_t x[]) const
double Double_t
Definition: RtypesCore.h:55
virtual Bool_t setUseIntegrandLimits(Bool_t flag)
Interface function that allows to defer limit definition to integrand definition. ...
Mother of all ROOT objects.
Definition: TObject.h:58
const RooAbsFunc * integrand() const
virtual ~RooAbsIntegrator()
virtual Bool_t canIntegrate1D() const =0
Bool_t isValid() const
const Bool_t kTRUE
Definition: Rtypes.h:91
float value
Definition: math.cpp:443
virtual Bool_t canIntegrateOpenEnded() const =0
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition: RooAbsFunc.h:23