Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAbsIntegrator.cxx
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * @(#)root/roofitcore:$Id$
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
17/**
18\file RooAbsIntegrator.cxx
19\class RooAbsIntegrator
20\ingroup Roofitcore
21
22Abstract interface for integrators of real-valued
23functions that implement the RooAbsFunc interface.
24**/
25
26#include "RooAbsIntegrator.h"
27#include "RooMsgService.h"
28
29#include <ostream>
30
31using std::endl;
32
34
35////////////////////////////////////////////////////////////////////////////////
36/// Copy constructor
37
39 _function(&function), _valid(function.isValid()), _printEvalCounter(doPrintEvalCounter)
40{
41}
42
43
44
45////////////////////////////////////////////////////////////////////////////////
46/// Calculate integral value with given array of parameter values
47
48double RooAbsIntegrator::calculate(const double *yvec)
49{
50 integrand()->resetNumCall() ;
51
52 integrand()->saveXVec() ;
53 double ret = integral(yvec) ;
54 integrand()->restoreXVec() ;
56 oocxcoutD(static_cast<TObject*>(nullptr), NumericIntegration) << "RooAbsIntegrator::calculate(" << _function->getName() << ") number of function calls = " << integrand()->numCall()<<", result = "<<ret << std::endl ;
57 return ret ;
58}
59
60
61
62////////////////////////////////////////////////////////////////////////////////
63/// Interface to set limits on integration
64
66{
67 return setLimits(&xmin,&xmax) ;
68}
69
70
71
72////////////////////////////////////////////////////////////////////////////////
73/// Interface function that allows to defer limit definition to integrand definition
74
76{
77 return false ;
78}
#define oocxcoutD(o, a)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
float xmin
float xmax
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition RooAbsFunc.h:27
virtual bool setUseIntegrandLimits(bool flag)
Interface function that allows to defer limit definition to integrand definition.
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.
virtual bool setLimits(double *, double *)
Mother of all ROOT objects.
Definition TObject.h:42