Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooIntegrator2D.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 RooIntegrator2D.cxx
19\class RooIntegrator2D
20\ingroup Roofitcore
21
22RooIntegrator2D implements a numeric two-dimensiona integrator
23in terms of a recursive application of RooIntegrator1D
24**/
25
26
27#include "TClass.h"
28#include "RooIntegrator2D.h"
29#include "RooArgSet.h"
31#include "RooRealVar.h"
32#include "RooNumber.h"
33#include "RooNumIntFactory.h"
34
35#include <assert.h>
36
37using namespace std;
38
40;
41
42
43////////////////////////////////////////////////////////////////////////////////
44/// Register RooIntegrator2D, is parameters and capabilities with RooNumIntFactory
45
47{
51}
52
53
54////////////////////////////////////////////////////////////////////////////////
55/// Default constructor
56
58 _xIntegrator(0), _xint(0)
59{
60}
61
62
63////////////////////////////////////////////////////////////////////////////////
64/// Constructor with a given function binding, summation rule,
65/// maximum number of steps and conversion tolerance. The integration
66/// limits are taken from the definition in the function binding.
67
69 Int_t maxSteps, double eps) :
70 RooIntegrator1D(*(_xint=new RooIntegratorBinding(*(_xIntegrator=new RooIntegrator1D(function,rule,maxSteps,eps)))),rule,maxSteps,eps)
71{
72}
73
74
75////////////////////////////////////////////////////////////////////////////////
76/// Constructor with a given function binding, summation rule,
77/// maximum number of steps, conversion tolerance and an explicit
78/// choice of integration limits on both dimensions.
79
80RooIntegrator2D::RooIntegrator2D(const RooAbsFunc& function, double xmin, double xmax,
81 double ymin, double ymax,
82 SummationRule rule, Int_t maxSteps, double eps) :
83 RooIntegrator1D(*(_xint=new RooIntegratorBinding(*(_xIntegrator=new RooIntegrator1D(function,ymin,ymax,rule,maxSteps,eps)))),xmin,xmax,rule,maxSteps,eps)
84{
85}
86
87
88////////////////////////////////////////////////////////////////////////////////
89/// Constructor with a function binding and a configuration object.
90/// The integration limits are taken from the definition in the function
91/// binding
92
94 RooIntegrator1D(*(_xint=new RooIntegratorBinding(*(_xIntegrator=new RooIntegrator1D(function,config)))),config)
95{
96}
97
98
99
100////////////////////////////////////////////////////////////////////////////////
101/// Constructor with a function binding, a configuration object and
102/// an explicit definition of the integration limits.
103
104RooIntegrator2D::RooIntegrator2D(const RooAbsFunc& function, double xmin, double xmax,
105 double ymin, double ymax,
106 const RooNumIntConfig& config) :
107 RooIntegrator1D(*(_xint=new RooIntegratorBinding(*(_xIntegrator=new RooIntegrator1D(function,ymin,ymax,config)))),xmin,xmax,config)
108{
109}
110
111
112////////////////////////////////////////////////////////////////////////////////
113/// Clone integrator with new function and configuration. Needed to support RooNumIntFactory
114
116{
117 return new RooIntegrator2D(function,config) ;
118}
119
120
121
122////////////////////////////////////////////////////////////////////////////////
123/// Destructor
124
126{
127 delete _xint ;
128 delete _xIntegrator ;
129}
130
131
132////////////////////////////////////////////////////////////////////////////////
133/// Verify that the limits are OK for this integrator (i.e. no open-ended ranges)
134
136{
137 bool ret = RooIntegrator1D::checkLimits() ;
138 ret &= _xIntegrator->checkLimits() ;
139 return ret ;
140}
#define ClassImp(name)
Definition Rtypes.h:377
float xmin
float ymin
float xmax
float ymax
const char * proto
Definition civetweb.c:17502
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...
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:55
bool setLabel(const char *label, bool printError=true) override
Set value by specifying the name of the desired state.
RooIntegrator1D implements an adaptive one-dimensional numerical integration algorithm.
static TClass * Class()
bool checkLimits() const override
Check that our integration range is finite and otherwise return false.
RooIntegrator2D implements a numeric two-dimensiona integrator in terms of a recursive application of...
RooAbsFunc * _xint
Function binding representing integral over first dimension.
static void registerIntegrator(RooNumIntFactory &fact)
Register RooIntegrator2D, is parameters and capabilities with RooNumIntFactory.
~RooIntegrator2D() override
Destructor.
bool checkLimits() const override
Verify that the limits are OK for this integrator (i.e. no open-ended ranges)
RooIntegrator1D * _xIntegrator
Integrator in first dimension.
RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const override
Clone integrator with new function and configuration. Needed to support RooNumIntFactory.
RooIntegrator2D()
Default constructor.
Function binding representing the output of a RooAbsIntegrator.
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
RooCategory & method2D()
static RooNumIntConfig & defaultConfig()
Return reference to instance of default numeric integrator configuration object.
RooNumIntFactory is a factory to instantiate numeric integrators from a given function binding and a ...
bool storeProtoIntegrator(RooAbsIntegrator *proto, const RooArgSet &defConfig, const char *depName="")
Method accepting registration of a prototype numeric integrator along with a RooArgSet of its default...
virtual const char * GetName() const
Returns name of object.
Definition TObject.cxx:439