Logo ROOT   6.18/05
Reference Guide
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
22RooAbsIntegrator is the abstract interface for integrators of real-valued
23functions that implement the RooAbsFunc interface.
24**/
25
26#include "RooFit.h"
27
28#include "Riostream.h"
29
30
31#include "RooAbsIntegrator.h"
32#include "RooAbsIntegrator.h"
33#include "RooMsgService.h"
34#include "TClass.h"
35
36using namespace std;
37
39;
40
41
42////////////////////////////////////////////////////////////////////////////////
43/// Default constructor
44
45RooAbsIntegrator::RooAbsIntegrator() : _function(0), _valid(kFALSE), _printEvalCounter(kFALSE)
46{
47}
48
49
50
51////////////////////////////////////////////////////////////////////////////////
52/// Copy constructor
53
55 _function(&function), _valid(function.isValid()), _printEvalCounter(doPrintEvalCounter)
56{
57}
58
59
60
61////////////////////////////////////////////////////////////////////////////////
62/// Calculate integral value with given array of parameter values
63
65{
67
68 integrand()->saveXVec() ;
69 Double_t ret = integral(yvec) ;
71
72 cxcoutD(NumIntegration) << IsA()->GetName() << "::calculate(" << _function->getName() << ") number of function calls = " << integrand()->numCall()<<", result = "<<ret << endl ;
73 return ret ;
74}
75
76
77
78////////////////////////////////////////////////////////////////////////////////
79/// Interface to set limits on integration
80
82{
83 return setLimits(&xmin,&xmax) ;
84}
85
86
87
88////////////////////////////////////////////////////////////////////////////////
89/// Interface function that allows to defer limit definition to integrand definition
90
92{
93 return kFALSE ;
94}
#define cxcoutD(a)
Definition: RooMsgService.h:79
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
#define ClassImp(name)
Definition: Rtypes.h:365
float xmin
Definition: THbookFile.cxx:93
float xmax
Definition: THbookFile.cxx:93
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition: RooAbsFunc.h:23
virtual void saveXVec() const
Definition: RooAbsFunc.h:51
void resetNumCall() const
Definition: RooAbsFunc.h:46
Int_t numCall() const
Definition: RooAbsFunc.h:42
virtual void restoreXVec() const
Definition: RooAbsFunc.h:54
virtual const char * getName() const
Definition: RooAbsFunc.h:59
RooAbsIntegrator is the abstract interface for integrators of real-valued functions that implement th...
virtual Double_t integral(const Double_t *yvec=0)=0
const RooAbsFunc * _function
RooAbsIntegrator()
Default constructor.
virtual Bool_t setUseIntegrandLimits(Bool_t flag)
Interface function that allows to defer limit definition to integrand definition.
const RooAbsFunc * integrand() const
Double_t calculate(const Double_t *yvec=0)
Calculate integral value with given array of parameter values.
virtual Bool_t setLimits(Double_t *, Double_t *)
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition: RExports.h:151
@ NumIntegration
Definition: RooGlobalFunc.h:59