42using std::endl, std::list;
52 RooRealVar numBins(
"numBins",
"Number of bins in range",100) ;
54 std::string
name =
"RooBinIntegrator";
57 return std::make_unique<RooBinIntegrator>(
function, config);
60 fact.registerPlugin(
name, creator, {numBins},
90 std::unique_ptr<list<double>> tmp{
_function->binBoundaries(i) };
92 oocoutW(
nullptr,Integration) <<
"RooBinIntegrator::RooBinIntegrator WARNING: integrand provide no binning definition observable #"
93 << i <<
" substituting default binning of " <<
_numBins <<
" bins" << endl ;
94 tmp = std::make_unique<list<double>>( );
99 _binb.emplace_back(tmp->begin(), tmp->end());
124 oocoutE(
nullptr,Integration) <<
"RooBinIntegrator::setLimits: cannot override integrand's limits" << endl;
150 oocoutE(
nullptr,Integration) <<
"RooBinIntegrator::checkLimits: bad range with min >= max (_xmin = " <<
_xmin[i] <<
" _xmax = " <<
_xmax[i] <<
")" << endl;
171 const std::vector<double>&
binb =
_binb[0];
176 const double xcenter = (xhi+xlo)/2.;
180 }
else if (
_function->getDimension() == 2) {
198 }
else if (
_function->getDimension() == 3) {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
The Kahan summation is a compensated summation algorithm, which significantly reduces numerical error...
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Abstract interface for integrators of real-valued functions that implement the RooAbsFunc interface.
bool isValid() const
Is integrator in valid state.
const RooAbsFunc * _function
Pointer to function binding of integrand.
const RooAbsFunc * integrand() const
Return integrand function binding.
Computes the integral over a binned distribution by summing the bin contents of all bins.
std::vector< double > _xmax
! Upper integration bound
static void registerIntegrator(RooNumIntFactory &fact)
Register RooBinIntegrator, is parameters and capabilities with RooNumIntFactory.
Int_t _numBins
! Size of integration range
bool setLimits(double *xmin, double *xmax) override
Change our integration limits.
std::vector< std::vector< double > > _binb
! list of bin boundaries
std::vector< double > _xmin
! Lower integration bound
RooBinIntegrator(const RooAbsFunc &function, int numBins=100)
Construct integrator on given function binding binding.
std::vector< double > _x
! do not persist
bool _useIntegrandLimits
If true limits of function binding are ued.
bool checkLimits() const override
Check that our integration range is finite and otherwise return false.
double integral(const double *yvec=nullptr) override
Calculate numeric integral at given set of function binding parameters.
Holds the configuration parameters of the various numeric integrators used by RooRealIntegral.
static RooNumIntConfig & defaultConfig()
Return reference to instance of default numeric integrator configuration object.
Factory to instantiate numeric integrators from a given function binding and a given configuration.
static constexpr int isInfinite(double x)
Return true if x is infinite by RooNumber internal specification.
Variable that can be changed from the outside.
static uint64_t sum(uint64_t i)