Logo ROOT  
Reference Guide
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 
22 RooIntegrator2D implements a numeric two-dimensiona integrator
23 in terms of a recursive application of RooIntegrator1D
24 **/
25 
26 
27 #include "RooFit.h"
28 
29 #include "TClass.h"
30 #include "RooIntegrator2D.h"
31 #include "RooArgSet.h"
32 #include "RooIntegratorBinding.h"
33 #include "RooRealVar.h"
34 #include "RooNumber.h"
35 #include "RooNumIntFactory.h"
36 
37 #include <assert.h>
38 
39 using namespace std;
40 
42 ;
43 
44 
45 ////////////////////////////////////////////////////////////////////////////////
46 /// Register RooIntegrator2D, is parameters and capabilities with RooNumIntFactory
47 
49 {
52  RooNumIntConfig::defaultConfig().method2D().setLabel(proto->IsA()->GetName()) ;
53 }
54 
55 
56 ////////////////////////////////////////////////////////////////////////////////
57 /// Default constructor
58 
60  _xIntegrator(0), _xint(0)
61 {
62 }
63 
64 
65 ////////////////////////////////////////////////////////////////////////////////
66 /// Constructor with a given function binding, summation rule,
67 /// maximum number of steps and conversion tolerance. The integration
68 /// limits are taken from the definition in the function binding.
69 
71  Int_t maxSteps, Double_t eps) :
72  RooIntegrator1D(*(_xint=new RooIntegratorBinding(*(_xIntegrator=new RooIntegrator1D(function,rule,maxSteps,eps)))),rule,maxSteps,eps)
73 {
74 }
75 
76 
77 ////////////////////////////////////////////////////////////////////////////////
78 /// Constructor with a given function binding, summation rule,
79 /// maximum number of steps, conversion tolerance and an explicit
80 /// choice of integration limits on both dimensions.
81 
84  SummationRule rule, Int_t maxSteps, Double_t eps) :
85  RooIntegrator1D(*(_xint=new RooIntegratorBinding(*(_xIntegrator=new RooIntegrator1D(function,ymin,ymax,rule,maxSteps,eps)))),xmin,xmax,rule,maxSteps,eps)
86 {
87 }
88 
89 
90 ////////////////////////////////////////////////////////////////////////////////
91 /// Constructor with a function binding and a configuration object.
92 /// The integration limits are taken from the definition in the function
93 /// binding
94 
96  RooIntegrator1D(*(_xint=new RooIntegratorBinding(*(_xIntegrator=new RooIntegrator1D(function,config)))),config)
97 {
98 }
99 
100 
101 
102 ////////////////////////////////////////////////////////////////////////////////
103 /// Constructor with a function binding, a configuration object and
104 /// an explicit definition of the integration limits.
105 
108  const RooNumIntConfig& config) :
109  RooIntegrator1D(*(_xint=new RooIntegratorBinding(*(_xIntegrator=new RooIntegrator1D(function,ymin,ymax,config)))),xmin,xmax,config)
110 {
111 }
112 
113 
114 ////////////////////////////////////////////////////////////////////////////////
115 /// Clone integrator with new function and configuration. Needed to support RooNumIntFactory
116 
118 {
119  return new RooIntegrator2D(function,config) ;
120 }
121 
122 
123 
124 ////////////////////////////////////////////////////////////////////////////////
125 /// Destructor
126 
128 {
129  delete _xint ;
130  delete _xIntegrator ;
131 }
132 
133 
134 ////////////////////////////////////////////////////////////////////////////////
135 /// Verify that the limits are OK for this integrator (i.e. no open-ended ranges)
136 
138 {
140  ret &= _xIntegrator->checkLimits() ;
141  return ret ;
142 }
RooNumIntFactory
Definition: RooNumIntFactory.h:30
ymax
float ymax
Definition: THbookFile.cxx:95
RooIntegratorBinding.h
RooIntegrator2D::clone
virtual RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const
Clone integrator with new function and configuration. Needed to support RooNumIntFactory.
Definition: RooIntegrator2D.cxx:117
RooFit.h
RooIntegrator2D::registerIntegrator
static void registerIntegrator(RooNumIntFactory &fact)
Register RooIntegrator2D, is parameters and capabilities with RooNumIntFactory.
Definition: RooIntegrator2D.cxx:48
RooArgSet.h
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
xmax
float xmax
Definition: THbookFile.cxx:95
RooIntegrator1D::checkLimits
virtual Bool_t checkLimits() const
Check that our integration range is finite and otherwise return kFALSE.
Definition: RooIntegrator1D.cxx:256
RooIntegrator2D::RooIntegrator2D
RooIntegrator2D()
Default constructor.
Definition: RooIntegrator2D.cxx:59
TClass.h
RooIntegrator2D.h
bool
RooAbsFunc
Definition: RooAbsFunc.h:23
RooCategory::setLabel
virtual Bool_t setLabel(const char *label, bool printError=true) override
Set value by specifying the name of the desired state.
Definition: RooCategory.cxx:185
RooIntegrator2D::_xIntegrator
RooIntegrator1D * _xIntegrator
Definition: RooIntegrator2D.h:65
xmin
float xmin
Definition: THbookFile.cxx:95
RooIntegrator1D
Definition: RooIntegrator1D.h:22
ROOT::R::function
void function(const Char_t *name_, T fun, const Char_t *docstring=0)
Definition: RExports.h:151
RooNumIntConfig::method2D
RooCategory & method2D()
Definition: RooNumIntConfig.h:35
RooIntegrator2D::checkLimits
virtual Bool_t checkLimits() const
Verify that the limits are OK for this integrator (i.e. no open-ended ranges)
Definition: RooIntegrator2D.cxx:137
RooNumIntConfig::defaultConfig
static RooNumIntConfig & defaultConfig()
Return reference to instance of default numeric integrator configuration object.
Definition: RooNumIntConfig.cxx:48
RooNumIntFactory::storeProtoIntegrator
Bool_t storeProtoIntegrator(RooAbsIntegrator *proto, const RooArgSet &defConfig, const char *depName="")
Method accepting registration of a prototype numeric integrator along with a RooArgSet of its default...
Definition: RooNumIntFactory.cxx:119
RooRealVar.h
ymin
float ymin
Definition: THbookFile.cxx:95
RooIntegrator2D::_xint
RooAbsFunc * _xint
Definition: RooIntegrator2D.h:66
RooNumber.h
RooIntegrator1D::SummationRule
SummationRule
Definition: RooIntegrator1D.h:40
proto
const char * proto
Definition: civetweb.c:16604
Double_t
double Double_t
Definition: RtypesCore.h:59
RooIntegratorBinding
Definition: RooIntegratorBinding.h:22
RooNumIntConfig
Definition: RooNumIntConfig.h:25
RooIntegrator2D
Definition: RooIntegrator2D.h:22
RooAbsIntegrator
Definition: RooAbsIntegrator.h:22
Class
void Class()
Definition: Class.C:29
RooIntegrator2D::~RooIntegrator2D
virtual ~RooIntegrator2D()
Destructor.
Definition: RooIntegrator2D.cxx:127
RooNumIntFactory.h
RooArgSet
Definition: RooArgSet.h:28
int