Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooImproperIntegrator1D.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooImproperIntegrator1D.h,v 1.12 2007/05/11 09:11:30 verkerke Exp $
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#ifndef ROO_IMPROPER_INTEGRATOR_1D
17#define ROO_IMPROPER_INTEGRATOR_1D
18
19#include "RooAbsIntegrator.h"
20#include "RooNumIntConfig.h"
21
22class RooInvTransform;
23class RooIntegrator1D;
24
26public:
27
29 RooImproperIntegrator1D(const RooAbsFunc& function);
30 RooImproperIntegrator1D(const RooAbsFunc& function, const RooNumIntConfig& config);
31 RooImproperIntegrator1D(const RooAbsFunc& function, double xmin, double xmax, const RooNumIntConfig& config);
32 RooAbsIntegrator* clone(const RooAbsFunc& function, const RooNumIntConfig& config) const override ;
33
34 bool checkLimits() const override;
36 bool setLimits(double* xmin, double* xmax) override;
37 bool setUseIntegrandLimits(bool flag) override {_useIntegrandLimits = flag ; return true ; }
38 double integral(const double* yvec=nullptr) override ;
39
40 bool canIntegrate1D() const override { return true ; }
41 bool canIntegrate2D() const override { return false ; }
42 bool canIntegrateND() const override { return false ; }
43 bool canIntegrateOpenEnded() const override { return true ; }
44
45protected:
46
47 friend class RooNumIntFactory ;
48 static void registerIntegrator(RooNumIntFactory& fact) ;
49
50 void initialize(const RooAbsFunc* function=nullptr) ;
51
54 LimitsCase limitsCase() const;
55 LimitsCase _case; ///< Configuration of limits
56 mutable double _xmin, _xmax; ///< Value of limits
57 bool _useIntegrandLimits; ///< Use limits in function binding?
58
59 RooAbsFunc* _origFunc = nullptr; ///< Original function binding
60 std::unique_ptr<RooInvTransform> _function; ///< Binding with inverse of function
61 RooNumIntConfig _config ; ///< Configuration object
62 mutable std::unique_ptr<RooIntegrator1D> _integrator1; ///< Piece integrator 1
63 mutable std::unique_ptr<RooIntegrator1D> _integrator2; ///< Piece integrator 2
64 mutable std::unique_ptr<RooIntegrator1D> _integrator3; ///< Piece integrator 3
65
66 ClassDefOverride(RooImproperIntegrator1D,0) // 1-dimensional improper integration engine
67};
68
69#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
float xmin
float xmax
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition RooAbsFunc.h:27
RooAbsIntegrator is the abstract interface for integrators of real-valued functions that implement th...
virtual bool setLimits(double *, double *)
Special numeric integrator that can handle integrals over open domains.
std::unique_ptr< RooInvTransform > _function
Binding with inverse of function.
std::unique_ptr< RooIntegrator1D > _integrator2
Piece integrator 2.
bool canIntegrate1D() const override
LimitsCase limitsCase() const
Classify the type of limits we have: OpenBothEnds,ClosedBothEnds,OpenBelow or OpenAbove.
double integral(const double *yvec=nullptr) override
Calculate the integral at the given parameter values of the function binding.
RooImproperIntegrator1D()
Default constructor.
LimitsCase _case
Configuration of limits.
double _xmax
Value of limits.
bool checkLimits() const override
Check if the limits are valid.
RooAbsFunc * _origFunc
Original function binding.
bool setUseIntegrandLimits(bool flag) override
Interface function that allows to defer limit definition to integrand definition.
std::unique_ptr< RooIntegrator1D > _integrator3
Piece integrator 3.
void initialize(const RooAbsFunc *function=nullptr)
Initialize the integrator, construct and initialize subintegrators.
bool setLimits(double *xmin, double *xmax) override
Change our integration limits.
RooAbsIntegrator * clone(const RooAbsFunc &function, const RooNumIntConfig &config) const override
Return clone of integrator with given function and configuration. Needed by RooNumIntFactory.
bool canIntegrateOpenEnded() const override
bool canIntegrate2D() const override
std::unique_ptr< RooIntegrator1D > _integrator1
Piece integrator 1.
bool canIntegrateND() const override
RooNumIntConfig _config
Configuration object.
static void registerIntegrator(RooNumIntFactory &fact)
Register RooImproperIntegrator1D, its parameters and capabilities with RooNumIntFactory.
bool _useIntegrandLimits
Use limits in function binding?
RooIntegrator1D implements an adaptive one-dimensional numerical integration algorithm.
Lightweight function binding that returns the inverse of an input function binding.
RooNumIntConfig holds the configuration parameters of the various numeric integrators used by RooReal...
RooNumIntFactory is a factory to instantiate numeric integrators from a given function binding and a ...