File indexing completed on 2025-01-18 10:11:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef ROO_FUNCTOR
0017 #define ROO_FUNCTOR
0018
0019 #include "RooArgSet.h"
0020 #include "RooAbsReal.h"
0021
0022 class RooAbsFunc ;
0023 class RooAbsPdf ;
0024
0025 class RooFunctor {
0026
0027 public:
0028 RooFunctor(const RooAbsFunc& func) ;
0029 RooFunctor(const RooAbsReal& func, const RooArgList& observables, const RooArgList& parameters) ;
0030 RooFunctor(const RooAbsReal& func, const RooArgList& observables, const RooArgList& parameters, const RooArgSet& nset) ;
0031 RooFunctor(const RooFunctor&) ;
0032 virtual ~RooFunctor() ;
0033
0034 Int_t nObs() const {
0035
0036 return _nobs ;
0037 }
0038 Int_t nPar() const {
0039
0040 return _npar ;
0041 }
0042
0043 double operator()(double x) const { return eval(x) ; }
0044 double operator()(const double* x, const double* p) const { return eval(x,p) ; }
0045 double operator()(const double* x) const { return eval(x) ; }
0046
0047 double eval(const double* , const double* ) const ;
0048 double eval(const double* ) const ;
0049 double eval(double ) const ;
0050
0051 inline RooAbsFunc& binding() { return _ownedBinding ? *_ownedBinding : *_binding; }
0052 inline RooAbsFunc const& binding() const { return _ownedBinding ? *_ownedBinding : *_binding; }
0053
0054 protected:
0055
0056 std::unique_ptr<RooAbsFunc> _ownedBinding;
0057 RooArgSet _nset;
0058 RooAbsFunc *_binding = nullptr;
0059 mutable std::vector<double> _x;
0060 Int_t _npar = 0;
0061 Int_t _nobs;
0062
0063 ClassDef(RooFunctor,0)
0064 };
0065
0066 #endif