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