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
26class RooBinIntegrator : public RooAbsIntegrator {
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);
47 RooBinIntegrator(const RooBinIntegrator &);
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
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
Definition RtypesCore.h:60
float xmin
float xmax
Abstract interface for integrators of real-valued functions that implement the RooAbsFunc interface.
virtual bool setUseIntegrandLimits(bool flag)
Interface function that allows to defer limit definition to integrand definition.
virtual bool checkLimits() const
If true, finite limits are required on the observable range.
virtual double integral(const double *yvec=nullptr)=0
virtual bool setLimits(double *, double *)
static uint64_t sum(uint64_t i)
Definition Factory.cxx:2338