Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooRealBinding.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooRealBinding.h,v 1.9 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_REAL_BINDING
17#define ROO_REAL_BINDING
18
19#include "RooAbsFunc.h"
20
21#include <ROOT/RSpan.hxx>
22
23#include <vector>
24#include <memory>
25
27class RooAbsReal;
28class RooArgSet;
29
30class RooRealBinding : public RooAbsFunc {
31public:
32 RooRealBinding(const RooAbsReal& func, const RooArgSet &vars, const RooArgSet* nset=nullptr, bool clipInvalid=false, const TNamed* rangeName=nullptr);
33 RooRealBinding(const RooRealBinding& other, const RooArgSet* nset=nullptr) ;
34 ~RooRealBinding() override;
35
36 double operator()(const double xvector[]) const override;
37 double getMinLimit(UInt_t dimension) const override;
38 double getMaxLimit(UInt_t dimension) const override;
39
40 void saveXVec() const override ;
41 void restoreXVec() const override ;
42
43 const char* getName() const override ;
44
45 std::list<double>* binBoundaries(Int_t) const override ;
46 /// Return a pointer to the observable that defines the `i`-th dimension of the function.
47 RooAbsRealLValue* observable(unsigned int i) const { return i < _vars.size() ? _vars[i] : nullptr; }
48 std::list<double>* plotSamplingHint(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const override ;
49
50protected:
51
52 void loadValues(const double xvector[]) const;
54 std::vector<RooAbsRealLValue*> _vars; ///< Non-owned pointers to variables
56 mutable bool _xvecValid;
58 mutable std::vector<double> _xsave ;
59 const TNamed* _rangeName ; ///<!
60
61 mutable std::vector<RooAbsReal*> _compList ; ///<!
62 mutable std::vector<double> _compSave ; ///<!
63 mutable double _funcSave ; ///<!
64
65 ClassDefOverride(RooRealBinding,0) // Function binding to RooAbsReal object
66};
67
68#endif
69
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition RooAbsFunc.h:27
Abstract base class for objects that represent a real value that may appear on the left hand side of ...
Abstract base class for objects that represent a real value and implements functionality common to al...
Definition RooAbsReal.h:59
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition RooArgSet.h:24
Lightweight interface adaptor that binds a RooAbsReal object to a subset of its servers and present i...
std::list< double > * plotSamplingHint(RooAbsRealLValue &, double, double) const override
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
double getMinLimit(UInt_t dimension) const override
Return lower limit on i-th variable.
~RooRealBinding() override
std::vector< double > _xsave
double operator()(const double xvector[]) const override
Evaluate the bound RooAbsReal at the variable values provided in xvector.
double getMaxLimit(UInt_t dimension) const override
Return upper limit on i-th variable.
void restoreXVec() const override
Restore value of all variables to previously saved values by saveXVec()
std::list< double > * binBoundaries(Int_t) const override
std::vector< RooAbsRealLValue * > _vars
Non-owned pointers to variables.
RooAbsRealLValue * observable(unsigned int i) const
Return a pointer to the observable that defines the i-th dimension of the function.
std::vector< RooAbsReal * > _compList
!
std::vector< double > _compSave
!
const char * getName() const override
Return name of function.
void loadValues(const double xvector[]) const
Load the vector of variable values into the RooRealVars associated as variables with the bound RooAbs...
const RooArgSet * _nset
const RooAbsReal * _func
const TNamed * _rangeName
!
void saveXVec() const override
Save value of all variables.
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29