Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooAbsFunc.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Project: RooFit *
3 * Package: RooFitCore *
4 * File: $Id: RooAbsFunc.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_ABS_FUNC
17#define ROO_ABS_FUNC
18
19#include "Rtypes.h"
20#include "RooSpan.h"
21
22#include <list>
23#include <vector>
24
25class RooAbsRealLValue ;
26
28public:
29 inline RooAbsFunc(UInt_t dimension) : _ncall(0), _dimension(dimension), _valid(true) { }
30 inline RooAbsFunc(const RooAbsFunc& other) : _ncall(0), _dimension(other._dimension), _valid(true) { }
31
32 inline virtual ~RooAbsFunc() { }
33 inline UInt_t getDimension() const {
34 // Dimension of function
35 return _dimension;
36 }
37 inline bool isValid() const {
38 // Is function in valid state
39 return _valid;
40 }
41
42 virtual double operator()(const double xvector[]) const = 0;
43 virtual double getMinLimit(UInt_t dimension) const = 0;
44 virtual double getMaxLimit(UInt_t dimension) const = 0;
45
46 /// Return number of function calls since last reset
47 Int_t numCall() const {
48 return _ncall ;
49 }
50
51 /// Reset function call counter
52 void resetNumCall() const {
53 _ncall = 0 ;
54 }
55
56 virtual void saveXVec() const {
57 // Interface to save current values of observables (if supported by binding implementation)
58 } ;
59 virtual void restoreXVec() const {
60 // Interface to restore observables to saved values (if supported
61 // by binding implementation)
62 } ;
63
64 /// Name of function binding
65 virtual const char* getName() const {
66 return "(unnamed)" ;
67 }
68
69 virtual std::list<double>* binBoundaries(Int_t) const { return nullptr; }
70
71 /// Interface for returning an optional hint for initial sampling points when constructing a curve
72 /// projected on observable.
73 virtual std::list<double>* plotSamplingHint(RooAbsRealLValue& /*obs*/, double /*xlo*/, double /*xhi*/) const {
74 return nullptr;
75 }
76
77protected:
78 mutable Int_t _ncall ; ///< Function call counter
79 UInt_t _dimension; ///< Number of observables
80 bool _valid; ///< Is binding in valid state?
81 ClassDef(RooAbsFunc,0) ///< Abstract real-valued function interface
82};
83
84#endif
85
#define ClassDef(name, id)
Definition Rtypes.h:337
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition RooAbsFunc.h:27
virtual void saveXVec() const
Definition RooAbsFunc.h:56
UInt_t _dimension
Number of observables.
Definition RooAbsFunc.h:79
virtual ~RooAbsFunc()
Definition RooAbsFunc.h:32
bool isValid() const
Definition RooAbsFunc.h:37
void resetNumCall() const
Reset function call counter.
Definition RooAbsFunc.h:52
Int_t numCall() const
Return number of function calls since last reset.
Definition RooAbsFunc.h:47
virtual void restoreXVec() const
Definition RooAbsFunc.h:59
virtual double getMaxLimit(UInt_t dimension) const =0
RooAbsFunc(const RooAbsFunc &other)
Definition RooAbsFunc.h:30
RooAbsFunc(UInt_t dimension)
Definition RooAbsFunc.h:29
virtual double operator()(const double xvector[]) const =0
virtual double getMinLimit(UInt_t dimension) const =0
Int_t _ncall
Function call counter.
Definition RooAbsFunc.h:78
UInt_t getDimension() const
Definition RooAbsFunc.h:33
virtual const char * getName() const
Name of function binding.
Definition RooAbsFunc.h:65
bool _valid
Is binding in valid state?
Definition RooAbsFunc.h:80
virtual std::list< double > * plotSamplingHint(RooAbsRealLValue &, double, double) const
Interface for returning an optional hint for initial sampling points when constructing a curve projec...
Definition RooAbsFunc.h:73
virtual std::list< double > * binBoundaries(Int_t) const
Definition RooAbsFunc.h:69
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...