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:
25 RooAbsIntegrator(const RooAbsFunc& function, bool printEvalCounter=false);
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=nullptr) ;
52 virtual double integral(const double *yvec=nullptr)=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 = nullptr; ///< Pointer to function binding of integrand
69 bool _valid = false; ///< Is integrator in valid state?
70 bool _printEvalCounter = false; ///< 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:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
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 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 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.
double calculate(const double *yvec=nullptr)
Calculate integral value with given array of parameter values.
~RooAbsIntegrator() override
Destructor.
virtual double integral(const double *yvec=nullptr)=0
const RooAbsFunc * _function
Pointer to function binding of integrand.
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
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:41
Double_t x[n]
Definition legend1.C:17