Logo ROOT   6.10/09
Reference Guide
RooScaledFunc.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooScaledFunc.h,v 1.6 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_SCALED_FUNC
17 #define ROO_SCALED_FUNC
18 
19 #include "RooAbsFunc.h"
20 
21 class RooScaledFunc : public RooAbsFunc {
22 public:
23  inline RooScaledFunc(const RooAbsFunc &func, Double_t scaleFactor) :
24  RooAbsFunc(func.getDimension()), _func(&func), _scaleFactor(scaleFactor) { }
25  inline virtual ~RooScaledFunc() { }
26 
27  inline virtual Double_t operator()(const Double_t xvector[]) const {
28  return _scaleFactor*(*_func)(xvector);
29  }
30  inline virtual Double_t getMinLimit(UInt_t index) const { return _func->getMinLimit(index); }
31  inline virtual Double_t getMaxLimit(UInt_t index) const { return _func->getMaxLimit(index); }
32 
33  virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Double_t xlo, Double_t xhi) const {
34  return _func->plotSamplingHint(obs,xlo,xhi) ;
35  }
36 
37 protected:
38  const RooAbsFunc *_func;
40 
41  ClassDef(RooScaledFunc,0) // Function binding applying scaling to another function binding
42 };
43 
44 #endif
45 
const RooAbsFunc * _func
Definition: RooScaledFunc.h:38
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &obs, Double_t xlo, Double_t xhi) const
Definition: RooScaledFunc.h:33
virtual Double_t operator()(const Double_t xvector[]) const
Definition: RooScaledFunc.h:27
#define ClassDef(name, id)
Definition: Rtypes.h:297
virtual Double_t getMaxLimit(UInt_t index) const
Definition: RooScaledFunc.h:31
RooScaledFunc(const RooAbsFunc &func, Double_t scaleFactor)
Definition: RooScaledFunc.h:23
virtual ~RooScaledFunc()
Definition: RooScaledFunc.h:25
UInt_t getDimension() const
Definition: RooAbsFunc.h:29
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual Double_t getMinLimit(UInt_t dimension) const =0
virtual Double_t getMaxLimit(UInt_t dimension) const =0
virtual std::list< Double_t > * plotSamplingHint(RooAbsRealLValue &, Double_t, Double_t) const
Definition: RooAbsFunc.h:66
double Double_t
Definition: RtypesCore.h:55
Double_t _scaleFactor
Definition: RooScaledFunc.h:39
double func(double *x, double *p)
Definition: stressTF1.cxx:213
virtual Double_t getMinLimit(UInt_t index) const
Definition: RooScaledFunc.h:30
RooAbsRealLValue is the common abstract base class for objects that represent a real value that may a...
Lightweight RooAbsFunction implementation that applies a constant scale factor to another RooAbsFunc...
Definition: RooScaledFunc.h:21
Abstract interface for evaluating a real-valued function of one real variable and performing numerica...
Definition: RooAbsFunc.h:23