Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooBinIntegrator.h
Go to the documentation of this file.
1/// \cond ROOFIT_INTERNAL
2
3/*****************************************************************************
4 * Project: RooFit *
5 * Package: RooFitCore *
6 * File: $Id$
7 * Authors: *
8 * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
9 * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
10 * *
11 * Copyright (c) 2000-2005, Regents of the University of California *
12 * and Stanford University. All rights reserved. *
13 * *
14 * Redistribution and use in source and binary forms, *
15 * with or without modification, are permitted according to the terms *
16 * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
17 *****************************************************************************/
18#ifndef ROO_BIN_INTEGRATOR
19#define ROO_BIN_INTEGRATOR
20
21#include "RooAbsIntegrator.h"
22#include "RooNumIntConfig.h"
23#include "Math/Util.h"
24#include <vector>
25
27public:
28 // Constructors, assignment etc
29
30 RooBinIntegrator(const RooAbsFunc &function, int numBins = 100);
31 RooBinIntegrator(const RooAbsFunc &function, const RooNumIntConfig &config);
32
33 bool checkLimits() const override;
34 double integral(const double *yvec = nullptr) override;
35
37 bool setLimits(double *xmin, double *xmax) override;
38 bool setUseIntegrandLimits(bool flag) override
39 {
40 _useIntegrandLimits = flag;
41 return true;
42 }
43
44protected:
45 friend class RooNumIntFactory;
46 static void registerIntegrator(RooNumIntFactory &fact);
48
49 // Numerical integrator workspace
50 mutable std::vector<double> _xmin; ///<! Lower integration bound
51 mutable std::vector<double> _xmax; ///<! Upper integration bound
52 std::vector<std::vector<double>> _binb; ///<! list of bin boundaries
53 mutable Int_t _numBins = 0; ///<! Size of integration range
54
55 bool _useIntegrandLimits = false; ///< If true limits of function binding are used
56
57 void recursive_integration(const UInt_t d, const double delta, ROOT::Math::KahanSum<double>& sum);
58
59 std::vector<double> _x; ///<! do not persist, store here N-dimensional evaluation point when integrating
60};
61
62#endif
63
64/// \endcond
#define d(i)
Definition RSha256.hxx:102
int Int_t
Definition RtypesCore.h:45
unsigned int UInt_t
Definition RtypesCore.h:46
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
float xmin
float xmax
The Kahan summation is a compensated summation algorithm, which significantly reduces numerical error...
Definition Util.h:136
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition RooAbsFunc.h:27
Abstract interface for integrators of real-valued functions that implement the RooAbsFunc interface.
virtual bool setLimits(double *, double *)
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
Factory to instantiate numeric integrators from a given function binding and a given configuration.
static uint64_t sum(uint64_t i)
Definition Factory.cxx:2345