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
27 /// Is integrator in valid state
28 inline bool isValid() const {
29 return _valid;
30 }
31
32 /// Return value of integrand at given observable values
33 inline double integrand(const double x[]) const {
34 return (*_function)(x);
35 }
36
37 /// Return integrand function binding
38 inline const RooAbsFunc *integrand() const {
39 return _function;
40 }
41
42 /// If true, finite limits are required on the observable range
43 inline virtual bool checkLimits() const {
44 return true;
45 }
46
47 double calculate(const double *yvec=nullptr) ;
48 virtual double integral(const double *yvec=nullptr)=0 ;
49
50 bool printEvalCounter() const { return _printEvalCounter ; }
52
53 virtual bool setLimits(double*, double*) { return false ; }
54 virtual bool setLimits(double xmin, double xmax) ;
55 virtual bool setUseIntegrandLimits(bool flag) ;
56
57protected:
58
59 const RooAbsFunc *_function = nullptr; ///< Pointer to function binding of integrand
60 bool _valid = false; ///< Is integrator in valid state?
61 bool _printEvalCounter = false; ///< If true print number of function evaluation required for integration
62
63 ClassDefOverride(RooAbsIntegrator,0) // Abstract interface for real-valued function integrators
64};
65
66#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
Abstract interface for integrators of real-valued functions that implement the RooAbsFunc interface.
virtual bool setUseIntegrandLimits(bool flag)
Interface function that allows to defer limit definition to integrand definition.
bool isValid() const
Is integrator in valid state.
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.
virtual double integral(const double *yvec=nullptr)=0
const RooAbsFunc * _function
Pointer to function binding of integrand.
const RooAbsFunc * integrand() const
Return integrand function binding.
bool printEvalCounter() const
bool _valid
Is integrator in valid state?
virtual bool setLimits(double *, double *)
bool _printEvalCounter
If true print number of function evaluation required for integration.
Mother of all ROOT objects.
Definition TObject.h:41
Double_t x[n]
Definition legend1.C:17