Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
22class RooAbsIntegrator : public TObject {
23public:
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
65protected:
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
const Bool_t kFALSE
Definition RtypesCore.h:101
double Double_t
Definition RtypesCore.h:59
const Bool_t kTRUE
Definition RtypesCore.h:100
#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 ~RooAbsIntegrator()
Double_t integrand(const Double_t x[]) const
virtual Bool_t canIntegrateND() const =0
virtual Double_t integral(const Double_t *yvec=0)=0
virtual Bool_t canIntegrateOpenEnded() const =0
Bool_t printEvalCounter() const
const RooAbsFunc * _function
RooAbsIntegrator()
Default constructor.
virtual Bool_t setUseIntegrandLimits(Bool_t flag)
Interface function that allows to defer limit definition to integrand definition.
virtual Bool_t canIntegrate2D() const =0
virtual RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const =0
const RooAbsFunc * integrand() const
Double_t calculate(const Double_t *yvec=0)
Calculate integral value with given array of parameter values.
virtual Bool_t canIntegrate1D() const =0
virtual Bool_t checkLimits() const
Bool_t isValid() const
virtual Bool_t setLimits(Double_t *, Double_t *)
void setPrintEvalCounter(Bool_t value)
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
Mother of all ROOT objects.
Definition TObject.h:41
Double_t x[n]
Definition legend1.C:17