Logo ROOT  
Reference Guide
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 /// Destructor
27 inline ~RooAbsIntegrator() override {
28 }
29 virtual RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const = 0 ;
30
31 /// Is integrator in valid state
32 inline bool isValid() const {
33 return _valid;
34 }
35
36 /// Return value of integrand at given observable values
37 inline double integrand(const double x[]) const {
38 return (*_function)(x);
39 }
40
41 /// Return integrand function binding
42 inline const RooAbsFunc *integrand() const {
43 return _function;
44 }
45
46 /// If true, finite limits are required on the observable range
47 inline virtual bool checkLimits() const {
48 return true;
49 }
50
51 double calculate(const double *yvec=0) ;
52 virtual double integral(const double *yvec=0)=0 ;
53
54 virtual bool canIntegrate1D() const = 0 ;
55 virtual bool canIntegrate2D() const = 0 ;
56 virtual bool canIntegrateND() const = 0 ;
57 virtual bool canIntegrateOpenEnded() const = 0 ;
58
59 bool printEvalCounter() const { return _printEvalCounter ; }
61
62 virtual bool setLimits(double*, double*) { return false ; }
63 virtual bool setLimits(double xmin, double xmax) ;
64 virtual bool setUseIntegrandLimits(bool flag) ;
65
66protected:
67
68 const RooAbsFunc *_function; ///< Pointer to function binding of integrand
69 bool _valid; ///< Is integrator in valid state?
70 bool _printEvalCounter ; ///< If true print number of function evaluation required for integration
71
72 ClassDefOverride(RooAbsIntegrator,0) // Abstract interface for real-valued function integrators
73};
74
75#endif
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
float xmin
Definition: THbookFile.cxx:95
float xmax
Definition: THbookFile.cxx:95
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 setUseIntegrandLimits(bool flag)
Interface function that allows to defer limit definition to integrand definition.
bool isValid() const
Is integrator in valid state.
virtual bool canIntegrateOpenEnded() const =0
virtual bool canIntegrateND() const =0
void setPrintEvalCounter(bool value)
double calculate(const double *yvec=0)
Calculate integral value with given array of parameter values.
double integrand(const double x[]) const
Return value of integrand at given observable values.
virtual bool checkLimits() const
If true, finite limits are required on the observable range.
~RooAbsIntegrator() override
Destructor.
const RooAbsFunc * _function
Pointer to function binding of integrand.
RooAbsIntegrator()
Default constructor.
virtual RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const =0
const RooAbsFunc * integrand() const
Return integrand function binding.
bool printEvalCounter() const
virtual bool canIntegrate1D() const =0
bool _valid
Is integrator in valid state?
virtual bool setLimits(double *, double *)
virtual bool canIntegrate2D() const =0
virtual double integral(const double *yvec=0)=0
bool _printEvalCounter
If true print number of function evaluation required for integration.
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
Mother of all ROOT objects.
Definition: TObject.h:37
Double_t x[n]
Definition: legend1.C:17
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition: RExports.h:167