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