Logo ROOT  
Reference Guide
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 #include "RooSpan.h"
21 #include <vector>
22 #include <memory>
23 
24 class RooAbsRealLValue;
25 class RooAbsReal;
26 class RooArgSet;
27 namespace BatchHelpers{ struct RunContext; }
28 
29 class RooRealBinding : public RooAbsFunc {
30 public:
31  RooRealBinding(const RooAbsReal& func, const RooArgSet &vars, const RooArgSet* nset=0, Bool_t clipInvalid=kFALSE, const TNamed* rangeName=0);
32  RooRealBinding(const RooRealBinding& other, const RooArgSet* nset=0) ;
33  virtual ~RooRealBinding();
34 
35  virtual Double_t operator()(const Double_t xvector[]) const;
36  virtual RooSpan<const double> getValues(std::vector<RooSpan<const double>> coordinates) const;
37  virtual Double_t getMinLimit(UInt_t dimension) const;
38  virtual Double_t getMaxLimit(UInt_t dimension) const;
39 
40  virtual void saveXVec() const ;
41  virtual void restoreXVec() const ;
42 
43  virtual const char* getName() const ;
44 
45  virtual std::list<Double_t>* binBoundaries(Int_t) const ;
46  virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& /*obs*/, Double_t /*xlo*/, Double_t /*xhi*/) const ;
47 
48 protected:
49 
50  void loadValues(const Double_t xvector[]) const;
51  const RooAbsReal *_func;
52  std::vector<RooAbsRealLValue*> _vars; // Non-owned pointers to variables
53  const RooArgSet *_nset;
54  mutable Bool_t _xvecValid;
56  mutable Double_t* _xsave ;
57  const TNamed* _rangeName ; //!
58 
59  mutable std::vector<RooAbsReal*> _compList ; //!
60  mutable std::vector<Double_t> _compSave ; //!
61  mutable Double_t _funcSave ; //!
62  mutable std::unique_ptr<BatchHelpers::RunContext> _evalData; /// Memory for batch evaluations
63 
64  ClassDef(RooRealBinding,0) // Function binding to RooAbsReal object
65 };
66 
67 #endif
68 
RooRealBinding::restoreXVec
virtual void restoreXVec() const
Restore value of all variables to previously saved values by saveXVec()
Definition: RooRealBinding.cxx:144
RooRealBinding::_vars
std::vector< RooAbsRealLValue * > _vars
Definition: RooRealBinding.h:52
RooRealBinding::RooRealBinding
RooRealBinding(const RooAbsReal &func, const RooArgSet &vars, const RooArgSet *nset=0, Bool_t clipInvalid=kFALSE, const TNamed *rangeName=0)
Construct a lightweight function binding of RooAbsReal func to variables 'vars'.
Definition: RooRealBinding.cxx:56
RooRealBinding::getValues
virtual RooSpan< const double > getValues(std::vector< RooSpan< const double >> coordinates) const
Evaluate the bound object at all locations indicated by the data in coordinates.
Definition: RooRealBinding.cxx:208
RooRealBinding::saveXVec
virtual void saveXVec() const
Save value of all variables.
Definition: RooRealBinding.cxx:109
RooRealBinding::_xvecValid
Bool_t _xvecValid
Definition: RooRealBinding.h:54
RooAbsFunc.h
RooRealBinding::_func
const RooAbsReal * _func
Definition: RooRealBinding.h:51
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooRealBinding::getMinLimit
virtual Double_t getMinLimit(UInt_t dimension) const
Return lower limit on i-th variable.
Definition: RooRealBinding.cxx:264
RooRealBinding::getMaxLimit
virtual Double_t getMaxLimit(UInt_t dimension) const
Return upper limit on i-th variable.
Definition: RooRealBinding.cxx:275
bool
RooAbsFunc
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition: RooAbsFunc.h:27
RooRealBinding::_compList
std::vector< RooAbsReal * > _compList
Definition: RooRealBinding.h:59
RooRealBinding::operator()
virtual Double_t operator()(const Double_t xvector[]) const
Evaluate the bound RooAbsReal at the variable values provided in xvector.
Definition: RooRealBinding.cxx:190
BatchHelpers
Definition: RooFitComputeInterface.h:9
RooRealBinding
Lightweight interface adaptor that binds a RooAbsReal object to a subset of its servers and present i...
Definition: RooRealBinding.h:29
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
RooRealBinding::_funcSave
Double_t _funcSave
Definition: RooRealBinding.h:61
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooRealBinding::getName
virtual const char * getName() const
Return name of function.
Definition: RooRealBinding.cxx:285
RooRealBinding::plotSamplingHint
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Definition: RooRealBinding.cxx:293
RooRealBinding::binBoundaries
virtual std::list< Double_t > * binBoundaries(Int_t) const
Definition: RooRealBinding.cxx:301
RooRealBinding::_nset
const RooArgSet * _nset
Definition: RooRealBinding.h:53
unsigned int
RooRealBinding::loadValues
void loadValues(const Double_t xvector[]) const
Load the vector of variable values into the RooRealVars associated as variables with the bound RooAbs...
Definition: RooRealBinding.cxx:172
Double_t
double Double_t
Definition: RtypesCore.h:59
RooRealBinding::_evalData
std::unique_ptr< BatchHelpers::RunContext > _evalData
Definition: RooRealBinding.h:62
RooRealBinding::~RooRealBinding
virtual ~RooRealBinding()
Destructor.
Definition: RooRealBinding.cxx:99
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooRealBinding::_rangeName
const TNamed * _rangeName
Definition: RooRealBinding.h:57
RooRealBinding::_compSave
std::vector< Double_t > _compSave
Definition: RooRealBinding.h:60
RooRealBinding::_xsave
Double_t * _xsave
Definition: RooRealBinding.h:56
RooSpan.h
RooAbsRealLValue
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Definition: RooAbsRealLValue.h:31
RooRealBinding::_clipInvalid
Bool_t _clipInvalid
Definition: RooRealBinding.h:55
RooSpan
A simple container to hold a batch of data values.
Definition: RooSpan.h:34
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:29
int